mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 09:23:42 +01:00
Changed Block to CraftBlock. Changed callHook to getServer
This commit is contained in:
parent
4af385af1f
commit
02c469a93d
2 changed files with 6 additions and 5 deletions
|
@ -3,6 +3,7 @@ package net.minecraft.server;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.bukkit.BlockFace;
|
import org.bukkit.BlockFace;
|
||||||
|
import org.bukkit.craftbukkit.CraftBlock;
|
||||||
import org.bukkit.event.Event.Type;
|
import org.bukkit.event.Event.Type;
|
||||||
import org.bukkit.event.block.BlockFromToEvent;
|
import org.bukkit.event.block.BlockFromToEvent;
|
||||||
|
|
||||||
|
@ -83,13 +84,13 @@ public class BlockFlowing extends BlockFluids
|
||||||
}
|
}
|
||||||
|
|
||||||
// Craftbukkit start
|
// 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))
|
if(l(world, i1, j1 - 1, k1))
|
||||||
{
|
{
|
||||||
// Craftbucket send "down" to the server
|
// Craftbucket send "down" to the server
|
||||||
BlockFromToEvent blockFlow = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.Down);
|
BlockFromToEvent blockFlow = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.Down);
|
||||||
((WorldServer) world).callHook(blockFlow);
|
((WorldServer) world).getServer().getPluginManager().callEvent(blockFlow);
|
||||||
|
|
||||||
if (!blockFlow.isCancelled()) {
|
if (!blockFlow.isCancelled()) {
|
||||||
if(l1 >= 8)
|
if(l1 >= 8)
|
||||||
|
@ -113,7 +114,7 @@ public class BlockFlowing extends BlockFluids
|
||||||
int index = 0;
|
int index = 0;
|
||||||
if (aflag[index]) {
|
if (aflag[index]) {
|
||||||
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, currentFace);
|
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, currentFace);
|
||||||
((WorldServer) world).callHook(event);
|
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled())
|
if (!event.isCancelled())
|
||||||
f(world, i1 + currentFace.getModX(), j1, k1 + currentFace.getModZ(), k2);
|
f(world, i1 + currentFace.getModX(), j1, k1 + currentFace.getModZ(), k2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@ public class WorldServer extends World {
|
||||||
return world;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void callHook(Event event) {
|
public CraftServer getServer() {
|
||||||
server.getPluginManager().callEvent(event);
|
return server;
|
||||||
}
|
}
|
||||||
// CraftBukkit stop
|
// CraftBukkit stop
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue