aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2021-01-31 15:16:10 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2021-01-31 15:16:10 +0200
commit19abe0640f1706c52c8b1890ae9d34fe5d96d30d (patch)
tree48f07d9cbc48cec31b19712af7b51fab40294c1f /src/main
parentd3c3945430fa30bfc765b70b4f1cb67bc2f600b1 (diff)
downloadLibGui-19abe0640f1706c52c8b1890ae9d34fe5d96d30d.tar.gz
LibGui-19abe0640f1706c52c8b1890ae9d34fe5d96d30d.tar.bz2
LibGui-19abe0640f1706c52c8b1890ae9d34fe5d96d30d.zip
Switch overrides from Screen.init(MinecraftClient, int, int) to init()
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java7
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java9
2 files changed, 7 insertions, 9 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 28887cd..055262e 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;
@@ -48,14 +47,14 @@ public class CottonClientScreen extends Screen implements TextHoverRendererScree
}
@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
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 bfda748..5b36a66 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;
@@ -61,15 +60,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
@@ -153,7 +152,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;
}