@SubscribeEvent public void drawScreenPost(DrawScreenEvent.Post event) { GuiScreen screen = event.getGui(); Point mousePos = GuiDraw.getMousePosition(); List<String> tooltip = new LinkedList<>(); ItemStack stack = ItemStack.EMPTY; if (instanceTooltipHandlers != null) { instanceTooltipHandlers.forEach(handler -> handler.handleTooltip(screen, mousePos.x, mousePos.y, tooltip)); } if (screen instanceof GuiContainer) { if (tooltip.isEmpty() && GuiHelper.shouldShowTooltip(screen)) { GuiContainer container = ((GuiContainer) screen); stack = GuiHelper.getStackMouseOver(container, false); if (!stack.isEmpty()) { tooltip.clear(); tooltip.addAll(GuiHelper.itemDisplayNameMultiline(stack, container, false)); } } } GuiDraw.drawMultiLineTip(stack, mousePos.x + 10, mousePos.y - 12, tooltip); }
@CoreEvent public void draw(final DrawScreenEvent.Post e) { final GuiScreen gui = this.mc.currentScreen; if (gui instanceof GuiMultiplayer) { } else if (gui instanceof GuiDisconnected) { if (this.disableBackButton!=null&&Config.getConfig().durationDisconnected.get()>=10) this.disableBackButton.displayString = I18n.format("serverobserver.gui.backandstop.time", I18n.format("serverobserver.gui.backandstop"), timeremain()); } else if (gui instanceof GuiMainMenu) { final GuiButton button = this.mainMenuButtonMulti; if (button!=null&&this.target.getIP()!=null&&!this.manualOpen) button.displayString = I18n.format("serverobserver.gui.maintomulti.time", I18n.format("menu.multiplayer"), timeremain()); } }
@SubscribeEvent @SideOnly(Side.CLIENT) public void onDrawScreenEventPost(DrawScreenEvent.Post event) { if (!this.shouldDisplayGuiOverlay(event.getGui())) { return; } this.getGuiOverlay().drawForeground(event.getMouseX(), event.getMouseY()); }
@SubscribeEvent public void onGuiInit(DrawScreenEvent event) { if(event.gui instanceof GuiMainMenu) { if(!OpenGlHelper.shadersSupported) { String t = "you won't be able to enjoy ShadyMod and its children ;("; FontRenderer font = Minecraft.getMinecraft().fontRendererObj; Gui.drawRect(0, 0, font.getStringWidth(t), 20, 0x90000000); font.drawStringWithShadow("Shaders are not supported by your graphical card,", 0, 0, 0xFFFF0707); font.drawStringWithShadow(t, 0, 10, 0xFFFF0707); } } }
@SideOnly(Side.CLIENT) @SubscribeEvent public void onGuiPost(DrawScreenEvent.Pre event) { if (checker.isRunnable(event.getGui())) { LAST.clear(); } }
@SideOnly(Side.CLIENT) @SubscribeEvent public void onGuiPost(DrawScreenEvent.Post event) { if (checker.isRunnable(event.getGui())) { LAST.run(); } }
@SubscribeEvent public void draw(final DrawScreenEvent.Post e) { this.guiHandler.draw(e); }
@SubscribeEvent public void onDrawScreen(DrawScreenEvent.Post event) { GuiOverrideHelper.draw(event); }