added config support
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user