summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordurron597 <martin.jared@gmail.com>2011-01-01 01:25:22 -0500
committerdurron597 <martin.jared@gmail.com>2011-01-01 01:25:22 -0500
commit0b7cab13d0f5c7ab1202e65b872f14bb941f3a2e (patch)
tree466c100d7d945a363f7c6027fa052b08ffa1ac83
parentf527fd439849729c8188d80872e793e668db3a1b (diff)
downloadbukkit-0b7cab13d0f5c7ab1202e65b872f14bb941f3a2e.tar
bukkit-0b7cab13d0f5c7ab1202e65b872f14bb941f3a2e.tar.gz
bukkit-0b7cab13d0f5c7ab1202e65b872f14bb941f3a2e.tar.lz
bukkit-0b7cab13d0f5c7ab1202e65b872f14bb941f3a2e.tar.xz
bukkit-0b7cab13d0f5c7ab1202e65b872f14bb941f3a2e.zip
Implemented BLOCK_CANBUILD, had wrong Listener method name
-rw-r--r--src/org/bukkit/event/block/BlockCanBuildEvent.java17
-rw-r--r--src/org/bukkit/event/block/BlockListener.java2
2 files changed, 15 insertions, 4 deletions
diff --git a/src/org/bukkit/event/block/BlockCanBuildEvent.java b/src/org/bukkit/event/block/BlockCanBuildEvent.java
index ebbe83c9..859c8d30 100644
--- a/src/org/bukkit/event/block/BlockCanBuildEvent.java
+++ b/src/org/bukkit/event/block/BlockCanBuildEvent.java
@@ -12,15 +12,26 @@ import org.bukkit.event.Cancellable;
public class BlockCanBuildEvent extends BlockEvent implements Cancellable {
protected boolean cancel;
- public BlockCanBuildEvent(Type type, Block block) {
+ public BlockCanBuildEvent(Type type, Block block, boolean canBuild) {
super(type, block);
+
+ cancel = canBuild;
}
-
+
+ /**
+ * Returns whether or not the block can be built here. By default, returns
+ * Minecraft's answer on whether the block can be built
+ *
+ * @return boolean whether or not the block can be built
+ */
@Override
public boolean isCancelled() {
return cancel;
}
-
+
+ /**
+ * Set whether the block can be built here.
+ */
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
diff --git a/src/org/bukkit/event/block/BlockListener.java b/src/org/bukkit/event/block/BlockListener.java
index 7bead1a7..cef040c3 100644
--- a/src/org/bukkit/event/block/BlockListener.java
+++ b/src/org/bukkit/event/block/BlockListener.java
@@ -25,7 +25,7 @@ public class BlockListener implements Listener {
/**
* Called when we try to place a block, to see if we can build it
*/
- public void canBuild(BlockCanBuildEvent event) {
+ public void onBlockCanBuild(BlockCanBuildEvent event) {
}
/**