diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-07-11 13:25:30 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-07-11 13:28:02 +0300 |
commit | 453a8a9d7cb79d87c1720441442fc6944f1eb92a (patch) | |
tree | 5bcbbcb2fcad9a463a0c53632d4df934f012e00e /src/main/java/io | |
parent | 5a8a3011e4830dfadb080d2c821f12dc517b9152 (diff) | |
download | LibGui-453a8a9d7cb79d87c1720441442fc6944f1eb92a.tar.gz LibGui-453a8a9d7cb79d87c1720441442fc6944f1eb92a.tar.bz2 LibGui-453a8a9d7cb79d87c1720441442fc6944f1eb92a.zip |
Call Inventory.onOpen and Inventory.onClose in SyncedGuiDescription
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java index b51e9ee..ebf9e56 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java @@ -92,6 +92,7 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio this.world = playerInventory.player.world; this.propertyDelegate = propertyDelegate; if (propertyDelegate!=null && propertyDelegate.size()>0) this.addProperties(propertyDelegate); + if (blockInventory != null) blockInventory.onOpen(playerInventory.player); } public WPanel getRootPanel() { @@ -477,6 +478,12 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio public boolean canUse(PlayerEntity entity) { return (blockInventory!=null) ? blockInventory.canPlayerUse(entity) : true; } + + @Override + public void close(PlayerEntity player) { + super.close(player); + if (blockInventory != null) blockInventory.onClose(player); + } //} @Override |