From 02c469a93dc7af30c2ed926581b58466cd4ab9c2 Mon Sep 17 00:00:00 2001 From: durron597 Date: Fri, 31 Dec 2010 22:59:30 -0500 Subject: [PATCH] Changed Block to CraftBlock. Changed callHook to getServer --- src/net/minecraft/server/BlockFlowing.java | 7 ++++--- src/net/minecraft/server/WorldServer.java | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/net/minecraft/server/BlockFlowing.java b/src/net/minecraft/server/BlockFlowing.java index 7ab0b64c0c..34c31749f3 100644 --- a/src/net/minecraft/server/BlockFlowing.java +++ b/src/net/minecraft/server/BlockFlowing.java @@ -3,6 +3,7 @@ package net.minecraft.server; import java.util.Random; import org.bukkit.BlockFace; +import org.bukkit.craftbukkit.CraftBlock; import org.bukkit.event.Event.Type; import org.bukkit.event.block.BlockFromToEvent; @@ -83,13 +84,13 @@ public class BlockFlowing extends BlockFluids } // Craftbukkit start - org.bukkit.Block source = ((WorldServer) world).getWorld().getBlockAt(i1, j1, k1); + CraftBlock source = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i1, j1, k1); if(l(world, i1, j1 - 1, k1)) { // Craftbucket send "down" to the server BlockFromToEvent blockFlow = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.Down); - ((WorldServer) world).callHook(blockFlow); + ((WorldServer) world).getServer().getPluginManager().callEvent(blockFlow); if (!blockFlow.isCancelled()) { if(l1 >= 8) @@ -113,7 +114,7 @@ public class BlockFlowing extends BlockFluids int index = 0; if (aflag[index]) { BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, currentFace); - ((WorldServer) world).callHook(event); + ((WorldServer) world).getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) f(world, i1 + currentFace.getModX(), j1, k1 + currentFace.getModZ(), k2); } diff --git a/src/net/minecraft/server/WorldServer.java b/src/net/minecraft/server/WorldServer.java index 594495b38d..ba37b20aaf 100644 --- a/src/net/minecraft/server/WorldServer.java +++ b/src/net/minecraft/server/WorldServer.java @@ -48,8 +48,8 @@ public class WorldServer extends World { return world; } - public void callHook(Event event) { - server.getPluginManager().callEvent(event); + public CraftServer getServer() { + return server; } // CraftBukkit stop