This commit is contained in:
mfnalex 2021-11-16 14:55:52 +01:00
parent 437a57e37d
commit 0c1ca91360
3 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,8 @@
# Changelog # Changelog
## 12.0.6
- Fixed "additional-hotkeys" not working for ender chests
## 12.0.4 ## 12.0.4
- Added config option "allow-gui" (defaults to true) - Added config option "allow-gui" (defaults to true)

View File

@ -9,7 +9,7 @@
<name>ChestSort</name> <name>ChestSort</name>
<url>https://www.chestsort.de</url> <url>https://www.chestsort.de</url>
<description>Allows automatic chest sorting!</description> <description>Allows automatic chest sorting!</description>
<version>12.0.4</version> <version>12.0.6</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

View File

@ -638,8 +638,12 @@ public class Listener implements org.bukkit.event.Listener {
return; return;
} }
// Possible fix for #57 // Possible fix for #57
if (e.getInventory().getHolder() == null) return; if (e.getInventory().getHolder() == null && !e.getView().getTopInventory().equals(p.getEnderChest())) {
if (e.getInventory().getHolder() == p && e.getInventory() != p.getInventory()) return; return;
}
if (e.getInventory().getHolder() == p && e.getInventory() != p.getInventory()) {
return;
}
// End Possible fix for #57 // End Possible fix for #57
if (e.getInventory().getType() != InventoryType.CHEST if (e.getInventory().getType() != InventoryType.CHEST
&& e.getInventory().getType() != InventoryType.DISPENSER && e.getInventory().getType() != InventoryType.DISPENSER
@ -647,6 +651,7 @@ public class Listener implements org.bukkit.event.Listener {
&& e.getInventory().getType() != InventoryType.ENDER_CHEST && e.getInventory().getType() != InventoryType.ENDER_CHEST
&& !e.getInventory().getType().name().equalsIgnoreCase("SHULKER_BOX") && !e.getInventory().getType().name().equalsIgnoreCase("SHULKER_BOX")
&& (e.getInventory().getHolder() == null || !e.getInventory().getHolder().getClass().toString().endsWith(".CraftBarrel")) && (e.getInventory().getHolder() == null || !e.getInventory().getHolder().getClass().toString().endsWith(".CraftBarrel"))
&& e.getInventory() != p.getEnderChest()
&& !(e.getInventory().getHolder() instanceof ISortable)) { && !(e.getInventory().getHolder() instanceof ISortable)) {
return; return;
} }