summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-06-17 23:36:35 -0400
committerEvilSeph <evilseph@unaligned.org>2011-06-18 00:12:47 -0400
commitb0fcbe7fcac2428222fffc4232ccf4331877e9e4 (patch)
tree731313792c7c88e157d5b4dea29c8bafca777471 /src/main/java/net/minecraft
parent68695fb9d63a52aec8950acb49299e4576dd45ec (diff)
downloadcraftbukkit-b0fcbe7fcac2428222fffc4232ccf4331877e9e4.tar
craftbukkit-b0fcbe7fcac2428222fffc4232ccf4331877e9e4.tar.gz
craftbukkit-b0fcbe7fcac2428222fffc4232ccf4331877e9e4.tar.lz
craftbukkit-b0fcbe7fcac2428222fffc4232ccf4331877e9e4.tar.xz
craftbukkit-b0fcbe7fcac2428222fffc4232ccf4331877e9e4.zip
Fixed several NPEs within World. Thanks Deaygo!
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/World.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index b718f8c5..1d249e3a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1051,6 +1051,11 @@ public class World implements IBlockAccess {
for (i = 0; i < this.e.size(); ++i) {
entity = (Entity) this.e.get(i);
+ // CraftBukkit start - fixed an NPE
+ if (entity == null) {
+ continue;
+ }
+ // CraftBukkit end
entity.o_();
if (entity.dead) {
this.e.remove(i--);
@@ -1971,7 +1976,11 @@ public class World implements IBlockAccess {
Entity entity = null;
for (int i = 0; i < list.size(); ++i) {
entity = (Entity) list.get(i);
-
+ // CraftBukkit start - fixed an NPE
+ if (entity == null) {
+ continue;
+ }
+ // CraftBukkit end
this.entityList.add(entity);
// CraftBukkit end
this.c((Entity) list.get(i));
@@ -2078,6 +2087,11 @@ public class World implements IBlockAccess {
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
+ // CraftBukkit start - fixed an NPE
+ if (entityhuman1 == null) {
+ continue;
+ }
+ // CraftBukkit end
double d5 = entityhuman1.d(d0, d1, d2);
if ((d3 < 0.0D || d5 < d3 * d3) && (d4 == -1.0D || d5 < d4)) {