From 13a64fce16a715d40b8a925975d37a42a36dcbd4 Mon Sep 17 00:00:00 2001 From: mfnalex Date: Sat, 16 Jan 2021 17:20:43 +0100 Subject: [PATCH] 9.0.1 release --- CHANGELOG.md | 3 +++ pom.xml | 12 +++++++++++- .../de/jeff_media/ChestSort/ChestSortOrganizer.java | 2 ++ .../de/jeff_media/ChestSort/ChestSortPlugin.java | 2 +- .../de/jeff_media/ChestSort/hooks/SlimeFunHook.java | 12 ++++++++++++ src/main/resources/config.yml | 8 +++++++- src/main/resources/plugin.yml | 2 +- 7 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 src/main/java/de/jeff_media/ChestSort/hooks/SlimeFunHook.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 84d623b..07be877 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 9.0.1 +- Added option "dont-move-slimefun-backpacks" to prevent a bug related to backpacks caused by Slimefun (false by default) + ## 9.0.0 THIS UPDATE IS IMPORTANT WHEN YOU ARE USING PLUGINS THAT INTERACT WITH CHESTSORT Note: When you are using other plugins that depend on the ChestSortAPI 2.0.0+ (e.g. probably the next release of ItemJoin AFAIK) you need at least this version of ChestSort. diff --git a/pom.xml b/pom.xml index eccae69..abdd856 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ChestSort https://www.chestsort.de Automatically sorts your chests! - 9.0.0 + 9.0.1 jar @@ -105,6 +105,10 @@ jeff-media-gbr https://repo.jeff-media.de/maven2 + + jitpack.io + https://jitpack.io + @@ -169,6 +173,12 @@ + + com.github.TheBusyBiscuit + Slimefun4 + RC-15 + provided + diff --git a/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java b/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java index 5f9dbc2..46ee092 100644 --- a/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java +++ b/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java @@ -2,6 +2,7 @@ package de.jeff_media.ChestSort; import de.jeff_media.ChestSort.hooks.CrackShotHook; import de.jeff_media.ChestSort.hooks.InventoryPagesHook; +import de.jeff_media.ChestSort.hooks.SlimeFunHook; import de.jeff_media.ChestSort.utils.CategoryLinePair; import de.jeff_media.ChestSort.utils.TypeMatchPositionPair; import de.jeff_media.ChestSort.utils.Utils; @@ -527,6 +528,7 @@ public class ChestSortOrganizer { for (int i = startSlot; i <= endSlot; i++) { if ((plugin.hookMinepacks && plugin.listener.minepacksHook.isMinepacksBackpack(items[i])) || (plugin.hookInventoryPages && inventoryPagesHook.isButton(items[i], i, inv)) + || (plugin.getConfig().getBoolean("dont-move-slimefun-backpacks") && SlimeFunHook.isSlimefunBackpack(items[i])) || isOversizedStack(items[i]) || chestSortEvent.isUnmovable(i) || chestSortEvent.isUnmovable(items[i])) { diff --git a/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java b/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java index fe3ce09..a312487 100644 --- a/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java +++ b/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java @@ -70,7 +70,7 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo String sortingMethod; ArrayList disabledWorlds; ChestSortAPIHandler api; - final int currentConfigVersion = 43; + final int currentConfigVersion = 44; boolean usingMatchingConfig = true; protected boolean debug = false; boolean verbose = true; diff --git a/src/main/java/de/jeff_media/ChestSort/hooks/SlimeFunHook.java b/src/main/java/de/jeff_media/ChestSort/hooks/SlimeFunHook.java new file mode 100644 index 0000000..208ea57 --- /dev/null +++ b/src/main/java/de/jeff_media/ChestSort/hooks/SlimeFunHook.java @@ -0,0 +1,12 @@ +package de.jeff_media.ChestSort.hooks; + +import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import org.bukkit.inventory.ItemStack; + +public class SlimeFunHook { + + public static boolean isSlimefunBackpack(ItemStack item) { + return SlimefunItem.getByItem(item) instanceof SlimefunBackpack; + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ec1e324..21dc956 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -233,6 +233,12 @@ hook-cratereloaded: true # Prevents the player from using hotkeys on the HeadDatabase GUI hook-headdatabase: true +##### Slimefun ##### +# Some versions of Slimefun fail to prevent putting the backpack into itself +# when you do so immediately after ChestSort moved a backpack. You can +# prevent ChestSort from moving Slimefun backpacks until they fixed this. +dont-move-slimefun-backpacks: false + ##### Other backpack plugins ##### # ChestSort is able to detect backpacks from most backpack # plugins like ShulkerPacks or Better Shulker Boxes. @@ -639,4 +645,4 @@ log: false # Please DO NOT change the following line manually! # It is used by the automatic config updater. -config-version: 43 \ No newline at end of file +config-version: 44 \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 52e0327..e159c0e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: de.jeff_media.ChestSort.ChestSortPlugin name: ChestSort -version: 9.0.0 +version: 9.0.1 api-version: "1.13" description: Allows automatic chest sorting author: mfnalex