diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java | 8 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 11 |
2 files changed, 16 insertions, 3 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 b3f9bcd..6adf34e 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 @@ -49,13 +49,19 @@ public class CottonClientScreen extends Screen implements TextHoverRendererScree @Override public void init(MinecraftClient client, int screenWidth, int screenHeight) { - super.init(client, screenWidth, screenHeight); + client.keyboard.enableRepeatEvents(true); description.addPainters(); reposition(screenWidth, screenHeight); } + @Override + public void removed() { + super.removed(); + this.client.keyboard.enableRepeatEvents(false); + } + /** * Repositions the root panel. * 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 6b65f07..e69755d 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 @@ -61,14 +61,21 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl */ @Override - public void init(MinecraftClient minecraftClient_1, int screenWidth, int screenHeight) { - super.init(minecraftClient_1, screenWidth, screenHeight); + public void init(MinecraftClient client, int screenWidth, int screenHeight) { + super.init(client, screenWidth, screenHeight); + client.keyboard.enableRepeatEvents(true); description.addPainters(); reposition(screenWidth, screenHeight); } + @Override + public void removed() { + super.removed(); + this.client.keyboard.enableRepeatEvents(false); + } + /** * Clears the heavyweight peers of this screen's GUI description. */ |