mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-05 16:49:39 +00:00
Implemented BLOCK_CANBUILD
This commit is contained in:
parent
f527fd4398
commit
eadfe2adff
1 changed files with 14 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue