Prevent item pickup when respawning
This commit is contained in:
parent
1a9d46a904
commit
6102b59779
@ -126,6 +126,7 @@ public class CakeWars extends TeamGame
|
||||
AnnounceStay = false;
|
||||
BlockPlace = true;
|
||||
BlockBreak = true;
|
||||
DeathTeleport = false;
|
||||
DeathSpectateSecs = RESPAWN_TIME;
|
||||
StrictAntiHack = true;
|
||||
HungerSet = 20;
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.inventory.CraftItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
@ -154,6 +155,20 @@ public class CakePlayerModule extends CakeModule
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void pickupItem(PlayerPickupItemEvent event)
|
||||
{
|
||||
if (!_game.IsLive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilPlayer.isSpectator(event.getPlayer()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void saveInventory(UpdateEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user