InventoryTweak sorting support (#3603)

This commit is contained in:
fscan
2018-07-14 21:07:00 +02:00
committed by GitHub
parent 67c733b418
commit f4ef7edf86
5 changed files with 61 additions and 5 deletions
@@ -0,0 +1,41 @@
package appeng.integration.modules.inventorytweaks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Loader;
import invtweaks.api.InvTweaksAPI;
import appeng.integration.abstraction.IInvTweaks;
public class InventoryTweaksModule implements IInvTweaks
{
InvTweaksAPI api = null;
public InventoryTweaksModule()
{
try
{
api = (InvTweaksAPI) Class.forName( "invtweaks.forge.InvTweaksMod", true, Loader.instance().getModClassLoader() )
.getField( "instance" )
.get( null );
}
catch( Exception ex )
{
}
}
@Override
public boolean isEnabled()
{
return api != null;
}
@Override
public int compareItems( ItemStack i, ItemStack j )
{
return api.compareItems( i, j );
}
}