mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-19 12:56:30 +00:00
SPIGOT-4352: MoistureChangeEvent
This commit is contained in:
parent
5466e28123
commit
3e2858f6e6
1 changed files with 55 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue