From e165a8a956f42b823b6cf6597b5ed62d6fb9e404 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 5 May 2017 03:57:17 -0500 Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index 5d830b245..f1621a9e9 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -510,6 +510,11 @@ public abstract class EntityInsentient extends EntityLiving { EntityItem entityitem = (EntityItem) iterator.next(); if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.q()) { + // Paper Start + if (!entityitem.canMobPickup) { + continue; + } + // Paper End this.a(entityitem); } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index fe70a3a8b..36b5fb537 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -19,6 +19,7 @@ public class EntityItem extends Entity { private UUID owner; public final float b; private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit + public boolean canMobPickup = true; // Paper public EntityItem(EntityTypes entitytypes, World world) { super(entitytypes, world); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java index 0dbca8f00..65b23f511 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -44,6 +44,16 @@ public class CraftItem extends CraftEntity implements Item { item.age = value; } + // Paper Start + public boolean canMobPickup() { + return item.canMobPickup; + } + + public void setCanMobPickup(boolean canMobPickup) { + item.canMobPickup = canMobPickup; + } + // Paper End + @Override public String toString() { return "CraftItem"; -- 2.21.0