2019-01-01 04:15:55 +01:00
|
|
|
From f5e92a52c3e06d819b2bbf304c9eee9ad6c6397c 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
|
2019-01-01 04:15:55 +01:00
|
|
|
index 7401bafa9..d670b6ba4 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
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -530,6 +530,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 02:40:42 +02:00
|
|
|
EntityItem entityitem = (EntityItem) iterator.next();
|
|
|
|
|
2018-07-18 02:08:13 +02:00
|
|
|
if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.q()) {
|
|
|
|
+ // Paper Start
|
|
|
|
+ if (!entityitem.canMobPickup) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // Paper End
|
2017-06-12 02:40:42 +02:00
|
|
|
this.a(entityitem);
|
|
|
|
}
|
2018-07-18 02:08:13 +02:00
|
|
|
}
|
2017-06-12 02:40:42 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
2019-01-01 04:15:55 +01:00
|
|
|
index cad1c1a17..e343b39b5 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
|
2018-07-18 02:08:13 +02:00
|
|
|
@@ -13,6 +13,7 @@ public class EntityItem extends Entity {
|
|
|
|
private static final DataWatcherObject<ItemStack> b = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g);
|
2019-01-01 04:15:55 +01:00
|
|
|
public int age; // PAIL
|
2017-06-12 02:40:42 +02:00
|
|
|
public int pickupDelay;
|
|
|
|
+ public boolean canMobPickup = true; // Paper
|
2018-07-18 02:08:13 +02:00
|
|
|
private int e;
|
|
|
|
private UUID f;
|
|
|
|
private UUID g;
|
2017-06-12 02:40:42 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
2019-01-01 04:15:55 +01:00
|
|
|
index 55d6bacf7..6036592f7 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
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -45,6 +45,16 @@ public class CraftItem extends CraftEntity implements Item {
|
|
|
|
item.age = value;
|
2017-06-12 02:40:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper Start
|
|
|
|
+ public boolean canMobPickup() {
|
|
|
|
+ return item.canMobPickup;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setCanMobPickup(boolean canMobPickup) {
|
|
|
|
+ item.canMobPickup = canMobPickup;
|
|
|
|
+ }
|
|
|
|
+ // Paper End
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "CraftItem";
|
|
|
|
--
|
2019-01-01 04:15:55 +01:00
|
|
|
2.20.1
|
2017-06-12 02:40:42 +02:00
|
|
|
|