net.minecraft.client.gui.GuiIngame Java Examples
The following examples show how to use
net.minecraft.client.gui.GuiIngame.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinGuiInGame.java From LiquidBounce with GNU General Public License v3.0 | 5 votes |
@Inject(method = "renderTooltip", at = @At("HEAD"), cancellable = true) private void renderTooltip(ScaledResolution sr, float partialTicks, CallbackInfo callbackInfo) { final HUD hud = (HUD) LiquidBounce.moduleManager.getModule(HUD.class); if(Minecraft.getMinecraft().getRenderViewEntity() instanceof EntityPlayer && hud.getState() && hud.blackHotbarValue.get()) { EntityPlayer entityPlayer = (EntityPlayer) Minecraft.getMinecraft().getRenderViewEntity(); int middleScreen = sr.getScaledWidth() / 2; GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GuiIngame.drawRect(middleScreen - 91, sr.getScaledHeight() - 24, middleScreen + 90, sr.getScaledHeight(), Integer.MIN_VALUE); GuiIngame.drawRect(middleScreen - 91 - 1 + entityPlayer.inventory.currentItem * 20 + 1, sr.getScaledHeight() - 24, middleScreen - 91 - 1 + entityPlayer.inventory.currentItem * 20 + 22, sr.getScaledHeight() - 22 - 1 + 24, Integer.MAX_VALUE); GlStateManager.enableRescaleNormal(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); RenderHelper.enableGUIStandardItemLighting(); for(int j = 0; j < 9; ++j) { int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2; int l = sr.getScaledHeight() - 16 - 3; this.renderHotbarItem(j, k, l, partialTicks, entityPlayer); } RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.disableBlend(); LiquidBounce.eventManager.callEvent(new Render2DEvent(partialTicks)); AWTFontRenderer.Companion.garbageCollectionTick(); callbackInfo.cancel(); } }
Example #2
Source File: MixinGuiInGame.java From LiquidBounce with GNU General Public License v3.0 | 5 votes |
@Inject(method = "renderTooltip", at = @At("HEAD"), cancellable = true) private void renderTooltip(ScaledResolution sr, float partialTicks, CallbackInfo callbackInfo) { final HUD hud = (HUD) LiquidBounce.moduleManager.getModule(HUD.class); if (Minecraft.getMinecraft().getRenderViewEntity() instanceof EntityPlayer && hud.getState() && hud.blackHotbarValue.get()) { EntityPlayer entityPlayer = (EntityPlayer) Minecraft.getMinecraft().getRenderViewEntity(); int middleScreen = sr.getScaledWidth() / 2; GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GuiIngame.drawRect(middleScreen - 91, sr.getScaledHeight() - 24, middleScreen + 90, sr.getScaledHeight(), Integer.MIN_VALUE); GuiIngame.drawRect(middleScreen - 91 - 1 + entityPlayer.inventory.currentItem * 20 + 1, sr.getScaledHeight() - 24, middleScreen - 91 - 1 + entityPlayer.inventory.currentItem * 20 + 22, sr.getScaledHeight() - 22 - 1 + 24, Integer.MAX_VALUE); GlStateManager.enableRescaleNormal(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); RenderHelper.enableGUIStandardItemLighting(); for (int j = 0; j < 9; ++j) { int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2; int l = sr.getScaledHeight() - 16 - 3; this.renderHotbarItem(j, k, l, partialTicks, entityPlayer); } RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.disableBlend(); LiquidBounce.eventManager.callEvent(new Render2DEvent(partialTicks)); AWTFontRenderer.Companion.garbageCollectionTick(); callbackInfo.cancel(); } }
Example #3
Source File: ChatMsgHandler.java From BakaDanmaku with MIT License | 5 votes |
/** * 游戏界面显示人气值 * TODO: 取消人气值与单独 Handler 的关联 * * @param e 渲染游戏界面事件 */ @SubscribeEvent public static void showPopularityCount(RenderGameOverlayEvent.Post e) { GuiIngame gui = Minecraft.getMinecraft().ingameGUI; // 获取 Minecraft 实例中的 GUI FontRenderer renderer = Minecraft.getMinecraft().fontRenderer; // 获取 Minecraft 原版字体渲染器 // 当渲染快捷栏时候进行显示,意味着 F1 会隐藏 if (e.getType() == RenderGameOverlayEvent.ElementType.HOTBAR && gui != null && BakaDanmakuConfig.general.showPopularity) { double x = (Minecraft.getMinecraft().displayWidth * BakaDanmakuConfig.general.posX) / 100; // 获取的配置宽度百分比 double y = (Minecraft.getMinecraft().displayHeight * BakaDanmakuConfig.general.posY) / 100; // 获取的配置高度百分比 gui.drawString(renderer, String.format(BakaDanmakuConfig.general.popularityStyle, String.valueOf(tmpPopularityCount)), (int) x, (int) y, BakaDanmakuConfig.general.color); } }
Example #4
Source File: WrapperGuiIngame.java From ClientBase with MIT License | 4 votes |
public WrapperGuiIngame(GuiIngame var1) { super(var1); this.real = var1; }
Example #5
Source File: WrapperGuiIngame.java From ClientBase with MIT License | 4 votes |
public GuiIngame unwrap() { return this.real; }
Example #6
Source File: HyperiumGuiIngame.java From Hyperium with GNU Lesser General Public License v3.0 | 4 votes |
public HyperiumGuiIngame(GuiIngame parent) { this.parent = parent; }