mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2025-01-07 08:57:44 +01:00
Closes: #57
This commit is contained in:
parent
aa89e64256
commit
151eebff1a
@ -23,13 +23,14 @@ public class JeffChestSortAdditionalHotkeyListener implements Listener {
|
|||||||
if(!(e.getWhoClicked() instanceof Player)) {
|
if(!(e.getWhoClicked() instanceof Player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Player p = (Player) e.getWhoClicked();
|
||||||
// Only continue if clicked outside of the chest
|
// Only continue if clicked outside of the chest
|
||||||
if(e.getClickedInventory()!=null) {
|
if(e.getClickedInventory()!=null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Possible fix for #57
|
// Possible fix for #57
|
||||||
if(e.getInventory().getHolder()==null) return;
|
if(e.getInventory().getHolder()==null) return;
|
||||||
if(!(e.getInventory().getHolder() instanceof Block)) return;
|
if(e.getInventory().getHolder() == p && e.getInventory() != p.getInventory()) return;
|
||||||
// End Possible fix for #57
|
// End Possible fix for #57
|
||||||
if(e.getInventory().getType() != InventoryType.CHEST
|
if(e.getInventory().getType() != InventoryType.CHEST
|
||||||
&& e.getInventory().getType() != InventoryType.DISPENSER
|
&& e.getInventory().getType() != InventoryType.DISPENSER
|
||||||
@ -40,8 +41,6 @@ public class JeffChestSortAdditionalHotkeyListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player p = (Player) e.getWhoClicked();
|
|
||||||
|
|
||||||
if(!p.hasPermission("chestsort.use")) return;
|
if(!p.hasPermission("chestsort.use")) return;
|
||||||
|
|
||||||
plugin.registerPlayerIfNeeded(p);
|
plugin.registerPlayerIfNeeded(p);
|
||||||
|
Loading…
Reference in New Issue
Block a user