mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-08 19:51:05 +00:00
Fixed WorldGuard support for lower versions
This commit is contained in:
parent
e9bcd2dd2f
commit
1fbcd76098
@ -13,6 +13,7 @@ import de.epiceric.shopchest.utils.Permissions;
|
||||
import de.epiceric.shopchest.worldguard.ShopFlag;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -103,7 +104,7 @@ public class WorldGuardListener implements Listener {
|
||||
InventoryOpenEvent orig = (InventoryOpenEvent) event.getOriginalEvent();
|
||||
|
||||
if (orig.getInventory().getType() == InventoryType.CHEST) {
|
||||
if (isAllowed(event, orig.getInventory().getLocation(), Action.RIGHT_CLICK_BLOCK)) {
|
||||
if (isAllowed(event, ((Chest)orig.getInventory().getHolder()).getLocation(), Action.RIGHT_CLICK_BLOCK)) {
|
||||
event.setAllowed(true);
|
||||
orig.setCancelled(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user