Stop player's dropping leather armour
This commit is contained in:
parent
0714399dcf
commit
6362033b9e
@ -16,6 +16,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -28,6 +29,7 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilItem;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -405,6 +407,22 @@ public class CakeTeamModule extends CakeModule
|
||||
.build();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void playerDropItem(PlayerDropItemEvent event)
|
||||
{
|
||||
if (!_game.IsLive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack itemStack = event.getItemDrop().getItemStack();
|
||||
|
||||
if (UtilItem.isLeatherProduct(itemStack))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void playerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user