summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityLightning.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityLightning.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityLightning.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java
index 6f0dab61..36923bb6 100644
--- a/src/main/java/net/minecraft/server/EntityLightning.java
+++ b/src/main/java/net/minecraft/server/EntityLightning.java
@@ -32,15 +32,15 @@ public class EntityLightning extends EntityWeather {
this.c = this.random.nextInt(3) + 1;
// CraftBukkit
- if (!isEffect && !world.isStatic && world.getGameRules().getBoolean("doFireTick") && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
+ if (!isEffect && !world.isStatic && world.getGameRules().getBoolean("doFireTick") && (world.difficulty == EnumDifficulty.NORMAL || world.difficulty == EnumDifficulty.HARD) && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
int i = MathHelper.floor(d0);
int j = MathHelper.floor(d1);
int k = MathHelper.floor(d2);
- if (world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(world, i, j, k)) {
+ if (world.getType(i, j, k).getMaterial() == Material.AIR && Blocks.FIRE.canPlace(world, i, j, k)) {
// CraftBukkit start
if (!CraftEventFactory.callBlockIgniteEvent(world, i, j, k, this).isCancelled()) {
- world.setTypeIdUpdate(i, j, k, Block.FIRE.id);
+ world.setTypeUpdate(i, j, k, Blocks.FIRE);
}
// CraftBukkit end
}
@@ -50,10 +50,10 @@ public class EntityLightning extends EntityWeather {
k = MathHelper.floor(d1) + this.random.nextInt(3) - 1;
int l = MathHelper.floor(d2) + this.random.nextInt(3) - 1;
- if (world.getTypeId(j, k, l) == 0 && Block.FIRE.canPlace(world, j, k, l)) {
+ if (world.getType(j, k, l).getMaterial() == Material.AIR && Blocks.FIRE.canPlace(world, j, k, l)) {
// CraftBukkit start
if (!CraftEventFactory.callBlockIgniteEvent(world, j, k, l, this).isCancelled()) {
- world.setTypeIdUpdate(j, k, l, Block.FIRE.id);
+ world.setTypeUpdate(j, k, l, Blocks.FIRE);
}
// CraftBukkit end
}
@@ -61,8 +61,8 @@ public class EntityLightning extends EntityWeather {
}
}
- public void l_() {
- super.l_();
+ public void h() {
+ super.h();
if (this.lifeTicks == 2) {
this.world.makeSound(this.locX, this.locY, this.locZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
this.world.makeSound(this.locX, this.locY, this.locZ, "random.explode", 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
@@ -82,10 +82,10 @@ public class EntityLightning extends EntityWeather {
int j = MathHelper.floor(this.locY);
int k = MathHelper.floor(this.locZ);
- if (this.world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(this.world, i, j, k)) {
+ if (this.world.getType(i, j, k).getMaterial() == Material.AIR && Blocks.FIRE.canPlace(this.world, i, j, k)) {
// CraftBukkit start
if (!CraftEventFactory.callBlockIgniteEvent(world, i, j, k, this).isCancelled()) {
- world.setTypeIdUpdate(i, j, k, Block.FIRE.id);
+ this.world.setTypeUpdate(i, j, k, Blocks.FIRE);
}
// CraftBukkit end
}
@@ -109,7 +109,7 @@ public class EntityLightning extends EntityWeather {
}
}
- protected void a() {}
+ protected void c() {}
protected void a(NBTTagCompound nbttagcompound) {}