2019-07-16 22:09:32 +00:00
|
|
|
From 02db19d0526850a5513db4a9433794486e981ed5 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
|
2019-07-16 22:09:32 +00:00
|
|
|
index 4fa345db6..c20374d77 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
|
2019-06-25 01:47:58 +00:00
|
|
|
@@ -511,6 +511,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
|
2019-07-16 22:09:32 +00:00
|
|
|
index 0569ad9af..c0b81223f 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
|
2019-04-27 06:26:04 +00:00
|
|
|
@@ -19,6 +19,7 @@ public class EntityItem extends Entity {
|
|
|
|
private UUID owner;
|
|
|
|
public final float b;
|
|
|
|
private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit
|
2017-06-12 00:40:42 +00:00
|
|
|
+ public boolean canMobPickup = true; // Paper
|
2019-04-27 06:26:04 +00:00
|
|
|
|
|
|
|
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
|
|
|
|
super(entitytypes, world);
|
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
|
2019-07-16 22:09:32 +00:00
|
|
|
index cc593fbc9..3f552b590 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
|
2019-05-06 02:58:04 +00:00
|
|
|
@@ -48,6 +48,16 @@ public class CraftItem extends CraftEntity implements Item {
|
2019-01-01 03:15:55 +00:00
|
|
|
item.age = value;
|
2017-06-12 00:40:42 +00: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-06-25 01:47:58 +00:00
|
|
|
2.22.0
|
2017-06-12 00:40:42 +00:00
|
|
|
|