aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java8
1 files changed, 8 insertions, 0 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 4287565..4b7a726 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
@@ -70,6 +70,13 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
}
/**
+ * Clears the heavyweight peers of this screen's GUI description.
+ */
+ private void clearPeers() {
+ description.slots.clear();
+ }
+
+ /**
* Repositions the root panel.
*
* @param screenWidth the width of the screen
@@ -78,6 +85,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl
protected void reposition(int screenWidth, int screenHeight) {
WPanel basePanel = description.getRootPanel();
if (basePanel!=null) {
+ clearPeers();
basePanel.validate(description);
backgroundWidth = basePanel.getWidth();