mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-13 04:33:52 +00:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
namespace Minecraft.Server.FourKit.Event.Block;
|
|
|
|
using Minecraft.Server.FourKit.Block;
|
|
|
|
/// <summary>
|
|
/// Called when a block fades, melts or disappears based on world conditions.
|
|
///
|
|
/// <para>Examples:</para>
|
|
/// <list type="bullet">
|
|
/// <item><description>Snow melting due to being near a light source.</description></item>
|
|
/// <item><description>Ice melting due to being near a light source.</description></item>
|
|
/// </list>
|
|
///
|
|
/// <para>If a Block Fade event is cancelled, the block will not fade, melt or disappear.</para>
|
|
/// </summary>
|
|
public class BlockFadeEvent : BlockEvent, Cancellable
|
|
{
|
|
private readonly BlockState _newState;
|
|
private bool _cancel;
|
|
|
|
internal BlockFadeEvent(Block block, BlockState newState) : base(block)
|
|
{
|
|
_newState = newState;
|
|
_cancel = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the state of the block that will be fading, melting or disappearing.
|
|
/// </summary>
|
|
/// <returns>The block state of the block that will be fading, melting or disappearing.</returns>
|
|
public BlockState getNewState() => _newState;
|
|
|
|
/// <inheritdoc/>
|
|
public bool isCancelled() => _cancel;
|
|
|
|
/// <inheritdoc/>
|
|
public void setCancelled(bool cancel)
|
|
{
|
|
_cancel = cancel;
|
|
}
|
|
}
|