diff --git a/README.md b/README.md index 36e7f7f..1bef700 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ChestSort -1.8 to 1.14 compatible Minecraft-/Spigot-Plugin to allow automatic chest and inventory sorting. +1.8.x to 1.15.x compatible Minecraft-/Spigot-Plugin to allow automatic chest and inventory sorting. ## Download & more information Please see the related topic at spigotmc.org for information regarding the commands, permissions and download links: @@ -7,7 +7,7 @@ Please see the related topic at spigotmc.org for information regarding the comma https://www.spigotmc.org/resources/1-13-chestsort.59773/ ## Building .jar file -To build the .jar file, you will need maven. Also, the CrackShot library is in no public repository, so please create a directory called `lib` and put the latest CrackShot.jar file inside it. Now you can do `mvn install` +To build the .jar file, you will need maven. Also, the CrackShot library is in no public repository, so please create a directory called `lib` and put the latest CrackShot.jar file [(available here)](https://www.spigotmc.org/resources/crackshot-guns.48301/) inside it. Now you can do `mvn install` ## Technical stuff ChestSort takes an instance of org.bukkit.inventory.Inventory and copies the contents. The resulting array is sorted by rules defined in the config.yml. This takes far less than one millisecond for a whole chest. So there should be no problems even on big servers, where hundreds of players are using chests at the same time. diff --git a/pom.xml b/pom.xml index bebc4b2..4282bd3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.jeffclan JeffChestSort - 7.4 + 7.5-pre1 jar JeffChestSort @@ -95,7 +95,7 @@ com.shampaggon.crackshot CSUtility - 0.98.9 + latest system ${project.basedir}/lib/CrackShot.jar diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java index f71c6a6..f59bfe0 100644 --- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java +++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java @@ -181,9 +181,9 @@ public class JeffChestSortListener implements Listener { } private boolean belongsToChestLikeBlock(Inventory inventory) { - // Special check if the inventory is an Enderchest, - // as for Enderchests getHolder() is null - if (inventory.getType() == InventoryType.ENDER_CHEST) { + + // Check by InventoryType + if (inventory.getType() == InventoryType.ENDER_CHEST || inventory.getType() == InventoryType.SHULKER_BOX) { return true; } @@ -192,10 +192,11 @@ public class JeffChestSortListener implements Listener { return false; } + // Check by InventoryHolder // Only continue if the inventory belongs to one of the following: // - a chest, // - double chest, - // - shulkerbox (MC 1.11) + // - shulkerbox (MC 1.11) (obsolete, is checked above by InventoryType // - barrel (MC 1.14) // - Minecart with Chest (MC 1.0) // NOTE: Hoppers are NOT included because it may break item sorters like those: https://minecraft.gamepedia.com/Tutorials/Hopper#Item_sorter @@ -208,7 +209,7 @@ public class JeffChestSortListener implements Listener { // in Spigot 1.14 while a double chest returns org.bukkit.block.DoubleChest if (!(inventory.getHolder() instanceof Chest) && !(inventory.getHolder() instanceof DoubleChest) && !(inventory.getHolder().getClass().toString().endsWith(".CraftMinecartChest")) - && !(inventory.getHolder().getClass().toString().endsWith(".CraftShulkerBox")) + && !(inventory.getHolder().getClass().toString().endsWith(".CraftShulkerBox")) //Obsolete, is checked above by InventoryType && !(inventory.getHolder().getClass().toString().endsWith(".CraftBarrel"))) { return false; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f187e7d..9eb9674 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: de.jeffclan.JeffChestSort.JeffChestSortPlugin name: ChestSort -version: 7.4 +version: 7.5-pre1 api-version: 1.13 description: Allows automatic chest sorting author: mfnalex