8.14.1 release

This commit is contained in:
mfnalex 2020-07-12 12:34:29 +02:00
parent b304bd3477
commit 30408f1a8f
6 changed files with 49 additions and 2 deletions

View File

@ -1,4 +1,7 @@
# Changelog
## 8.14.1
- Prevent players from using left-click and right-click hotkeys on inventories created by CrateReloaded or HeadDatabase
## 8.14.0
- Updated Russian and Turkish translation
- Separated ChestSort plugin and API. You can view the new API documentation [here](https://github.com/JEFF-Media-GbR/Spigot-ChestSort/blob/master/HOW_TO_USE_API.md).

View File

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

View File

@ -1,5 +1,7 @@
package de.jeff_media.ChestSort;
import de.jeff_media.ChestSort.hooks.CrateReloadedHook;
import de.jeff_media.ChestSort.hooks.HeadDatabaseHook;
import de.jeff_media.ChestSort.hooks.MinepacksHook;
import de.jeff_media.ChestSort.utils.LlamaUtils;
import org.bukkit.Bukkit;
@ -475,6 +477,19 @@ public class ChestSortListener implements Listener {
return;
}
// HeadDatabase hook
if(HeadDatabaseHook.isHeadDB(e.getClickedInventory())
|| HeadDatabaseHook.isHeadDB(e.getInventory())) {
return;
}
// CrateReloaded hook
if(CrateReloadedHook.isCrate(e.getClickedInventory())
|| CrateReloadedHook.isCrate(e.getInventory())) {
//if(plugin.debug) plugin.getLogger().info("Aborting hotkey because this is a CrateReloaded crate");
return;
}
// Don't sort inventories belonging to BossShopPro
if (e.getInventory() != null && e.getInventory().getHolder() != null && e.getInventory().getHolder().getClass().getName().equalsIgnoreCase("org.black_ixx.bossshop.core.BSShopHolder")) {
return;

View File

@ -0,0 +1,16 @@
package de.jeff_media.ChestSort.hooks;
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.NotNull;
public class CrateReloadedHook {
// 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) {
if(inv==null) return false;
if(inv.getHolder()==null) return false;
return inv.getHolder().getClass().getName().startsWith("cratereloaded");
}
}

View File

@ -0,0 +1,13 @@
package de.jeff_media.ChestSort.hooks;
import org.bukkit.inventory.Inventory;
public class HeadDatabaseHook {
public static boolean isHeadDB(Inventory inv) {
if(inv==null) return false;
if(inv.getHolder() == null) return false;
return inv.getHolder().getClass().getName().equals("me.arcaniax.hdb.object.HeadDatabaseHolder");
}
}

View File

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