mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-24 22:14:31 +00:00
remove reflection after ismodloaded check (#190)
This commit is contained in:
1 parent
48e40d69fd
commit
53e0de0624
1 file changed
+4
-10
@@ -9,6 +9,7 @@ import net.minecraft.network.play.client.C0DPacketCloseWindow;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -65,15 +66,9 @@ public class TabRegistry {
|
||||
if (!mc.thePlayer.getActivePotionEffects().isEmpty()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
try {
|
||||
// Check whether NEI is hidden and enabled
|
||||
Class<?> c = Class.forName("codechicken.nei.NEIClientConfig");
|
||||
Object hidden = c.getMethod("isHidden").invoke(null);
|
||||
Object enabled = c.getMethod("isEnabled").invoke(null);
|
||||
if (hidden instanceof Boolean && enabled instanceof Boolean) {
|
||||
if ((Boolean) hidden || !((Boolean) enabled)) {
|
||||
// If NEI is disabled or hidden, offset the tabs by 60
|
||||
return 60;
|
||||
}
|
||||
if (NEIClientConfig.isHidden() || !NEIClientConfig.isEnabled()) {
|
||||
// If NEI is disabled or hidden, offset the tabs by 60
|
||||
return 60;
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
} else {
|
||||
@@ -81,7 +76,6 @@ public class TabRegistry {
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
|
||||
// No potions, no offset needed
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user