2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2020-09-11 01:47:58 +02:00
|
|
|
index 4e46685e9d0564ed9330fbec35848f4cd1fb516c..ab96dd1ac20998b6458ecf6f3fb6f5a2d5189eba 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
|
2020-06-25 15:11:48 +02:00
|
|
|
@@ -539,6 +539,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-12 02:40:42 +02:00
|
|
|
EntityItem entityitem = (EntityItem) iterator.next();
|
|
|
|
|
2020-06-25 15:11:48 +02:00
|
|
|
if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.p() && this.i(entityitem.getItemStack())) {
|
2018-07-18 02:08:13 +02:00
|
|
|
+ // Paper Start
|
|
|
|
+ if (!entityitem.canMobPickup) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ // Paper End
|
2020-06-25 15:11:48 +02:00
|
|
|
this.b(entityitem);
|
2017-06-12 02:40:42 +02:00
|
|
|
}
|
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
|
2020-09-11 01:47:58 +02:00
|
|
|
index 13416bf95869987919e1fcd6b331c3fe2c2b5cee..2ca3886f532050ba7d360efd20a617ef8836c9df 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
|
2019-12-12 00:43:22 +01:00
|
|
|
@@ -20,6 +20,7 @@ public class EntityItem extends Entity {
|
2019-04-27 08:26:04 +02:00
|
|
|
private UUID owner;
|
|
|
|
public final float b;
|
|
|
|
private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit
|
2017-06-12 02:40:42 +02:00
|
|
|
+ public boolean canMobPickup = true; // Paper
|
2019-04-27 08:26:04 +02:00
|
|
|
|
|
|
|
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
|
|
|
|
super(entitytypes, world);
|
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
|
2020-05-06 11:48:49 +02:00
|
|
|
index cc593fbc995dfc11f8006588059d67c42a7429cd..3f552b5905e5ed51c887ad02410297dd5e2e165f 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-05-06 04:58:04 +02:00
|
|
|
@@ -48,6 +48,16 @@ public class CraftItem extends CraftEntity implements Item {
|
2019-01-01 04:15:55 +01:00
|
|
|
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";
|