List of usage examples for net.minecraftforge.client.event GuiScreenEvent.DrawScreenEvent.Post getGui
public Screen getGui()
From source file:de.canitzp.rarmor.event.ClientEvents.java
@SubscribeEvent public static void onGuiRender(GuiScreenEvent.DrawScreenEvent.Post event) { if (invButton != null) { if (event.getGui() instanceof GuiInventory) { if (invButton.visible && invButton.isMouseOver()) { Minecraft mc = Minecraft.getMinecraft(); GuiUtils.drawHoveringText(Collections.singletonList(I18n.format(RarmorAPI.MOD_ID + ".open")), event.getMouseX(), event.getMouseY(), mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); }// w w w . ja v a 2 s . c o m IRarmorData data = RarmorAPI.methodHandler.getDataForChestplate(Minecraft.getMinecraft().player, true); invButton.visible = data != null; } } }
From source file:vazkii.quark.management.feature.FavoriteItems.java
License:Creative Commons License
@SubscribeEvent @SideOnly(Side.CLIENT)/*from ww w. j a v a 2 s . com*/ public void drawEvent(GuiScreenEvent.DrawScreenEvent.Post event) { if (hovering && event.getGui() instanceof GuiContainer) { GuiContainer guiInv = (GuiContainer) event.getGui(); Container container = guiInv.inventorySlots; int guiLeft = guiInv.getGuiLeft(); int guiTop = guiInv.getGuiTop(); GlStateManager.color(1F, 1F, 1F); GlStateManager.pushMatrix(); GlStateManager.disableDepth(); GlStateManager.disableLighting(); for (Slot s : container.inventorySlots) { ItemStack stack = s.getStack(); if (isItemFavorited(stack)) { Minecraft.getMinecraft().renderEngine.bindTexture(LibMisc.GENERAL_ICONS_RESOURCE); guiInv.drawTexturedModalRect(guiLeft + s.xPos, guiTop + s.yPos, 96, 0, 16, 16); } } GlStateManager.popMatrix(); } hovering = false; }