add homecoming enchant

This commit is contained in:
2024-10-31 18:05:42 +01:00
parent fe48978d31
commit 1a6df2b826
6 changed files with 249 additions and 0 deletions
@@ -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;
}
}