diff options
author | Yariv Livay <yarivlivay@gmail.com> | 2013-03-17 22:46:48 +0200 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-18 12:47:01 -0500 |
commit | a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4 (patch) | |
tree | cc24b480e39c5346abb8d6c6632b318bb6cba23c /src/main/java/net/minecraft/server/EntityLightning.java | |
parent | 2e6cfdb3cc9147d49c050dbd21a6ae37c3a916dd (diff) | |
download | craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar.gz craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar.lz craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.tar.xz craftbukkit-a7a5f273e3765a819f7d2ac71b4be4dbd28f9db4.zip |
Implement new cause versions of BlockIgniteEvent. Addresses BUKKIT-3609, BUKKIT-3656, BUKKIT-3657
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityLightning.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityLightning.java | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java index 638615d4..83c45101 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -2,7 +2,7 @@ package net.minecraft.server; import java.util.List; -import org.bukkit.event.block.BlockIgniteEvent; // CraftBukkit +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit public class EntityLightning extends EntityWeather { @@ -11,7 +11,6 @@ public class EntityLightning extends EntityWeather { private int c; // CraftBukkit start - private org.bukkit.craftbukkit.CraftWorld cworld; public boolean isEffect = false; public EntityLightning(World world, double d0, double d1, double d2) { @@ -25,7 +24,6 @@ public class EntityLightning extends EntityWeather { // CraftBukkit start this.isEffect = isEffect; - this.cworld = world.getWorld(); // CraftBukkit end this.setPositionRotation(d0, d1, d2, 0.0F, 0.0F); @@ -41,10 +39,7 @@ public class EntityLightning extends EntityWeather { if (world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(world, i, j, k)) { // CraftBukkit start - BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null); - world.getServer().getPluginManager().callEvent(event); - - if (!event.isCancelled()) { + if (!CraftEventFactory.callBlockIgniteEvent(world, i, j, k, this).isCancelled()) { world.setTypeIdUpdate(i, j, k, Block.FIRE.id); } // CraftBukkit end @@ -57,11 +52,8 @@ public class EntityLightning extends EntityWeather { if (world.getTypeId(j, k, l) == 0 && Block.FIRE.canPlace(world, j, k, l)) { // CraftBukkit start - BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(j, k, l), BlockIgniteEvent.IgniteCause.LIGHTNING, null); - world.getServer().getPluginManager().callEvent(event); - - if (!event.isCancelled()) { - world.setTypeIdUpdate(j, k, l, Block.FIRE.id); + if (!CraftEventFactory.callBlockIgniteEvent(world, j, k, l, this).isCancelled()) { + world.setTypeIdUpdate(i, j, k, Block.FIRE.id); } // CraftBukkit end } @@ -92,11 +84,8 @@ public class EntityLightning extends EntityWeather { if (this.world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(this.world, i, j, k)) { // CraftBukkit start - BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null); - this.world.getServer().getPluginManager().callEvent(event); - - if (!event.isCancelled()) { - this.world.setTypeIdUpdate(i, j, k, Block.FIRE.id); + if (!CraftEventFactory.callBlockIgniteEvent(world, i, j, k, this).isCancelled()) { + world.setTypeIdUpdate(i, j, k, Block.FIRE.id); } // CraftBukkit end } |