aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2023-11-26 17:26:53 +0200
committerJuuz <6596629+Juuxel@users.noreply.github.com>2023-11-26 17:26:53 +0200
commit1cf8b2c87e4000666c17bc335d133b51c34159dd (patch)
tree49e99aaf9a5258d2eb9f0d669c2fc8d395e27dac
parentc82111365b52fe4710a4192a16ca5df70510949d (diff)
downloadLibGui-1cf8b2c87e4000666c17bc335d133b51c34159dd.tar.gz
LibGui-1cf8b2c87e4000666c17bc335d133b51c34159dd.tar.bz2
LibGui-1cf8b2c87e4000666c17bc335d133b51c34159dd.zip
Remove unnecessary CottonInventoryScreenImpl interface
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java5
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/impl/client/CottonInventoryScreenImpl.java7
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/impl/mixin/client/HandledScreenMixin.java4
3 files changed, 4 insertions, 12 deletions
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 071d0ca..7b86417 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
@@ -13,7 +13,7 @@ import net.minecraft.text.Text;
import io.github.cottonmc.cotton.gui.GuiDescription;
import io.github.cottonmc.cotton.gui.SyncedGuiDescription;
import io.github.cottonmc.cotton.gui.impl.VisualLogger;
-import io.github.cottonmc.cotton.gui.impl.client.CottonInventoryScreenImpl;
+import io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl;
import io.github.cottonmc.cotton.gui.impl.client.FocusElements;
import io.github.cottonmc.cotton.gui.impl.client.MouseInputHandler;
import io.github.cottonmc.cotton.gui.impl.client.NarrationHelper;
@@ -30,7 +30,7 @@ import org.lwjgl.opengl.GL11;
*
* @param <T> the description type
*/
-public class CottonInventoryScreen<T extends SyncedGuiDescription> extends HandledScreen<T> implements CottonInventoryScreenImpl {
+public class CottonInventoryScreen<T extends SyncedGuiDescription> extends HandledScreen<T> implements CottonScreenImpl {
private static final VisualLogger LOGGER = new VisualLogger(CottonInventoryScreen.class);
protected SyncedGuiDescription description;
@Nullable protected WWidget lastResponder = null;
@@ -284,7 +284,6 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
* @param delta the tick delta
* @since 9.2.0
*/
- @Override
public void paintDescription(DrawContext context, int mouseX, int mouseY, float delta) {
if (description!=null) {
WPanel root = description.getRootPanel();
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/impl/client/CottonInventoryScreenImpl.java b/src/main/java/io/github/cottonmc/cotton/gui/impl/client/CottonInventoryScreenImpl.java
deleted file mode 100644
index 877c92a..0000000
--- a/src/main/java/io/github/cottonmc/cotton/gui/impl/client/CottonInventoryScreenImpl.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package io.github.cottonmc.cotton.gui.impl.client;
-
-import net.minecraft.client.gui.DrawContext;
-
-public interface CottonInventoryScreenImpl extends CottonScreenImpl {
- void paintDescription(DrawContext context, int mouseX, int mouseY, float delta);
-}
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/impl/mixin/client/HandledScreenMixin.java b/src/main/java/io/github/cottonmc/cotton/gui/impl/mixin/client/HandledScreenMixin.java
index 1697ab6..45b30f8 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/impl/mixin/client/HandledScreenMixin.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/impl/mixin/client/HandledScreenMixin.java
@@ -3,7 +3,7 @@ package io.github.cottonmc.cotton.gui.impl.mixin.client;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
-import io.github.cottonmc.cotton.gui.impl.client.CottonInventoryScreenImpl;
+import io.github.cottonmc.cotton.gui.client.CottonInventoryScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -21,7 +21,7 @@ abstract class HandledScreenMixin {
allow = 1
)
private void onSuperRender(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo info) {
- if (this instanceof CottonInventoryScreenImpl cottonInventoryScreen) {
+ if ((Object) this instanceof CottonInventoryScreen<?> cottonInventoryScreen) {
cottonInventoryScreen.paintDescription(context, mouseX, mouseY, delta);
}
}