Merge pull request #87 from JEFF-Media-GbR/BestTool

Fixed dirt randomly being affected by right click hotkey
This commit is contained in:
mfnalex 2020-07-14 23:24:56 +02:00 committed by GitHub
commit f935964ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,8 @@
# Changelog # 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 ## 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) - 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)

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>Automatically sorts your chests!</description> <description>Automatically sorts your chests!</description>
<version>8.15.0</version> <version>8.15.1</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

View File

@ -554,7 +554,6 @@ public class ChestSortOrganizer {
public void stuffInventoryIntoAnother(Inventory source, Inventory destination, Inventory origSource, boolean onlyMatchingStuff) { public void stuffInventoryIntoAnother(Inventory source, Inventory destination, Inventory origSource, boolean onlyMatchingStuff) {
Material placeholderMaterial = Material.DIRT;
ItemStack[] hotbarStuff = new ItemStack[9]; ItemStack[] hotbarStuff = new ItemStack[9];
boolean destinationIsPlayerInventory = true; boolean destinationIsPlayerInventory = true;
if (destination.getHolder() == null || !(destination.getHolder() instanceof Player) || destination.getType() != InventoryType.PLAYER) { if (destination.getHolder() == null || !(destination.getHolder() instanceof Player) || destination.getType() != InventoryType.PLAYER) {
@ -565,7 +564,7 @@ public class ChestSortOrganizer {
if (destinationIsPlayerInventory) { if (destinationIsPlayerInventory) {
for (int i = 0; i < 9; i++) { for (int i = 0; i < 9; i++) {
hotbarStuff[i] = destination.getItem(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, public void stuffPlayerInventoryIntoAnother(PlayerInventory source,
Inventory destination, boolean onlyMatchingStuff) { Inventory destination, boolean onlyMatchingStuff) {
boolean destinationIsShulkerBox = destination.getType().name().equalsIgnoreCase("SHULKER_BOX"); boolean destinationIsShulkerBox = destination.getType().name().equalsIgnoreCase("SHULKER_BOX");

View File

@ -68,7 +68,7 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
String sortingMethod; String sortingMethod;
ArrayList<String> disabledWorlds; ArrayList<String> disabledWorlds;
ChestSortAPIHandler api; ChestSortAPIHandler api;
final int currentConfigVersion = 36; final int currentConfigVersion = 37;
boolean usingMatchingConfig = true; boolean usingMatchingConfig = true;
protected boolean debug = false; protected boolean debug = false;
boolean verbose = true; boolean verbose = true;

View File

@ -106,7 +106,7 @@ sorting-hotkeys:
shift-right-click: true shift-right-click: true
# Additionally to sorting hotkeys, you can quickly unload your inventory into a chest and vice versa # 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) # 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. # and a double click will try to store/take all items.
# Players can also enable/disable these shortcuts individually via /chestsort hotkeys # Players can also enable/disable these shortcuts individually via /chestsort hotkeys
@ -576,4 +576,4 @@ log: false
# Please DO NOT change the following line manually! # Please DO NOT change the following line manually!
# It is used by the automatic config updater. # It is used by the automatic config updater.
config-version: 36 config-version: 37

View File

@ -1,6 +1,6 @@
main: de.jeff_media.ChestSort.ChestSortPlugin main: de.jeff_media.ChestSort.ChestSortPlugin
name: ChestSort name: ChestSort
version: 8.15.0 version: 8.15.1
api-version: "1.13" api-version: "1.13"
description: Allows automatic chest sorting description: Allows automatic chest sorting
author: mfnalex author: mfnalex