From 0c1ca9136051bd4decd54a039a70bb7d6205ce7e Mon Sep 17 00:00:00 2001 From: mfnalex <1122571+mfnalex@users.noreply.github.com> Date: Tue, 16 Nov 2021 14:55:52 +0100 Subject: [PATCH] 12.0.6 --- CHANGELOG.md | 3 +++ pom.xml | 2 +- .../java/de/jeff_media/chestsort/listeners/Listener.java | 9 +++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b83360f..1abad43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 12.0.6 +- Fixed "additional-hotkeys" not working for ender chests + ## 12.0.4 - Added config option "allow-gui" (defaults to true) diff --git a/pom.xml b/pom.xml index 27e8d92..a7272bd 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ChestSort https://www.chestsort.de Allows automatic chest sorting! - 12.0.4 + 12.0.6 jar diff --git a/src/main/java/de/jeff_media/chestsort/listeners/Listener.java b/src/main/java/de/jeff_media/chestsort/listeners/Listener.java index 7bcf1b4..9f5c296 100644 --- a/src/main/java/de/jeff_media/chestsort/listeners/Listener.java +++ b/src/main/java/de/jeff_media/chestsort/listeners/Listener.java @@ -638,8 +638,12 @@ public class Listener implements org.bukkit.event.Listener { return; } // Possible fix for #57 - if (e.getInventory().getHolder() == null) return; - if (e.getInventory().getHolder() == p && e.getInventory() != p.getInventory()) return; + if (e.getInventory().getHolder() == null && !e.getView().getTopInventory().equals(p.getEnderChest())) { + return; + } + if (e.getInventory().getHolder() == p && e.getInventory() != p.getInventory()) { + return; + } // End Possible fix for #57 if (e.getInventory().getType() != InventoryType.CHEST && 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().name().equalsIgnoreCase("SHULKER_BOX") && (e.getInventory().getHolder() == null || !e.getInventory().getHolder().getClass().toString().endsWith(".CraftBarrel")) + && e.getInventory() != p.getEnderChest() && !(e.getInventory().getHolder() instanceof ISortable)) { return; }