summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityItem.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityItem.patch')
-rw-r--r--nms-patches/EntityItem.patch33
1 files changed, 16 insertions, 17 deletions
diff --git a/nms-patches/EntityItem.patch b/nms-patches/EntityItem.patch
index dc984456..5699d56e 100644
--- a/nms-patches/EntityItem.patch
+++ b/nms-patches/EntityItem.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityItem.java
+++ b/net/minecraft/server/EntityItem.java
-@@ -3,6 +3,7 @@
+@@ -4,6 +4,7 @@
import java.util.Iterator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -8,15 +8,15 @@
public class EntityItem extends Entity {
-@@ -13,6 +14,7 @@
- private String f;
+@@ -15,6 +16,7 @@
private String g;
+ private String h;
public float a;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit
public EntityItem(World world, double d0, double d1, double d2) {
super(world);
-@@ -28,6 +30,11 @@
+@@ -30,6 +32,11 @@
public EntityItem(World world, double d0, double d1, double d2, ItemStack itemstack) {
this(world, d0, d1, d2);
@@ -28,10 +28,10 @@
this.setItemStack(itemstack);
}
-@@ -52,9 +59,12 @@
+@@ -54,9 +61,12 @@
this.die();
} else {
- super.t_();
+ super.m();
- if (this.pickupDelay > 0 && this.pickupDelay != 32767) {
- --this.pickupDelay;
- }
@@ -44,7 +44,7 @@
this.lastX = this.locX;
this.lastY = this.locY;
-@@ -90,12 +100,21 @@
+@@ -92,12 +102,20 @@
this.motY *= -0.5D;
}
@@ -53,9 +53,8 @@
++this.age;
}
+ // Craftbukkit end */
-+
- this.W();
+ this.aj();
if (!this.world.isClientSide && this.age >= 6000) {
+ // CraftBukkit start - fire ItemDespawnEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
@@ -66,7 +65,7 @@
this.die();
}
-@@ -137,6 +156,7 @@
+@@ -139,6 +157,7 @@
} else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) {
return false;
} else {
@@ -74,7 +73,7 @@
itemstack1.count += itemstack.count;
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, this.pickupDelay);
entityitem.age = Math.min(entityitem.age, this.age);
-@@ -183,6 +203,11 @@
+@@ -185,6 +204,11 @@
} else if (this.getItemStack() != null && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) {
return false;
} else {
@@ -83,10 +82,10 @@
+ return false;
+ }
+ // CraftBukkit end
- this.ac();
- this.e = (int) ((float) this.e - f);
- if (this.e <= 0) {
-@@ -228,7 +253,18 @@
+ this.ao();
+ this.f = (int) ((float) this.f - f);
+ if (this.f <= 0) {
+@@ -230,7 +254,18 @@
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item");
@@ -106,7 +105,7 @@
if (this.getItemStack() == null) {
this.die();
}
-@@ -240,6 +276,26 @@
+@@ -242,6 +277,26 @@
ItemStack itemstack = this.getItemStack();
int i = itemstack.count;
@@ -130,6 +129,6 @@
+ }
+ // CraftBukkit end
+
- if (this.pickupDelay == 0 && (this.g == null || 6000 - this.age <= 200 || this.g.equals(entityhuman.getName())) && entityhuman.inventory.pickup(itemstack)) {
+ if (this.pickupDelay == 0 && (this.h == null || 6000 - this.age <= 200 || this.h.equals(entityhuman.getName())) && entityhuman.inventory.pickup(itemstack)) {
if (itemstack.getItem() == Item.getItemOf(Blocks.LOG)) {
entityhuman.b((Statistic) AchievementList.g);