aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-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;
}