2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2020-11-18 03:45:18 +00:00
|
|
|
index 61b5a3d14413455e22857f72e6b5d825f5b589d8..1b0c4234cf579b35f404c129c2c6d3266b670b09 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
|
2020-06-25 13:11:48 +00:00
|
|
|
@@ -539,6 +539,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 00:40:42 +00:00
|
|
|
EntityItem entityitem = (EntityItem) iterator.next();
|
|
|
|
|
2020-06-25 13:11:48 +00:00
|
|
|
if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.p() && this.i(entityitem.getItemStack())) {
|
2018-07-18 00:08:13 +00:00
|
|
|
+ // Paper Start
|
|
|
|
+ if (!entityitem.canMobPickup) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // Paper End
|
2020-06-25 13:11:48 +00:00
|
|
|
this.b(entityitem);
|
2017-06-12 00:40:42 +00:00
|
|
|
}
|
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
|
2020-11-18 03:45:18 +00:00
|
|
|
index b1e953fc5c61abe0aeb667a12fd4491d11f422de..507ad727ce62a30b1120104b16737e21b777d7ae 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-12-11 23:43:22 +00:00
|
|
|
@@ -20,6 +20,7 @@ public class EntityItem extends Entity {
|
2019-04-27 06:26:04 +00:00
|
|
|
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
|
2020-10-14 14:00:43 +00:00
|
|
|
index d7da0cf2e7b9e669635b469f87e8da4d7fdecb35..d6a64e4ecf9225f9a93523c50b2f1375296b406e 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
|
2020-10-14 14:00:43 +00:00
|
|
|
@@ -49,6 +49,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
|
2020-10-14 14:00:43 +00:00
|
|
|
public void setOwner(UUID uuid) {
|
|
|
|
item.setOwner(uuid);
|