diff options
author | Andrew Ardill <andrew.ardill@gmail.com> | 2011-01-23 23:23:13 +1100 |
---|---|---|
committer | Andrew Ardill <andrew.ardill@gmail.com> | 2011-01-23 23:23:13 +1100 |
commit | a809e4e6e32e194c288723ceb2e1534bbddea174 (patch) | |
tree | ceebf1bdff232e048d8d9b669e267a6598d2af13 /src/main/java/net/minecraft/server/BlockFurnace.java | |
parent | 9cd81ddd6d78d625bab88ee0ab0bc6080447fc96 (diff) | |
download | craftbukkit-a809e4e6e32e194c288723ceb2e1534bbddea174.tar craftbukkit-a809e4e6e32e194c288723ceb2e1534bbddea174.tar.gz craftbukkit-a809e4e6e32e194c288723ceb2e1534bbddea174.tar.lz craftbukkit-a809e4e6e32e194c288723ceb2e1534bbddea174.tar.xz craftbukkit-a809e4e6e32e194c288723ceb2e1534bbddea174.zip |
removed all instances of new CraftEntity* where appropriate.
Entity.getBukkitEntity() is now used instead.
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockFurnace.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockFurnace.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java index d9302f7d..34a13f81 100644 --- a/src/main/java/net/minecraft/server/BlockFurnace.java +++ b/src/main/java/net/minecraft/server/BlockFurnace.java @@ -3,8 +3,11 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.entity.CraftPlayer; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockInteractEvent; // CraftBukkit end @@ -69,13 +72,18 @@ public class BlockFurnace extends BlockContainer { return true; } else { // CraftBukkit start - Interact Furnace - CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k); - CraftPlayer player = new CraftPlayer(((WorldServer) world).getServer(), (EntityPlayerMP) entityplayer); - BlockInteractEvent bie = new BlockInteractEvent(Type.BLOCK_INTERACT, block, player); - - ((WorldServer) world).getServer().getPluginManager().callEvent(bie); - - if (bie.isCancelled()) return true; + CraftWorld craftWorld = ((WorldServer) world).getWorld(); + CraftServer server = ((WorldServer) world).getServer(); + Type eventType = Type.BLOCK_INTERACT; + CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k); + LivingEntity who = (entityplayer == null)?null:(LivingEntity)entityplayer.getBukkitEntity(); + + BlockInteractEvent bie = new BlockInteractEvent(eventType, block, who); + server.getPluginManager().callEvent(bie); + + if (bie.isCancelled()) { + return true; + } // CraftBukkit end TileEntityFurnace tileentityfurnace = (TileEntityFurnace) world.m(i, j, k); |