Fixes an issue where players would be able to fill buckets of water in
Bridges and get to the centre before the Bridges has fallen.
This commit is contained in:
Sam 2016-06-04 17:42:30 +01:00
parent 78c5b8a0a3
commit 05e85523b1

View File

@ -21,6 +21,7 @@ import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.ore.OreHider;
import nautilus.game.arcade.ore.OreObsfucation;
import nautilus.game.arcade.stats.*;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@ -43,6 +44,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
@ -1927,6 +1929,15 @@ public class Bridge extends TeamGame implements OreObsfucation
event.setCancelled(true);
}
@EventHandler
public void disableWaterPickup(PlayerBucketFillEvent event)
{
if(_bridgesDown)
return;
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot pickup liquids before the bridges have fallen."));
event.setCancelled(true);
}
public void setBridgeTime(int time)
{
_bridgeTime = time;