mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2025-03-25 13:09:34 +01:00
Prevent Minepacks from being moved
This commit is contained in:
parent
73f361651f
commit
6ba7854de9
@ -1,4 +1,8 @@
|
||||
# Changelog
|
||||
## 8.10.5
|
||||
- ChestSort checks if Minepacks version is recent enough and, if not, disable the Minepacks hook.
|
||||
- Backpacks from Minepacks will no longer be moved into chests with the left-/right-click hotkeys
|
||||
|
||||
## 8.10.4
|
||||
- Fixed exception when sorting inventories in 1.8 because Inventory.getLocation() did not exist yet
|
||||
|
||||
|
2
TODO.md
2
TODO.md
@ -1,4 +1,6 @@
|
||||
# Todo
|
||||
## Minepacks API check
|
||||
When using Minepacks, check if version is 2.3.8 or later and otherwise disable the hook
|
||||
|
||||
## StackableItems
|
||||
Make it configurable whether ItemStacks > 64 items will stay unsorted, or sorted and reverted back to stacks of 64 items
|
||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
||||
<name>JeffChestSort</name>
|
||||
<url>https://www.chestsort.de</url>
|
||||
<description>Automatically sorts your chests!</description>
|
||||
<version>8.10.4</version>
|
||||
<version>8.10.5-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -639,8 +639,11 @@ public class ChestSortOrganizer {
|
||||
for(int i = playerInvStartSlot;i<=playerInvEndSlot;i++) {
|
||||
if(source.getItem(i)==null) continue;
|
||||
|
||||
if(plugin.hookMinepacks && plugin.listener.minepacksHook.isMinepacksBackpack(destination)
|
||||
&& plugin.listener.minepacksHook.isMinepacksBackpack(source.getItem(i))) continue;
|
||||
// This prevents Minepacks from being put into Minepacks
|
||||
/*if(plugin.hookMinepacks && plugin.listener.minepacksHook.isMinepacksBackpack(destination)
|
||||
&& plugin.listener.minepacksHook.isMinepacksBackpack(source.getItem(i))) continue;*/
|
||||
// This prevents Minepacks from being moved at all
|
||||
if(plugin.hookMinepacks && plugin.listener.minepacksHook.isMinepacksBackpack(source.getItem(i))) continue;
|
||||
|
||||
if(plugin.hookInventoryPages
|
||||
&& plugin.organizer.inventoryPagesHook.isButton(source.getItem(i), i, source)) continue;
|
||||
|
@ -26,7 +26,15 @@ public class MinepacksHook {
|
||||
public boolean isMinepacksBackpack(ItemStack item) {
|
||||
if(minepacks == null) return false;
|
||||
|
||||
if(minepacks.isBackpackItem(item)) return true;
|
||||
try {
|
||||
if(minepacks.getClass().getMethod("isBackpackItem", ItemStack.class) != null) {
|
||||
if(minepacks.isBackpackItem(item)) return true;
|
||||
}
|
||||
} catch (NoSuchMethodException | SecurityException e) {
|
||||
plugin.getLogger().warning("You are using a version of Minepacks that is too old and does not implement every API method needed by ChestSort. Minepacks hook will be disabled.");
|
||||
minepacks = null;
|
||||
plugin.hookMinepacks=false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
main: de.jeff_media.ChestSort.ChestSortPlugin
|
||||
name: ChestSort
|
||||
version: 8.10.4
|
||||
version: 8.10.5-SNAPSHOT
|
||||
api-version: 1.13
|
||||
description: Allows automatic chest sorting
|
||||
author: mfnalex
|
||||
|
Loading…
Reference in New Issue
Block a user