Fix for ring position in NEI
This commit is contained in:
Azanor committed 2014-08-12 09:41:09 +02: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;
}
}
+3 -1
View File
@@ -24,7 +24,7 @@ public class Baubles {
public static final String MODID = "Baubles";
public static final String MODNAME = "Baubles";
public static final String VERSION = "1.0.1.3";
public static final String VERSION = "1.0.1.4";
@SidedProxy(clientSide = "baubles.client.ClientProxy", serverSide = "baubles.common.CommonProxy")
public static CommonProxy proxy;
@@ -61,6 +61,7 @@ public class Baubles {
/////////////////////
Config.save();
}
@EventHandler
@@ -72,6 +73,7 @@ public class Baubles {
@EventHandler
public void postInit(FMLPostInitializationEvent evt) {
Config.initRecipe();
}
}
-2
View File
@@ -2,9 +2,7 @@ package baubles.common;
import java.io.File;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Configuration;
import baubles.common.items.ItemRing;
import cpw.mods.fml.common.registry.GameRegistry;