mirror of
https://github.com/YouHaveTrouble/Enchantio.git
synced 2026-10-26 20:35:30 +00:00
add homecoming enchant
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package me.youhavetrouble.enchantio.events;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class HomecomingEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private boolean cancelled = false;
|
||||
private Location location;
|
||||
|
||||
public HomecomingEvent(@NotNull Player who, @NotNull Location location) {
|
||||
super(who);
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the location the player is being teleported to.
|
||||
* @return the location the player is being teleported to
|
||||
*/
|
||||
public @NotNull Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the location the player is being teleported to.
|
||||
* @param location the location the player is being teleported to
|
||||
*/
|
||||
public void setLocation(@NotNull Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user