use of codechicken.nei.guihook.IContainerTooltipHandler in project LogisticsPipes by RS485.
the class NEIProxy method renderItemToolTip.
@Override
@SideOnly(Side.CLIENT)
@SneakyThrows({ NoSuchFieldException.class, IllegalAccessException.class })
public boolean renderItemToolTip(int mousex, int mousey, List<String> msg, EnumChatFormatting rarityColor, ItemStack stack) {
if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) {
return false;
}
GuiContainer window = (GuiContainer) Minecraft.getMinecraft().currentScreen;
List<String> tooltip = new LinkedList<String>();
FontRenderer font = GuiDraw.fontRenderer;
if (GuiContainerManager.shouldShowTooltip(window)) {
font = GuiContainerManager.getFontRenderer(stack);
if (stack != null) {
tooltip = msg;
}
for (IContainerTooltipHandler handler : (List<IContainerTooltipHandler>) ReflectionHelper.getPrivateField(List.class, GuiContainerManager.class, "instanceTooltipHandlers", GuiContainerManager.getManager())) {
tooltip = handler.handleItemTooltip(window, stack, mousex, mousey, tooltip);
}
}
if (tooltip.size() > 0) {
tooltip.set(0, tooltip.get(0) + "§h");
}
GuiDraw.drawMultilineTip(font, mousex + 12, mousey - 12, tooltip);
return true;
}
Aggregations