Cant open bridge chests until bridges are down.
This commit is contained in:
parent
0325892e2a
commit
7ea601e94b
@ -31,6 +31,7 @@ import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.inventory.PrepareItemCraftEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.CraftingInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
@ -40,6 +41,8 @@ import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
@ -297,6 +300,31 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
|
||||
return ItemStackFactory.Instance.CreateStack(stack.getTypeId(), amount);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void ChestDeny(PlayerInteractEvent event)
|
||||
{
|
||||
if (_bridgesDown)
|
||||
return;
|
||||
|
||||
if (event.getClickedBlock() == null)
|
||||
return;
|
||||
|
||||
if (event.getClickedBlock().getType() != Material.CHEST)
|
||||
return;
|
||||
|
||||
if (!UtilEvent.isAction(event, ActionType.R_BLOCK))
|
||||
return;
|
||||
|
||||
for (Location loc : WorldData.GetCustomLocs("54"))
|
||||
{
|
||||
if (loc.getBlock().equals(event.getClickedBlock()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseOre(ArrayList<Location> teamOre)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user