mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2025-01-07 17:08:12 +01:00
12.1.4
This commit is contained in:
parent
35f9cc880e
commit
33283a3360
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## 12.1.4
|
||||
- Disabled additional hotkeys (fill & empty chest) for ShulkerPacks to avoid duplication and possible item loss caused by ShulkerPacks not checking for changed inventory in InventoryCloseEvent
|
||||
|
||||
## 12.1.2
|
||||
- Fixed newlines ("\n") in config.yml breaking the config updater
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
||||
<name>ChestSort</name>
|
||||
<url>https://www.chestsort.de</url>
|
||||
<description>Allows automatic chest sorting!</description>
|
||||
<version>12.1.3</version>
|
||||
<version>12.1.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -1,21 +1,27 @@
|
||||
package de.jeff_media.chestsort.hooks;
|
||||
|
||||
import de.jeff_media.chestsort.ChestSortPlugin;
|
||||
import de.jeff_media.chestsort.api.ChestSortEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.w3c.dom.ls.LSOutput;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ShulkerPacksHook {
|
||||
|
||||
private static Method checkIfOpenMethod;
|
||||
private static Boolean installed = null;
|
||||
|
||||
public static boolean isOpenShulkerView(InventoryView view) {
|
||||
if(view == null) return false;
|
||||
if(view.getTopInventory() == null) return false;
|
||||
if(view.getTopInventory().getHolder() == null) return false;
|
||||
return (view.getTopInventory().getHolder().getClass().getName().toLowerCase(Locale.ROOT).contains("shulkerpacks"));
|
||||
}
|
||||
|
||||
public static boolean isOpenShulkerPack(ItemStack item) {
|
||||
if(installed == null) {
|
||||
if (Bukkit.getPluginManager().getPlugin("ShulkerPacks") == null) {
|
||||
|
@ -698,6 +698,9 @@ public class Listener implements org.bukkit.event.Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
// ShulkerPacks
|
||||
if(ShulkerPacksHook.isOpenShulkerView(e.getView())) return;
|
||||
|
||||
if (!p.hasPermission("chestsort.use")) return;
|
||||
|
||||
plugin.registerPlayerIfNeeded(p);
|
||||
|
Loading…
Reference in New Issue
Block a user