added config support

This commit is contained in:
2023-10-07 03:09:28 +02:00
parent 0fe5ce24a8
commit 6ac6455f2d
9 changed files with 51 additions and 16 deletions

View File

@ -17,8 +17,14 @@ public class back implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (!this.gameManager.getConfigManager().GetBool("back_command")) {
commandSender.sendMessage("back command ist nicht aktiv");
return false;
}
Player player = (Player) commandSender.getServer().getPlayer(commandSender.getName());
Location lastDeath;
try {
lastDeath = this.gameManager.getPlugin().getPlayerDataConfig().getLocation(player.getUniqueId() + ".death");
player.teleport(lastDeath);
@ -27,6 +33,7 @@ public class back implements CommandExecutor {
} catch (Exception ex) {
commandSender.sendMessage("Tot nicht gefunden!");
}
return false;
}
}