geforkt von Mirrors/Paper
Added BlockCanBuild Event. Fixed Event enumeration
By: durron597 <martin.jared@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
1c88da4e93
Commit
be1ad0e040
@ -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),
|
||||
|
28
paper-api/src/org/bukkit/event/block/BlockCanBuildEvent.java
Normale Datei
28
paper-api/src/org/bukkit/event/block/BlockCanBuildEvent.java
Normale Datei
@ -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) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren