13
0
geforkt von Mirrors/Paper

Removed onBlockSent, added onLeavesDecay

By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-01-04 22:03:15 +00:00
Ursprung fa8b3da89b
Commit 7f944f0a0d
4 geänderte Dateien mit 130 neuen und 83 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

@ -78,4 +78,12 @@ public class BlockListener implements Listener {
public void onBlockRightClicked(BlockRightClickedEvent event) {
}
/**
* Called when leaves are decaying naturally
*
* @param event Relevant event details
*/
public void onLeavesDecay(LeavesDecayEvent event) {
}
}

Datei anzeigen

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

Datei anzeigen

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