From 19abe0640f1706c52c8b1890ae9d34fe5d96d30d Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Sun, 31 Jan 2021 15:16:10 +0200 Subject: Switch overrides from Screen.init(MinecraftClient, int, int) to init() --- .../io/github/cottonmc/cotton/gui/client/CottonClientScreen.java | 7 +++---- .../github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/main/java/io') 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 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 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; } -- cgit