Possible fix for #57

This commit is contained in:
mfnalex 2020-05-21 10:44:31 +02:00
parent 5d9cd1f23c
commit aa89e64256
3 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>de.jeffclan</groupId>
<artifactId>JeffChestSort</artifactId>
<version>8.2</version>
<version>8.3</version>
<packaging>jar</packaging>
<name>JeffChestSort</name>

View File

@ -1,5 +1,6 @@
package de.jeffclan.JeffChestSort;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -26,6 +27,10 @@ public class JeffChestSortAdditionalHotkeyListener implements Listener {
if(e.getClickedInventory()!=null) {
return;
}
// Possible fix for #57
if(e.getInventory().getHolder()==null) return;
if(!(e.getInventory().getHolder() instanceof Block)) return;
// End Possible fix for #57
if(e.getInventory().getType() != InventoryType.CHEST
&& e.getInventory().getType() != InventoryType.DISPENSER
&& e.getInventory().getType() != InventoryType.DROPPER
@ -34,6 +39,7 @@ public class JeffChestSortAdditionalHotkeyListener implements Listener {
&& (e.getInventory().getHolder() == null || !e.getInventory().getHolder().getClass().toString().endsWith(".CraftBarrel"))) {
return;
}
Player p = (Player) e.getWhoClicked();
if(!p.hasPermission("chestsort.use")) return;

View File

@ -1,6 +1,6 @@
main: de.jeffclan.JeffChestSort.JeffChestSortPlugin
name: ChestSort
version: 8.2
version: 8.3
api-version: 1.13
description: Allows automatic chest sorting
author: mfnalex