diff --git a/build.gradle b/build.gradle index d7e0dda..0754179 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-1.0.1.3" +version = "1.7.10-1.0.1.4" group= "com.azanor.baubles" archivesBaseName = "Baubles" diff --git a/src/main/java/baubles/client/gui/GuiEvents.java b/src/main/java/baubles/client/gui/GuiEvents.java index 3a82e0e..e1042d3 100644 --- a/src/main/java/baubles/client/gui/GuiEvents.java +++ b/src/main/java/baubles/client/gui/GuiEvents.java @@ -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; + } } diff --git a/src/main/java/baubles/common/Baubles.java b/src/main/java/baubles/common/Baubles.java index ad964a9..c79abbe 100644 --- a/src/main/java/baubles/common/Baubles.java +++ b/src/main/java/baubles/common/Baubles.java @@ -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(); + } } diff --git a/src/main/java/baubles/common/Config.java b/src/main/java/baubles/common/Config.java index e87a315..04ed07b 100644 --- a/src/main/java/baubles/common/Config.java +++ b/src/main/java/baubles/common/Config.java @@ -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; diff --git a/src/main/resources/assets/baubles/textures/gui/expanded_inventory.png b/src/main/resources/assets/baubles/textures/gui/expanded_inventory.png index 98a63f7..3f24211 100644 Binary files a/src/main/resources/assets/baubles/textures/gui/expanded_inventory.png and b/src/main/resources/assets/baubles/textures/gui/expanded_inventory.png differ diff --git a/src/main/resources/changelog.txt b/src/main/resources/changelog.txt index d894356..d8527eb 100644 --- a/src/main/resources/changelog.txt +++ b/src/main/resources/changelog.txt @@ -1,3 +1,6 @@ +1.0.1.4 +- detect NEI so baubles "ring" button is placed correctly (most of the time). + 1.0.1.3 - created workaround for unnecessary calls to onEquipped and onUneEquipped - fixed a bug where onUneEquipped wasn't being called if you pick an item up from a slot