geforkt von Mirrors/Paper
Removed onBlockSent, added onLeavesDecay
By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Ursprung
fa8b3da89b
Commit
7f944f0a0d
@ -217,9 +217,9 @@ public abstract class Event {
|
||||
BLOCK_PLACED (Category.BLOCK),
|
||||
|
||||
/**
|
||||
* Called when a specific block is being sent to a player
|
||||
* Called when leaves are decaying naturally
|
||||
*/
|
||||
BLOCK_SENT (Category.BLOCK),
|
||||
LEAVES_DECAY (Category.BLOCK),
|
||||
|
||||
/**
|
||||
* Called when a liquid attempts to flow into a block which already
|
||||
|
@ -1,81 +1,89 @@
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Handles all events thrown in relation to Blocks
|
||||
*
|
||||
* @author durron597
|
||||
*/
|
||||
public class BlockListener implements Listener {
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public BlockListener() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block is broken (or destroyed)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockBroken(BlockBrokenEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when we try to place a block, to see if we can build it
|
||||
*/
|
||||
public void onBlockCanBuild(BlockCanBuildEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block flows (water/lava)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockFlow(BlockFromToEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block gets ignited
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockIgnite(BlockIgniteEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when block physics occurs
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockPhysics(BlockPhysicsEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player places a block
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockPlaced(BlockPlacedEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when redstone changes
|
||||
* From: the source of the redstone change
|
||||
* To: The redstone dust that changed
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockRedstoneChange(BlockFromToEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player right clicks a block
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockRightClicked(BlockRightClickedEvent event) {
|
||||
}
|
||||
|
||||
}
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Handles all events thrown in relation to Blocks
|
||||
*
|
||||
* @author durron597
|
||||
*/
|
||||
public class BlockListener implements Listener {
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public BlockListener() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block is broken (or destroyed)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockBroken(BlockBrokenEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when we try to place a block, to see if we can build it
|
||||
*/
|
||||
public void onBlockCanBuild(BlockCanBuildEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block flows (water/lava)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockFlow(BlockFromToEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block gets ignited
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockIgnite(BlockIgniteEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when block physics occurs
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockPhysics(BlockPhysicsEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player places a block
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockPlaced(BlockPlacedEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when redstone changes
|
||||
* From: the source of the redstone change
|
||||
* To: The redstone dust that changed
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockRedstoneChange(BlockFromToEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player right clicks a block
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockRightClicked(BlockRightClickedEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when leaves are decaying naturally
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onLeavesDecay(LeavesDecayEvent event) {
|
||||
}
|
||||
|
||||
}
|
||||
|
36
paper-api/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java
Normale Datei
36
paper-api/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java
Normale Datei
@ -0,0 +1,36 @@
|
||||
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.Block;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called on leaves decaying
|
||||
*/
|
||||
public class LeavesDecayEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
|
||||
public LeavesDecayEvent(final Type type, final Block block) {
|
||||
super(type, block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
@ -127,6 +127,9 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
case BLOCK_FLOW:
|
||||
trueListener.onBlockFlow((BlockFromToEvent)event);
|
||||
break;
|
||||
case LEAVES_DECAY:
|
||||
trueListener.onLeavesDecay((LeavesDecayEvent)event);
|
||||
break;
|
||||
}
|
||||
} else if(listener instanceof ServerListener) {
|
||||
ServerListener trueListener = (ServerListener)listener;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren