using Minecraft.Server.FourKit.Enums; using System; using System.Collections.Generic; using System.Text; namespace Minecraft.Server.FourKit.Event.World; /// /// Event that is called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal. /// public class StructureGrowEvent : WorldEvent, Cancellable { internal Location _location; internal TreeType _treeType; internal bool _wasBonemeal; internal Minecraft.Server.FourKit.Entity.Player? _player; internal bool _cancelled; internal StructureGrowEvent(Location location, TreeType treeType, bool wasBonemeal, Minecraft.Server.FourKit.Entity.Player? player) : base(location.getWorld()) { _location = location; _treeType = treeType; _wasBonemeal = wasBonemeal; _player = player; } /// /// Gets the species type (birch, normal, pine, red mushroom, brown mushroom). /// /// Structure species public TreeType getSpecies() => _treeType; /// /// Gets the location of the structure. /// /// Location of the structure public Location getLocation() => _location; /// /// Checks if structure was grown using bonemeal. /// /// True if the structure was grown using bonemeal. public bool isFromBonemeal() => _wasBonemeal; /// /// Gets the player that created the structure. /// /// Player that created the structure, null if was not created manually public Minecraft.Server.FourKit.Entity.Player? getPlayer() => _player; /// public bool isCancelled() => _cancelled; /// public void setCancelled(bool cancel) => _cancelled = cancel; }