Fix entity activation range for fireworks and items

This commit is contained in:
Thinkofdeath 2015-02-13 21:51:02 +00:00 committed by Zach Brown
parent 2ab5f7ada3
commit e1a6979f1a

View File

@ -1,4 +1,4 @@
From 1cd015cd6dce28ba5e49b8b63ab5e45daff273e3 Mon Sep 17 00:00:00 2001 From 8fc6b4b9cffdd2047dbb99bdf156829089d182be Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 3 Feb 2013 05:10:21 -0500 Date: Sun, 3 Feb 2013 05:10:21 -0500
Subject: [PATCH] Entity Activation Range Subject: [PATCH] Entity Activation Range
@ -125,7 +125,7 @@ index 3ba285a..6e5450a 100644
super(world); super(world);
this.j = 10.0D; this.j = 10.0D;
diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java
index 8357157..16400c3 100644 index 8357157..f5b794b 100644
--- a/src/main/java/net/minecraft/server/EntityFireworks.java --- a/src/main/java/net/minecraft/server/EntityFireworks.java
+++ b/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java
@@ -5,6 +5,15 @@ public class EntityFireworks extends Entity { @@ -5,6 +5,15 @@ public class EntityFireworks extends Entity {
@ -136,7 +136,7 @@ index 8357157..16400c3 100644
+ @Override + @Override
+ public void inactiveTick() + public void inactiveTick()
+ { + {
+ this.ticksFlown += 19; + this.ticksFlown += 1;
+ super.inactiveTick(); + super.inactiveTick();
+ } + }
+ // Spigot End + // Spigot End
@ -144,6 +144,39 @@ index 8357157..16400c3 100644
public EntityFireworks(World world) { public EntityFireworks(World world) {
super(world); super(world);
this.a(0.25F, 0.25F); this.a(0.25F, 0.25F);
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index 3f2c5f5..652b803 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -121,6 +121,28 @@ public class EntityItem extends Entity {
}
}
+ // Spigot start - copied from above
+ @Override
+ public void inactiveTick() {
+ // CraftBukkit start - Use wall time for pickup and despawn timers
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
+ this.pickupDelay -= elapsedTicks;
+ this.age += elapsedTicks;
+ this.lastTick = MinecraftServer.currentTick;
+ // CraftBukkit end
+
+ if (!this.world.isStatic && this.age >= world.spigotConfig.itemDespawnRate) { // Spigot
+ // CraftBukkit start - fire ItemDespawnEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
+ this.age = 0;
+ return;
+ }
+ // CraftBukkit end
+ this.die();
+ }
+ }
+ // Spigot end
+
private void w() {
// Spigot start
double radius = world.spigotConfig.itemMerge;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index cd56586..89374d7 100644 index cd56586..89374d7 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java