Change the overlay checked so overlays aren't rendered over the hotbar

This commit is contained in:
Mrbysco 2024-03-09 16:31:10 +01:00
parent 951355bf05
commit f1c7b2491e

View file

@ -165,7 +165,7 @@ public class ClientEvents {
@SubscribeEvent @SubscribeEvent
public void onGameOverlay(RenderGuiOverlayEvent.Post event) { public void onGameOverlay(RenderGuiOverlayEvent.Post event) {
Minecraft minecraft = Minecraft.getInstance(); Minecraft minecraft = Minecraft.getInstance();
if (event.getOverlay() == GuiOverlayManager.findOverlay(new ResourceLocation("crosshair")) && minecraft.screen == null) { //ALL if (event.getOverlay() == GuiOverlayManager.findOverlay(new ResourceLocation("portal")) && minecraft.screen == null) { //ALL
GuiGraphics guiGraphics = event.getGuiGraphics(); GuiGraphics guiGraphics = event.getGuiGraphics();
Player player = minecraft.player; Player player = minecraft.player;
if (player == null) { if (player == null) {
@ -202,7 +202,7 @@ public class ClientEvents {
if (!stack.isEmpty() && stack.getItem() == CommonConfig.Other.redstoneConfigureItem) { if (!stack.isEmpty() && stack.getItem() == CommonConfig.Other.redstoneConfigureItem) {
expl = ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem"); expl = ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem");
} else { } else {
expl = ChatFormatting.GRAY.toString() + ChatFormatting.ITALIC + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", I18n.get(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId())); expl = ChatFormatting.GRAY.toString() + ChatFormatting.ITALIC + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", I18n.get(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId()));
} }
guiGraphics.drawString(font, expl, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 15), 0xFFFFFF); guiGraphics.drawString(font, expl, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 15), 0xFFFFFF);
} }