Fix edit backpacks in /firm storage sometimes not resizing the screen properly
This commit is contained in:
@@ -34,10 +34,18 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
|
|||||||
protected int x;
|
protected int x;
|
||||||
@Shadow
|
@Shadow
|
||||||
protected int y;
|
protected int y;
|
||||||
|
@Shadow
|
||||||
|
protected int backgroundHeight;
|
||||||
|
@Shadow
|
||||||
|
protected int backgroundWidth;
|
||||||
@Unique
|
@Unique
|
||||||
public CustomGui override;
|
public CustomGui override;
|
||||||
@Unique
|
@Unique
|
||||||
public boolean hasRememberedSlots = false;
|
public boolean hasRememberedSlots = false;
|
||||||
|
@Unique
|
||||||
|
private int originalBackgroundWidth;
|
||||||
|
@Unique
|
||||||
|
private int originalBackgroundHeight;
|
||||||
|
|
||||||
protected PatchHandledScreen(Text title) {
|
protected PatchHandledScreen(Text title) {
|
||||||
super(title);
|
super(title);
|
||||||
@@ -51,6 +59,14 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCustomGui_Firmament(@Nullable CustomGui gui) {
|
public void setCustomGui_Firmament(@Nullable CustomGui gui) {
|
||||||
|
if (this.override != null) {
|
||||||
|
backgroundHeight = originalBackgroundHeight;
|
||||||
|
backgroundWidth = originalBackgroundWidth;
|
||||||
|
}
|
||||||
|
if (gui != null) {
|
||||||
|
originalBackgroundHeight = backgroundHeight;
|
||||||
|
originalBackgroundWidth = backgroundWidth;
|
||||||
|
}
|
||||||
this.override = gui;
|
this.override = gui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user