mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2025-01-06 00:17:52 +01:00
8.11.1-SNAPSHOT
This commit is contained in:
parent
61b88c8d94
commit
5b16c3870d
@ -1,7 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
## 8.11.1
|
## 8.11.1-SNAPSHOT
|
||||||
- Improved help messages
|
- Improved help messages
|
||||||
- Huge code cleanup
|
- Huge code cleanup
|
||||||
|
- Improved performance by caching Reflection checks in the Minepacks hook
|
||||||
|
|
||||||
## 8.11.0
|
## 8.11.0
|
||||||
- Adjustet Left-Click / Right-Click hotkeys:
|
- Adjustet Left-Click / Right-Click hotkeys:
|
||||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
|||||||
<name>JeffChestSort</name>
|
<name>JeffChestSort</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.11.1</version>
|
<version>8.11.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ import org.bukkit.inventory.PlayerInventory;
|
|||||||
|
|
||||||
import de.jeff_media.ChestSort.ChestSortPlugin;
|
import de.jeff_media.ChestSort.ChestSortPlugin;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class InventoryPagesHook {
|
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) {
|
if(!plugin.hookInventoryPages) {
|
||||||
return false;
|
return false;
|
||||||
@ -58,10 +59,6 @@ public class InventoryPagesHook {
|
|||||||
return false;
|
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
|
// 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(prevName.startsWith("§f")) prevName = prevName.substring(2);
|
||||||
if(nextName.startsWith("§f")) nextName = nextName.substring(2);
|
if(nextName.startsWith("§f")) nextName = nextName.substring(2);
|
||||||
|
@ -13,6 +13,7 @@ public class MinepacksHook {
|
|||||||
|
|
||||||
final ChestSortPlugin plugin;
|
final ChestSortPlugin plugin;
|
||||||
MinepacksPlugin minepacks = null;
|
MinepacksPlugin minepacks = null;
|
||||||
|
boolean skipReflection = false;
|
||||||
|
|
||||||
public MinepacksHook(ChestSortPlugin plugin) {
|
public MinepacksHook(ChestSortPlugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@ -25,9 +26,11 @@ public class MinepacksHook {
|
|||||||
|
|
||||||
public boolean isMinepacksBackpack(ItemStack item) {
|
public boolean isMinepacksBackpack(ItemStack item) {
|
||||||
if(minepacks == null) return false;
|
if(minepacks == null) return false;
|
||||||
|
if(skipReflection && minepacks.isBackpackItem(item)) return true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
minepacks.getClass().getMethod("isBackpackItem", ItemStack.class);
|
minepacks.getClass().getMethod("isBackpackItem", ItemStack.class);
|
||||||
|
skipReflection=true;
|
||||||
if(minepacks.isBackpackItem(item)) return true;
|
if(minepacks.isBackpackItem(item)) return true;
|
||||||
} catch (NoSuchMethodException | SecurityException e) {
|
} 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.");
|
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.");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
main: de.jeff_media.ChestSort.ChestSortPlugin
|
main: de.jeff_media.ChestSort.ChestSortPlugin
|
||||||
name: ChestSort
|
name: ChestSort
|
||||||
version: 8.11.1
|
version: 8.11.1-SNAPSHOT
|
||||||
api-version: "1.13"
|
api-version: "1.13"
|
||||||
description: Allows automatic chest sorting
|
description: Allows automatic chest sorting
|
||||||
author: mfnalex
|
author: mfnalex
|
||||||
|
Loading…
Reference in New Issue
Block a user