From c7d680163f0757bafc7e9cd00ea8a29305729639 Mon Sep 17 00:00:00 2001 From: durron597 Date: Sat, 1 Jan 2011 01:39:28 -0500 Subject: [PATCH] Didn't work correctly before. Now it does --- src/net/minecraft/server/WorldServer.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/net/minecraft/server/WorldServer.java b/src/net/minecraft/server/WorldServer.java index 351a5ff0ad..917147fc99 100644 --- a/src/net/minecraft/server/WorldServer.java +++ b/src/net/minecraft/server/WorldServer.java @@ -1,6 +1,5 @@ package net.minecraft.server; - import java.io.File; import java.util.Random; import java.util.ArrayList; @@ -90,11 +89,17 @@ public class WorldServer extends World { // 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); + public boolean a(int i1, int j1, int k1, int l1, boolean flag) { + boolean superResult = super.a(i1, j1, k1, l1, flag); - return event.isCancelled(); + if (!flag) { + BlockCanBuildEvent event = new BlockCanBuildEvent(Type.BLOCK_CANBUILD, getWorld().getBlockAt(j1, k1, l1), !superResult); + server.getPluginManager().callEvent(event); + + return !event.isCancelled(); + } else { + return superResult; + } } // CraftBukkit stop