summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2014-02-11 14:55:21 -0500
committerEvilSeph <evilseph@gmail.com>2014-02-11 14:55:59 -0500
commitd9e04a5b2412b0b5e09cd3a0c0b86c3c694ff4e5 (patch)
tree5dd90bde4daa3b829ae0df9312f42e661f06ffe3
parent00b3721f078a03c5a333f03c62b641e5f8a45d48 (diff)
downloadcraftbukkit-d9e04a5b2412b0b5e09cd3a0c0b86c3c694ff4e5.tar
craftbukkit-d9e04a5b2412b0b5e09cd3a0c0b86c3c694ff4e5.tar.gz
craftbukkit-d9e04a5b2412b0b5e09cd3a0c0b86c3c694ff4e5.tar.lz
craftbukkit-d9e04a5b2412b0b5e09cd3a0c0b86c3c694ff4e5.tar.xz
craftbukkit-d9e04a5b2412b0b5e09cd3a0c0b86c3c694ff4e5.zip
Check if entity is in list before decrementing. Fixes BUKKIT-5404
-rw-r--r--src/main/java/net/minecraft/server/World.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 419149ed..4a42bb45 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -976,10 +976,12 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - Decrement loop variable field if we've already ticked this entity
int index = this.entityList.indexOf(entity);
- if (index <= this.tickPosition) {
- this.tickPosition--;
+ if (index != -1) {
+ if (index <= this.tickPosition) {
+ this.tickPosition--;
+ }
+ this.entityList.remove(index);
}
- this.entityList.remove(index);
// CraftBukkit end
this.b(entity);