diff --git a/client/gui/AEBaseMEGui.java b/client/gui/AEBaseMEGui.java index 64837d8b..59e24774 100644 --- a/client/gui/AEBaseMEGui.java +++ b/client/gui/AEBaseMEGui.java @@ -4,12 +4,14 @@ import java.text.NumberFormat; import java.util.List; import java.util.Locale; +import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import appeng.api.storage.data.IAEItemStack; import appeng.client.me.SlotME; import appeng.core.AEConfig; +import codechicken.nei.guihook.IContainerTooltipHandler; public abstract class AEBaseMEGui extends AEBaseGui { @@ -18,7 +20,6 @@ public abstract class AEBaseMEGui extends AEBaseGui super( container ); } - // @Override - NEI public List handleItemTooltip(ItemStack stack, int mousex, int mousey, List currenttip) { if ( stack != null ) diff --git a/integration/modules/NEI.java b/integration/modules/NEI.java index 2c3b79e1..1de1e1d0 100644 --- a/integration/modules/NEI.java +++ b/integration/modules/NEI.java @@ -3,12 +3,15 @@ package appeng.integration.modules; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import appeng.client.gui.AEBaseMEGui; import appeng.client.gui.implementations.GuiCraftingTerm; import appeng.client.gui.implementations.GuiPatternTerm; import appeng.integration.BaseModule; @@ -23,8 +26,9 @@ import appeng.integration.modules.NEIHelpers.NEIWorldCraftingHandler; import appeng.integration.modules.NEIHelpers.TerminalCraftingSlotFinder; import codechicken.nei.api.IStackPositioner; import codechicken.nei.guihook.GuiContainerManager; +import codechicken.nei.guihook.IContainerTooltipHandler; -public class NEI extends BaseModule implements IIntegrationModule, INEI +public class NEI extends BaseModule implements IIntegrationModule, INEI, IContainerTooltipHandler { public static NEI instance; @@ -60,6 +64,9 @@ public class NEI extends BaseModule implements IIntegrationModule, INEI registerRecipeHandler( new NEIWorldCraftingHandler() ); registerRecipeHandler( new NEIGrinderRecipeHandler() ); + // large stack tooltips + GuiContainerManager.addTooltipHandler( this ); + // crafting terminal... Method registerGuiOverlay = API.getDeclaredMethod( "registerGuiOverlay", new Class[] { Class.class, String.class, IStackPositioner.class } ); Class IOverlayHandler = Class.forName( "codechicken.nei.api.IOverlayHandler" ); @@ -115,4 +122,25 @@ public class NEI extends BaseModule implements IIntegrationModule, INEI } } + @Override + public List handleItemDisplayName(GuiContainer arg0, ItemStack arg1, List current) + { + return current; + } + + @Override + public List handleItemTooltip(GuiContainer guiScreen, ItemStack stack, int mousex, int mousey, List currenttip) + { + if ( guiScreen instanceof AEBaseMEGui ) + return ((AEBaseMEGui) guiScreen).handleItemTooltip( stack, mousex, mousey, currenttip ); + + return currenttip; + } + + @Override + public List handleTooltip(GuiContainer arg0, int arg1, int arg2, List current) + { + return current; + } + }