2018-11-09 03:43:38 +00:00
|
|
|
From 1ab48f50256eaea71822fe4b181bfbb22bbb7f72 Mon Sep 17 00:00:00 2001
|
2017-06-12 00:40:42 +00: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-11-09 03:43:38 +00:00
|
|
|
index 41a4962e94..200d46a8a0 100644
|
2017-06-12 00:40:42 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2018-11-09 03:43:38 +00:00
|
|
|
@@ -529,6 +529,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 00:40:42 +00:00
|
|
|
EntityItem entityitem = (EntityItem) iterator.next();
|
|
|
|
|
2018-07-18 00:08:13 +00:00
|
|
|
if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.q()) {
|
|
|
|
+ // Paper Start
|
|
|
|
+ if (!entityitem.canMobPickup) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // Paper End
|
2017-06-12 00:40:42 +00:00
|
|
|
this.a(entityitem);
|
|
|
|
}
|
2018-07-18 00:08:13 +00:00
|
|
|
}
|
2017-06-12 00:40:42 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
2018-11-09 03:43:38 +00:00
|
|
|
index 5be2d93146..5446ff3e82 100644
|
2017-06-12 00:40:42 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityItem.java
|
2018-07-18 00:08:13 +00:00
|
|
|
@@ -13,6 +13,7 @@ public class EntityItem extends Entity {
|
|
|
|
private static final DataWatcherObject<ItemStack> b = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g);
|
2017-06-12 00:40:42 +00:00
|
|
|
private int age;
|
|
|
|
public int pickupDelay;
|
|
|
|
+ public boolean canMobPickup = true; // Paper
|
2018-07-18 00:08:13 +00:00
|
|
|
private int e;
|
|
|
|
private UUID f;
|
|
|
|
private UUID g;
|
2017-06-12 00:40:42 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
2018-07-23 08:39:55 +00:00
|
|
|
index a17a537d69..1df17f09bb 100644
|
2017-06-12 00:40:42 +00: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-11-09 03:43:38 +00:00
|
|
|
2.19.1
|
2017-06-12 00:40:42 +00:00
|
|
|
|