From 67aba9081bb73aeaa822b059e8ca6defc8352a2f Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 6 Sep 2025 23:11:25 -0400 Subject: rename pacakges dev.tylerm -> cat.freya --- .../cat/freya/khs/command/SetExitLocation.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/main/java/cat/freya/khs/command/SetExitLocation.java (limited to 'src/main/java/cat/freya/khs/command/SetExitLocation.java') diff --git a/src/main/java/cat/freya/khs/command/SetExitLocation.java b/src/main/java/cat/freya/khs/command/SetExitLocation.java new file mode 100644 index 0000000..637088b --- /dev/null +++ b/src/main/java/cat/freya/khs/command/SetExitLocation.java @@ -0,0 +1,42 @@ +package cat.freya.khs.command; + +import cat.freya.khs.command.location.LocationUtils; +import cat.freya.khs.command.location.Locations; +import cat.freya.khs.command.util.ICommand; +import cat.freya.khs.configuration.Config; +import cat.freya.khs.util.Location; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class SetExitLocation implements ICommand { + + public void execute(Player sender, String[] args) { + LocationUtils.setLocation(sender, Locations.EXIT, null, map -> { + Config.addToConfig("exit.x", sender.getLocation().getBlockX()); + Config.addToConfig("exit.y", sender.getLocation().getBlockY()); + Config.addToConfig("exit.z", sender.getLocation().getBlockZ()); + Config.addToConfig("exit.world", sender.getLocation().getWorld().getName()); + Config.exitPosition = Location.from(sender); + Config.saveConfig(); + }); + } + + public String getLabel() { + return "setexit"; + } + + public String getUsage() { + return ""; + } + + public String getDescription() { + return "Sets the plugins exit location"; + } + + public List autoComplete(@NotNull String parameter, @NotNull String typed) { + return null; + } + +} -- cgit v1.2.3-freya