From c31b19c2ce036e1b07c19293772bb67c3eafe454 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Wed, 1 Nov 2023 05:10:55 +0100 Subject: [PATCH] Fixed GUI rendering in all versions --- .../de/florianmichael/viaforge/gui/GuiProtocolSelector.java | 4 ++-- .../de/florianmichael/viaforge/gui/GuiProtocolSelector.java | 2 +- .../de/florianmichael/viaforge/gui/GuiProtocolSelector.java | 2 +- .../de/florianmichael/viaforge/gui/GuiProtocolSelector.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 4d19471..a65f347 100644 --- a/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -80,7 +80,7 @@ public class GuiProtocolSelector extends Screen { addButton(new Button(width - 105, height - 25, 100, 20, new StringTextComponent("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs())); } - list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2); + addWidget(list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2)); } public void setStatus(final String status) { @@ -103,7 +103,7 @@ public class GuiProtocolSelector extends Screen { } renderBackground(matrices); - this.list.render(matrices, p_230430_2_, p_230430_3_, p_230430_4_); + list.render(matrices, p_230430_2_, p_230430_3_, p_230430_4_); super.render(matrices, p_230430_2_, p_230430_3_, p_230430_4_); diff --git a/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index ec36b5c..f090eb2 100644 --- a/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -80,7 +80,7 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(new Button(width - 105, height - 25, 100, 20, new TextComponent("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs())); } - list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2); + addWidget(list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2)); } public void setStatus(final String status) { diff --git a/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index f6668e5..65ae16a 100644 --- a/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -80,7 +80,7 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(new Button(width - 105, height - 25, 100, 20, new TextComponent("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs())); } - list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2); + addWidget(list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2)); } public void setStatus(final String status) { diff --git a/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 56aabd3..ac4f268 100644 --- a/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -79,7 +79,7 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(Button.builder(Component.literal("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs()).bounds(width - 105, height - 25, 100, 20).build()); } - list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2); + addWidget(list = new SlotList(minecraft, width, height, 3 + 3 /* start offset */ + (font.lineHeight + 2) * 3 /* title is 2 */, height - 30, font.lineHeight + 2)); } public void setStatus(final String status) {