diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-13 17:33:27 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-15 13:28:59 -0500 |
commit | 83d29e461c85733f0113b6eb19db6e3b42da2949 (patch) | |
tree | b3063a1c28f478ab368d5ba3413a842def68c28f /src/main/java/net/minecraft/server/Explosion.java | |
parent | ba6e4c38cfa98ad291974195cc46d70a4f138ac1 (diff) | |
download | craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.gz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.lz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.xz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.zip |
Update CraftBukkit to Minecraft 1.5
Diffstat (limited to 'src/main/java/net/minecraft/server/Explosion.java')
-rw-r--r-- | src/main/java/net/minecraft/server/Explosion.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java index ba2f88f0..aa3ae585 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -85,12 +85,12 @@ public class Explosion { if (k1 > 0) { Block block = Block.byId[k1]; - float f3 = this.source != null ? this.source.a(this, block, l, i1, j1) : block.a(this.source); + float f3 = this.source != null ? this.source.a(this, this.world, l, i1, j1, block) : block.a(this.source); f1 -= (f3 + 0.3F) * f2; } - if (f1 > 0.0F && i1 < 256 && i1 >= 0) { // CraftBukkit - don't wrap explosions + if (f1 > 0.0F && (this.source == null || this.source.a(this, this.world, l, i1, j1, k1, f1)) && i1 < 256 && i1 >= 0) { // CraftBukkit - don't wrap explosions hashset.add(new ChunkPosition(l, i1, j1)); } @@ -143,7 +143,7 @@ public class Explosion { if (!event.isCancelled()) { damagee.setLastDamageCause(event); - entity.damageEntity(DamageSource.EXPLOSION, event.getDamage()); + entity.damageEntity(DamageSource.explosion(this), event.getDamage()); double d11 = EnchantmentProtection.a(entity, d10); entity.motX += d0 * d11; @@ -168,7 +168,7 @@ public class Explosion { if (!event.isCancelled()) { entity.getBukkitEntity().setLastDamageCause(event); - entity.damageEntity(DamageSource.EXPLOSION, event.getDamage()); + entity.damageEntity(DamageSource.explosion(this), event.getDamage()); entity.motX += d0 * d10; entity.motY += d1 * d10; @@ -272,11 +272,8 @@ public class Explosion { block.dropNaturally(this.world, i, j, k, this.world.getData(i, j, k), event.getYield(), 0); } - if (this.world.setRawTypeIdAndData(i, j, k, 0, 0, this.world.isStatic)) { - this.world.applyPhysics(i, j, k, 0); - } - - block.wasExploded(this.world, i, j, k); + this.world.setTypeIdAndData(i, j, k, 0, 0, 3); + block.wasExploded(this.world, i, j, k, this); } } } @@ -292,8 +289,8 @@ public class Explosion { l = this.world.getTypeId(i, j, k); int i1 = this.world.getTypeId(i, j - 1, k); - if (l == 0 && Block.q[i1] && this.j.nextInt(3) == 0) { - this.world.setTypeId(i, j, k, Block.FIRE.id); + if (l == 0 && Block.s[i1] && this.j.nextInt(3) == 0) { + this.world.setTypeIdUpdate(i, j, k, Block.FIRE.id); } } } @@ -302,4 +299,8 @@ public class Explosion { public Map b() { return this.l; } + + public EntityLiving c() { + return this.source == null ? null : (this.source instanceof EntityTNTPrimed ? ((EntityTNTPrimed) this.source).getSource() : (this.source instanceof EntityLiving ? (EntityLiving) this.source : null)); + } } |