13
0
geforkt von Mirrors/Paper

Added BlockCanBuild Event. Fixed Event enumeration

By: durron597 <martin.jared@gmail.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2010-12-31 22:44:11 -05:00
Ursprung 1c88da4e93
Commit be1ad0e040
3 geänderte Dateien mit 36 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -76,7 +76,8 @@ public abstract class Event {
/**
* Block Events
*/
BLOCK_DAMAGED (Category.BLOCK),
BLOCK_BROKEN (Category.BLOCK),
BLOCK_CANBUILD (Category.BLOCK),
BLOCK_FLOW (Category.BLOCK),
BLOCK_IGNITE (Category.BLOCK),
BLOCK_PHYSICS (Category.BLOCK),

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -22,6 +22,12 @@ public class BlockListener implements Listener {
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)
*