diff options
author | md_5 <git@md-5.net> | 2018-09-09 18:53:27 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-09-09 18:53:27 +1000 |
commit | 3e2858f6e680d43b85a760866df1fb4c1f9547b9 (patch) | |
tree | 0aa073d1af6c65b993eb997054e1c12fe62d1acc /src | |
parent | 5466e28123d69eebfccf83e0c29d8eb37be7ec56 (diff) | |
download | bukkit-3e2858f6e680d43b85a760866df1fb4c1f9547b9.tar bukkit-3e2858f6e680d43b85a760866df1fb4c1f9547b9.tar.gz bukkit-3e2858f6e680d43b85a760866df1fb4c1f9547b9.tar.lz bukkit-3e2858f6e680d43b85a760866df1fb4c1f9547b9.tar.xz bukkit-3e2858f6e680d43b85a760866df1fb4c1f9547b9.zip |
SPIGOT-4352: MoistureChangeEvent
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/event/block/MoistureChangeEvent.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/block/MoistureChangeEvent.java b/src/main/java/org/bukkit/event/block/MoistureChangeEvent.java new file mode 100644 index 00000000..0ee5d6da --- /dev/null +++ b/src/main/java/org/bukkit/event/block/MoistureChangeEvent.java @@ -0,0 +1,55 @@ +package org.bukkit.event.block; + +import org.bukkit.Warning; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; + +/** + * Called when the moisture level of a soil block changes. + * + * @deprecated draft API + */ +@Deprecated +@Warning(false) +public class MoistureChangeEvent extends BlockEvent implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final BlockState newState; + + public MoistureChangeEvent(final Block block, final BlockState newState) { + super(block); + this.newState = newState; + this.cancelled = false; + } + + /** + * Gets the new state of the affected block. + * + * @return new block state + */ + public BlockState getNewState() { + return newState; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancelled = cancel; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } +} |