diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-11-06 06:05:28 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-11-13 16:09:52 -0600 |
commit | 7f7192f8fd8357e664e7e2d6e7c5f65fd0fcd2f7 (patch) | |
tree | 843902ff94d82e86f40d7e0af1ac838fee859e75 /src/main/java/net/minecraft/server/EntityFireball.java | |
parent | a0c3b4f9d1b403fa64230f22b5dd3222181ba646 (diff) | |
download | craftbukkit-7f7192f8fd8357e664e7e2d6e7c5f65fd0fcd2f7.tar craftbukkit-7f7192f8fd8357e664e7e2d6e7c5f65fd0fcd2f7.tar.gz craftbukkit-7f7192f8fd8357e664e7e2d6e7c5f65fd0fcd2f7.tar.lz craftbukkit-7f7192f8fd8357e664e7e2d6e7c5f65fd0fcd2f7.tar.xz craftbukkit-7f7192f8fd8357e664e7e2d6e7c5f65fd0fcd2f7.zip |
Update CraftBukkit to Minecraft 1.4.4.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityFireball.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityFireball.java | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index b3209a39..c016f925 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -1,6 +1,5 @@ package net.minecraft.server; -import java.util.Iterator; import java.util.List; import org.bukkit.event.entity.ProjectileHitEvent; // CraftBukkit @@ -105,10 +104,9 @@ public abstract class EntityFireball extends Entity { Entity entity = null; List list = this.world.getEntities(this, this.boundingBox.a(this.motX, this.motY, this.motZ).grow(1.0D, 1.0D, 1.0D)); double d0 = 0.0D; - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - Entity entity1 = (Entity) iterator.next(); + for (int j = 0; j < list.size(); ++j) { + Entity entity1 = (Entity) list.get(j); if (entity1.L() && (!entity1.i(this.shooter) || this.as >= 25)) { float f = 0.3F; @@ -169,7 +167,7 @@ public abstract class EntityFireball extends Entity { float f2 = this.c(); if (this.H()) { - for (int j = 0; j < 4; ++j) { + for (int k = 0; k < 4; ++k) { float f3 = 0.25F; this.world.addParticle("bubble", this.locX - this.motX * (double) f3, this.locY - this.motY * (double) f3, this.locZ - this.motZ * (double) f3, this.motX, this.motY, this.motZ); @@ -230,26 +228,30 @@ public abstract class EntityFireball extends Entity { } public boolean damageEntity(DamageSource damagesource, int i) { - this.K(); - if (damagesource.getEntity() != null) { - Vec3D vec3d = damagesource.getEntity().Z(); - - if (vec3d != null) { - this.motX = vec3d.c; - this.motY = vec3d.d; - this.motZ = vec3d.e; - this.dirX = this.motX * 0.1D; - this.dirY = this.motY * 0.1D; - this.dirZ = this.motZ * 0.1D; - } + if (this.isInvulnerable()) { + return false; + } else { + this.K(); + if (damagesource.getEntity() != null) { + Vec3D vec3d = damagesource.getEntity().Z(); + + if (vec3d != null) { + this.motX = vec3d.c; + this.motY = vec3d.d; + this.motZ = vec3d.e; + this.dirX = this.motX * 0.1D; + this.dirY = this.motY * 0.1D; + this.dirZ = this.motZ * 0.1D; + } - if (damagesource.getEntity() instanceof EntityLiving) { - this.shooter = (EntityLiving) damagesource.getEntity(); - } + if (damagesource.getEntity() instanceof EntityLiving) { + this.shooter = (EntityLiving) damagesource.getEntity(); + } - return true; - } else { - return false; + return true; + } else { + return false; + } } } |