Added BlockCanBuild Event. Fixed Event enumeration
This commit is contained in:
parent
e26e2d70e8
commit
f527fd4398
@ -76,7 +76,8 @@ public abstract class Event {
|
|||||||
/**
|
/**
|
||||||
* Block Events
|
* Block Events
|
||||||
*/
|
*/
|
||||||
BLOCK_DAMAGED (Category.BLOCK),
|
BLOCK_BROKEN (Category.BLOCK),
|
||||||
|
BLOCK_CANBUILD (Category.BLOCK),
|
||||||
BLOCK_FLOW (Category.BLOCK),
|
BLOCK_FLOW (Category.BLOCK),
|
||||||
BLOCK_IGNITE (Category.BLOCK),
|
BLOCK_IGNITE (Category.BLOCK),
|
||||||
BLOCK_PHYSICS (Category.BLOCK),
|
BLOCK_PHYSICS (Category.BLOCK),
|
||||||
|
28
src/org/bukkit/event/block/BlockCanBuildEvent.java
Normal file
28
src/org/bukkit/event/block/BlockCanBuildEvent.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.bukkit.event.block;
|
||||||
|
|
||||||
|
import org.bukkit.Block;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author durron597
|
||||||
|
*/
|
||||||
|
public class BlockCanBuildEvent extends BlockEvent implements Cancellable {
|
||||||
|
protected boolean cancel;
|
||||||
|
|
||||||
|
public BlockCanBuildEvent(Type type, Block block) {
|
||||||
|
super(type, block);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancel = cancel;
|
||||||
|
}
|
||||||
|
}
|
@ -22,6 +22,12 @@ public class BlockListener implements Listener {
|
|||||||
public void onBlockBroken(BlockBrokenEvent event) {
|
public void onBlockBroken(BlockBrokenEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when we try to place a block, to see if we can build it
|
||||||
|
*/
|
||||||
|
public void canBuild(BlockCanBuildEvent event) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a block flows (water/lava)
|
* Called when a block flows (water/lava)
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user