From 5ef06ad78dba5c2d5f9195c9f03cc904ebe9fa03 Mon Sep 17 00:00:00 2001 From: mfnalex <1122571+mfnalex@users.noreply.github.com> Date: Tue, 14 Jul 2020 01:25:07 +0200 Subject: [PATCH 1/3] fixes #85 --- src/main/resources/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f4e50e8..eca3dfa 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -106,7 +106,7 @@ sorting-hotkeys: shift-right-click: true # Additionally to sorting hotkeys, you can quickly unload your inventory into a chest and vice versa -# using left-click or richt-click outside of a chest's inventory. +# using left-click or right-click outside of a chest's inventory. # A single click will only affect matching items (items that are already present in the other inventory) # and a double click will try to store/take all items. # Players can also enable/disable these shortcuts individually via /chestsort hotkeys From 7cb026e156d203d3583e16184bd0879c376a1373 Mon Sep 17 00:00:00 2001 From: mfnalex <1122571+mfnalex@users.noreply.github.com> Date: Tue, 14 Jul 2020 01:26:54 +0200 Subject: [PATCH 2/3] fixes #85 --- src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java | 2 +- src/main/resources/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java b/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java index 0de44d4..a748c41 100644 --- a/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java +++ b/src/main/java/de/jeff_media/ChestSort/ChestSortPlugin.java @@ -68,7 +68,7 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo String sortingMethod; ArrayList disabledWorlds; ChestSortAPIHandler api; - final int currentConfigVersion = 36; + final int currentConfigVersion = 37; boolean usingMatchingConfig = true; protected boolean debug = false; boolean verbose = true; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index eca3dfa..af265f8 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -576,4 +576,4 @@ log: false # Please DO NOT change the following line manually! # It is used by the automatic config updater. -config-version: 36 +config-version: 37 From d461084d5ffb2929a7d122ab43160ef00961ed8f Mon Sep 17 00:00:00 2001 From: mfnalex <1122571+mfnalex@users.noreply.github.com> Date: Tue, 14 Jul 2020 23:19:36 +0200 Subject: [PATCH 3/3] 8.15.1 --- CHANGELOG.md | 3 +++ pom.xml | 2 +- .../java/de/jeff_media/ChestSort/ChestSortOrganizer.java | 8 ++++++-- src/main/resources/plugin.yml | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d1b3bf..3756c94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 8.15.1 +- Fixed dirt in containers being affected by the right-click hotkey even though the player had no dirt in his inventory + ## 8.15.0 - Enabled left-click and right-click hotkey for 3rd party plugins implementing the ISortable interface from ChestSort's API (You only need this update if you use plugins depending on the ChestSortAPI) diff --git a/pom.xml b/pom.xml index 71003b2..1c4ae4c 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ ChestSort https://www.chestsort.de Automatically sorts your chests! - 8.15.0 + 8.15.1 jar diff --git a/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java b/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java index 6b5052e..7dc6059 100644 --- a/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java +++ b/src/main/java/de/jeff_media/ChestSort/ChestSortOrganizer.java @@ -554,7 +554,6 @@ public class ChestSortOrganizer { public void stuffInventoryIntoAnother(Inventory source, Inventory destination, Inventory origSource, boolean onlyMatchingStuff) { - Material placeholderMaterial = Material.DIRT; ItemStack[] hotbarStuff = new ItemStack[9]; boolean destinationIsPlayerInventory = true; if (destination.getHolder() == null || !(destination.getHolder() instanceof Player) || destination.getType() != InventoryType.PLAYER) { @@ -565,7 +564,7 @@ public class ChestSortOrganizer { if (destinationIsPlayerInventory) { for (int i = 0; i < 9; i++) { hotbarStuff[i] = destination.getItem(i); - destination.setItem(i, new ItemStack(placeholderMaterial, 64)); + destination.setItem(i, getPlaceholderBlock()); } } @@ -600,6 +599,11 @@ public class ChestSortOrganizer { } + // Used to temporarily fill the hotbar + private ItemStack getPlaceholderBlock() { + return new ItemStack(Material.BARRIER, 64); + } + public void stuffPlayerInventoryIntoAnother(PlayerInventory source, Inventory destination, boolean onlyMatchingStuff) { boolean destinationIsShulkerBox = destination.getType().name().equalsIgnoreCase("SHULKER_BOX"); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4ca41ef..d078b01 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: 8.15.0 +version: 8.15.1 api-version: "1.13" description: Allows automatic chest sorting author: mfnalex