mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-26 04:12:22 +00:00
parent
1fa0f08073
commit
4f894ddac7
@ -20,7 +20,6 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
public class WorldGuardListener implements Listener {
|
public class WorldGuardListener implements Listener {
|
||||||
@ -103,7 +102,7 @@ public class WorldGuardListener implements Listener {
|
|||||||
} else if (event.getOriginalEvent() instanceof InventoryOpenEvent) {
|
} else if (event.getOriginalEvent() instanceof InventoryOpenEvent) {
|
||||||
InventoryOpenEvent orig = (InventoryOpenEvent) event.getOriginalEvent();
|
InventoryOpenEvent orig = (InventoryOpenEvent) event.getOriginalEvent();
|
||||||
|
|
||||||
if (orig.getInventory().getType() == InventoryType.CHEST) {
|
if (orig.getInventory().getHolder() instanceof Chest) {
|
||||||
if (isAllowed(event, ((Chest)orig.getInventory().getHolder()).getLocation(), Action.RIGHT_CLICK_BLOCK)) {
|
if (isAllowed(event, ((Chest)orig.getInventory().getHolder()).getLocation(), Action.RIGHT_CLICK_BLOCK)) {
|
||||||
event.setAllowed(true);
|
event.setAllowed(true);
|
||||||
orig.setCancelled(false);
|
orig.setCancelled(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user