8.11.1-SNAPSHOT

This commit is contained in:
mfnalex 2020-06-24 21:31:25 +02:00
parent 61b88c8d94
commit 5b16c3870d
6 changed files with 569 additions and 601 deletions

View File

@ -1,7 +1,8 @@
# Changelog
## 8.11.1
## 8.11.1-SNAPSHOT
- Improved help messages
- Huge code cleanup
- Improved performance by caching Reflection checks in the Minepacks hook
## 8.11.0
- Adjustet Left-Click / Right-Click hotkeys:

View File

@ -9,7 +9,7 @@
<name>JeffChestSort</name>
<url>https://www.chestsort.de</url>
<description>Automatically sorts your chests!</description>
<version>8.11.1</version>
<version>8.11.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ import org.bukkit.inventory.PlayerInventory;
import de.jeff_media.ChestSort.ChestSortPlugin;
import net.md_5.bungee.api.ChatColor;
import org.jetbrains.annotations.NotNull;
public class InventoryPagesHook {
@ -48,7 +49,7 @@ public class InventoryPagesHook {
}
public boolean isButton(ItemStack item, int slot, Inventory inv) {
public boolean isButton(@NotNull ItemStack item, int slot, @NotNull Inventory inv) {
if(!plugin.hookInventoryPages) {
return false;
@ -57,11 +58,7 @@ public class InventoryPagesHook {
if(!(inv instanceof PlayerInventory)) {
return false;
}
if(item == null) return false;
//System.out.println("Checking if slot " + slot + " "+ item.toString() + " is button");
// When using &f as color, we manually have to add this to the string because it gets removed by InventoryPages
if(prevName.startsWith("§f")) prevName = prevName.substring(2);
if(nextName.startsWith("§f")) nextName = nextName.substring(2);

View File

@ -13,6 +13,7 @@ public class MinepacksHook {
final ChestSortPlugin plugin;
MinepacksPlugin minepacks = null;
boolean skipReflection = false;
public MinepacksHook(ChestSortPlugin plugin) {
this.plugin = plugin;
@ -25,9 +26,11 @@ public class MinepacksHook {
public boolean isMinepacksBackpack(ItemStack item) {
if(minepacks == null) return false;
if(skipReflection && minepacks.isBackpackItem(item)) return true;
try {
minepacks.getClass().getMethod("isBackpackItem", ItemStack.class);
skipReflection=true;
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.");

View File

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