8.14.2 release

This commit is contained in:
mfnalex 2020-07-12 15:56:49 +02:00
parent 30408f1a8f
commit a42c172017
9 changed files with 48 additions and 17 deletions

View File

@ -1,4 +1,9 @@
# Changelog
## 8.14.2
- Made CrateReloaded hook and HeadDatabase hook toggleable
- Updated Chinese translation
## 8.14.1
- Prevent players from using left-click and right-click hotkeys on inventories created by CrateReloaded or HeadDatabase

View File

@ -111,5 +111,6 @@ Sortable holder = new Sortable(player)
Here is a complete example plugin that shows to add and use the ChestSort API: [LINK](https://github.com/JEFF-Media-GbR/ChestSortAPIExample)
## Source code
The source code for the API can be found [here](https://github.com/JEFF-Media-GbR/Spigot-ChestSortAPI).
## Javadocs & Source code
- [ChestSortAPI Javadocs](https://repo.jeff-media.de/javadocs/ChestSortAPI).
- [ChestSortAPI source code](https://github.com/JEFF-Media-GbR/Spigot-ChestSortAPI).

View File

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

View File

@ -28,10 +28,14 @@ public class ChestSortListener implements Listener {
final ChestSortPlugin plugin;
final MinepacksHook minepacksHook;
final HeadDatabaseHook headDatabaseHook;
final CrateReloadedHook crateReloadedHook;
ChestSortListener(ChestSortPlugin plugin) {
this.plugin = plugin;
this.minepacksHook = new MinepacksHook(plugin);
this.headDatabaseHook = new HeadDatabaseHook(plugin);
this.crateReloadedHook = new CrateReloadedHook(plugin);
}
@EventHandler
@ -478,14 +482,14 @@ public class ChestSortListener implements Listener {
}
// HeadDatabase hook
if(HeadDatabaseHook.isHeadDB(e.getClickedInventory())
|| HeadDatabaseHook.isHeadDB(e.getInventory())) {
if(headDatabaseHook.isHeadDB(e.getClickedInventory())
|| headDatabaseHook.isHeadDB(e.getInventory())) {
return;
}
// CrateReloaded hook
if(CrateReloadedHook.isCrate(e.getClickedInventory())
|| CrateReloadedHook.isCrate(e.getInventory())) {
if(crateReloadedHook.isCrate(e.getClickedInventory())
|| crateReloadedHook.isCrate(e.getInventory())) {
//if(plugin.debug) plugin.getLogger().info("Aborting hotkey because this is a CrateReloaded crate");
return;
}

View File

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

View File

@ -1,15 +1,23 @@
package de.jeff_media.ChestSort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin;
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.NotNull;
public class CrateReloadedHook {
ChestSortPlugin main;
public CrateReloadedHook(ChestSortPlugin main) {
this.main=main;
}
// CrateReloaded inventories seem to have a holder called cratereloaded.bo
// Maybe this changes? We just check if the String starts with cratereloaded
public static boolean isCrate(Inventory inv) {
public boolean isCrate(Inventory inv) {
if(inv==null) return false;
if(inv.getHolder()==null) return false;
if(!main.getConfig().getBoolean("hook-cratereloaded",true)) return false;
return inv.getHolder().getClass().getName().startsWith("cratereloaded");
}

View File

@ -1,12 +1,20 @@
package de.jeff_media.ChestSort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin;
import org.bukkit.inventory.Inventory;
public class HeadDatabaseHook {
public static boolean isHeadDB(Inventory inv) {
ChestSortPlugin main;
public HeadDatabaseHook(ChestSortPlugin main) {
this.main=main;
}
public boolean isHeadDB(Inventory inv) {
if(inv==null) return false;
if(inv.getHolder() == null) return false;
if(!main.getConfig().getBoolean("hook-headdatabase",true)) return false;
return inv.getHolder().getClass().getName().equals("me.arcaniax.hdb.object.HeadDatabaseHolder");
}

View File

@ -182,6 +182,14 @@ hook-inventorypages: true
# backpacks and sort them like a regular chest.
hook-minepacks: true
##### CrateReloaded #####
# Prevents the player from using hotkeys on a crate
hook-cratereloaded: true
##### HeadDatabase #####
# Prevents the player from using hotkeys on the HeadDatabase GUI
hook-headdatabase: true
##### Other backpack plugins #####
# ChestSort is able to detect backpacks from most backpack
# plugins like ShulkerPacks or Better Shulker Boxes.
@ -290,9 +298,6 @@ message-gui-right-click: "Empty Chest (Right-Click/Double-Right-Click)"
#message-gui-right-click: "Empty Chest (Right-Click/Double-Right-Click)"
##### Chinese - Thanks to qsefthuopq, Aira-Sakuranomiya and BackWheel for translating!
# Note: The following messages have been changed in version 8.11 and need a new translation:
# - message-gui-left-click
# - message-gui-right-click
#message-when-using-chest: "&7提示: 输入 &6/chestsort&7 来启用自动整理箱子."
#message-when-using-chest2: "&7提示: 输入 &6/chestsort&7 来关闭自动整理箱子."
#message-sorting-disabled: "&7自动整理箱子已 &c关闭&7."
@ -308,8 +313,8 @@ message-gui-right-click: "Empty Chest (Right-Click/Double-Right-Click)"
#message-gui-shift-click: "Shift + 左键"
#message-gui-double-click: "双击左键"
#message-gui-shift-right-click: "Shift + 右键"
#message-gui-left-click: "填充箱子 (左键)"
#message-gui-right-click: "清空箱子 (右键)"
#message-gui-left-click: "填充箱子 (左键/双击左键)"
#message-gui-right-click: "清空箱子 (右键/双击右键)"
##### Chinese (Traditional) 繁體中文 - Thanks to Command1264 for translating!
#message-when-using-chest: "&7小提醒: 輸入 &6/chestsort&7 來開啟自動整理箱子"
@ -571,4 +576,4 @@ log: false
# Please DO NOT change the following line manually!
# It is used by the automatic config updater.
config-version: 35
config-version: 36

View File

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