namespace Minecraft.Server.FourKit.Event.Player;
using Minecraft.Server.FourKit.Entity;
///
/// Fired when a player moves. Plugins may modify the destination
/// or cancel the movement entirely.
///
public class PlayerMoveEvent : PlayerEvent, Cancellable
{
private Location _from;
private Location _to;
private bool _cancelled;
internal PlayerMoveEvent(Player player, Location from, Location to) : base(player)
{
_from = from;
_to = to;
}
///
/// Gets the location this player moved from.
///
/// The from location.
public Location getFrom() => _from;
///
/// Gets the location this player moved to.
///
/// The to location.
public Location getTo() => _to;
///
/// Sets the location to mark as where the player moved from.
///
/// The new from location.
public void setFrom(Location from)
{
_from = from;
}
///
/// Sets the location that this player will move to.
///
/// The new to location.
public void setTo(Location to)
{
_to = to;
}
///
public bool isCancelled() => _cancelled;
///
public void setCancelled(bool cancel)
{
_cancelled = cancel;
}
}