mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-24 05:44:39 +00:00
1 parent
9c24a69987
commit
0a8eec22db
6 files changed
+23
-6
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package baubles.client.gui;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
@@ -24,7 +26,7 @@ public class GuiEvents {
|
||||
int guiLeft = (event.gui.width - xSize) / 2;
|
||||
int guiTop = (event.gui.height - ySize) / 2;
|
||||
|
||||
if (!event.gui.mc.thePlayer.getActivePotionEffects().isEmpty()) {
|
||||
if (!event.gui.mc.thePlayer.getActivePotionEffects().isEmpty() && shiftNei()) {
|
||||
guiLeft = 160 + (event.gui.width - xSize - 200) / 2;
|
||||
}
|
||||
|
||||
@@ -33,7 +35,6 @@ public class GuiEvents {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(value = Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
@@ -52,4 +53,17 @@ public class GuiEvents {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Method isNEIHidden;
|
||||
boolean shiftNei() {
|
||||
boolean hidden=false;
|
||||
try {
|
||||
if (isNEIHidden==null) {
|
||||
Class fake = Class.forName("codechicken.nei.NEIClientConfig");
|
||||
isNEIHidden = fake.getMethod("isHidden");
|
||||
}
|
||||
hidden = (Boolean) isNEIHidden.invoke(null);
|
||||
} catch(Exception ex) { }
|
||||
return hidden;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user