mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-23 09:03:50 +00:00
BlockFadeEvent
This commit is contained in:
parent
29eeeb8d86
commit
e91e5be732
12 changed files with 162 additions and 1 deletions
41
Minecraft.Server.FourKit/Event/Block/BlockFadeEvent.cs
Normal file
41
Minecraft.Server.FourKit/Event/Block/BlockFadeEvent.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue