2018-07-04 09:55:24 +02:00
|
|
|
From e4e98632b0628b4452d2b266506da9d200a62d4a Mon Sep 17 00:00:00 2001
|
2017-06-12 02:40:42 +02:00
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
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
|
2018-07-04 09:55:24 +02:00
|
|
|
index 5ea9f3097..89e878365 100644
|
2017-06-12 02:40:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2017-07-28 15:45:16 +02:00
|
|
|
@@ -514,6 +514,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 02:40:42 +02:00
|
|
|
while (iterator.hasNext()) {
|
|
|
|
EntityItem entityitem = (EntityItem) iterator.next();
|
|
|
|
|
|
|
|
+ // Paper Start
|
|
|
|
+ if (!entityitem.canMobPickup) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // Paper End
|
|
|
|
+
|
|
|
|
if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.t()) {
|
|
|
|
this.a(entityitem);
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
2018-07-04 09:55:24 +02:00
|
|
|
index 6593fc633..99dbb1393 100644
|
2017-06-12 02:40:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityItem.java
|
2017-07-28 15:45:16 +02:00
|
|
|
@@ -22,6 +22,7 @@ public class EntityItem extends Entity implements HopperPusher {
|
2017-06-12 02:40:42 +02:00
|
|
|
private static final DataWatcherObject<ItemStack> c = DataWatcher.a(EntityItem.class, DataWatcherRegistry.f);
|
|
|
|
private int age;
|
|
|
|
public int pickupDelay;
|
|
|
|
+ public boolean canMobPickup = true; // Paper
|
|
|
|
private int f;
|
|
|
|
private String g;
|
|
|
|
private String h;
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
2018-07-04 09:55:24 +02:00
|
|
|
index a17a537d6..1df17f09b 100644
|
2017-06-12 02:40:42 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
|
|
|
@@ -37,6 +37,16 @@ public class CraftItem extends CraftEntity implements Item {
|
|
|
|
item.pickupDelay = Math.min(delay, Short.MAX_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";
|
|
|
|
--
|
2018-07-04 09:55:24 +02:00
|
|
|
2.18.0
|
2017-06-12 02:40:42 +02:00
|
|
|
|