Don't drop items from hidden slimes. Fixes PC-276
This commit is contained in:
parent
9141ed645a
commit
cd0e59087a
@ -103,6 +103,11 @@ public class Creature extends MiniPlugin
|
|||||||
event.setDroppedExp(0);
|
event.setDroppedExp(0);
|
||||||
List<ItemStack> drops = event.getDrops();
|
List<ItemStack> drops = event.getDrops();
|
||||||
|
|
||||||
|
if (event.getEntity().hasMetadata("Creature.DoNotDrop"))
|
||||||
|
{
|
||||||
|
drops.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getEntityType() == EntityType.PLAYER)
|
if (event.getEntityType() == EntityType.PLAYER)
|
||||||
drops.add(ItemStackFactory.Instance.CreateStack(Material.BONE, 1));
|
drops.add(ItemStackFactory.Instance.CreateStack(Material.BONE, 1));
|
||||||
|
@ -27,6 +27,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.bukkit.util.EulerAngle;
|
import org.bukkit.util.EulerAngle;
|
||||||
import org.spigotmc.event.entity.EntityDismountEvent;
|
import org.spigotmc.event.entity.EntityDismountEvent;
|
||||||
|
|
||||||
@ -559,6 +560,7 @@ public abstract class SiegeWeapon implements Listener
|
|||||||
{
|
{
|
||||||
entity.setCustomName(Integer.toString(_uniqueId));
|
entity.setCustomName(Integer.toString(_uniqueId));
|
||||||
entity.setCustomNameVisible(false);
|
entity.setCustomNameVisible(false);
|
||||||
|
entity.setMetadata("Creature.DoNotDrop", new FixedMetadataValue(_clans.getPlugin(), true));
|
||||||
|
|
||||||
_comprisedOf.add(entity);
|
_comprisedOf.add(entity);
|
||||||
|
|
||||||
@ -569,6 +571,8 @@ public abstract class SiegeWeapon implements Listener
|
|||||||
{
|
{
|
||||||
Entity entity = _entityMapping.get(uniqueName);
|
Entity entity = _entityMapping.get(uniqueName);
|
||||||
|
|
||||||
|
entity.removeMetadata("Creature.DoNotDrop", _clans.getPlugin());
|
||||||
|
|
||||||
_entityMapping.remove(uniqueName);
|
_entityMapping.remove(uniqueName);
|
||||||
_comprisedOf.remove(entity);
|
_comprisedOf.remove(entity);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user