From 4b889af28d890f87a84f6576353b086e654c6d2d Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 9 Sep 2018 18:53:27 +1000 Subject: [PATCH] SPIGOT-4352: MoistureChangeEvent By: md_5 --- .../event/block/MoistureChangeEvent.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/event/block/MoistureChangeEvent.java diff --git a/paper-api/src/main/java/org/bukkit/event/block/MoistureChangeEvent.java b/paper-api/src/main/java/org/bukkit/event/block/MoistureChangeEvent.java new file mode 100644 index 0000000000..0ee5d6da34 --- /dev/null +++ b/paper-api/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; + } +}