diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java | 9 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 11 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java index 6ebe8fc..cdb65af 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java @@ -1,6 +1,5 @@ package io.github.cottonmc.cotton.gui.client; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.LiteralText; @@ -51,14 +50,14 @@ public class CottonClientScreen extends Screen implements CottonScreenImpl { } @Override - public void init(MinecraftClient client, int screenWidth, int screenHeight) { - super.init(client, screenWidth, screenHeight); + public void init() { + super.init(); client.keyboard.setRepeatEvents(true); WPanel root = description.getRootPanel(); if (root != null) root.addPainters(); description.addPainters(); - reposition(screenWidth, screenHeight); + reposition(width, height); } @Override @@ -108,7 +107,7 @@ public class CottonClientScreen extends Screen implements CottonScreenImpl { } private void paint(MatrixStack matrices, int mouseX, int mouseY) { - super.renderBackground(matrices); + renderBackground(matrices); if (description!=null) { WPanel root = description.getRootPanel(); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index 0f7920b..f6c1429 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -1,6 +1,5 @@ package io.github.cottonmc.cotton.gui.client; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.render.DiffuseLighting; import net.minecraft.client.util.math.MatrixStack; @@ -64,15 +63,15 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl */ @Override - public void init(MinecraftClient client, int screenWidth, int screenHeight) { - super.init(client, screenWidth, screenHeight); + public void init() { + super.init(); client.keyboard.setRepeatEvents(true); WPanel root = description.getRootPanel(); if (root != null) root.addPainters(); description.addPainters(); - reposition(screenWidth, screenHeight); + reposition(width, height); } @Override @@ -167,7 +166,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl } else { //if (super.keyPressed(ch, keyCode, modifiers)) return true; if (description.getFocus()==null) { - if (MinecraftClient.getInstance().options.keyInventory.matchesKey(ch, keyCode)) { + if (client.options.keyInventory.matchesKey(ch, keyCode)) { this.client.player.closeHandledScreen(); return true; } @@ -242,7 +241,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl protected void drawBackground(MatrixStack matrices, float partialTicks, int mouseX, int mouseY) {} //This is just an AbstractContainerScreen thing; most Screens don't work this way. private void paint(MatrixStack matrices, int mouseX, int mouseY) { - super.renderBackground(matrices); + renderBackground(matrices); if (description!=null) { WPanel root = description.getRootPanel(); |