From 2efc265b9688660fe8366daa4a61af014848ee62 Mon Sep 17 00:00:00 2001 From: durron597 Date: Sat, 1 Jan 2011 01:20:44 -0500 Subject: [PATCH] Implemented BLOCK_CANBUILD --- src/net/minecraft/server/WorldServer.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/net/minecraft/server/WorldServer.java b/src/net/minecraft/server/WorldServer.java index ba37b20aaf..351a5ff0ad 100644 --- a/src/net/minecraft/server/WorldServer.java +++ b/src/net/minecraft/server/WorldServer.java @@ -2,11 +2,14 @@ package net.minecraft.server; import java.io.File; -import java.util.*; -import org.bukkit.craftbukkit.CraftBlock; +import java.util.Random; +import java.util.ArrayList; +import java.util.List; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.event.Event; +import org.bukkit.event.Event.Type; +import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; @@ -85,6 +88,16 @@ public class WorldServer extends World { } // CraftBukkit stop + // CraftBukkit start + @Override + public boolean a(int i1, int j1, int k1, int l1, boolean flag) { + BlockCanBuildEvent event = new BlockCanBuildEvent(Type.BLOCK_CANBUILD, getWorld().getBlockAt(j1, k1, l1), super.a(i1, j1, k1, l1, flag)); + server.getPluginManager().callEvent(event); + + return event.isCancelled(); + } + // CraftBukkit stop + public void f() { super.f(); }