moved code to new structure
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package de.steev.bm.Commands;
|
||||
|
||||
import de.steev.bm.main;
|
||||
import de.steev.bm.BetterMinecraft;
|
||||
import de.steev.bm.Manager.GameManager;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@ -8,10 +9,10 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class back implements CommandExecutor {
|
||||
main plugin;
|
||||
private GameManager gameManager;
|
||||
|
||||
public back(main plugin) {
|
||||
this.plugin = plugin;
|
||||
public back(GameManager gameManager) {
|
||||
this.gameManager = gameManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -19,9 +20,9 @@ public class back implements CommandExecutor {
|
||||
Player player = (Player) commandSender.getServer().getPlayer(commandSender.getName());
|
||||
Location lastDeath;
|
||||
try {
|
||||
lastDeath = plugin.playerDataConfig.getLocation(player.getUniqueId() + ".death");
|
||||
lastDeath = this.gameManager.getPlugin().getPlayerDataConfig().getLocation(player.getUniqueId() + ".death");
|
||||
player.teleport(lastDeath);
|
||||
plugin.playerDataConfig.set(player.getUniqueId() + ".death", null);
|
||||
this.gameManager.getPlugin().getPlayerDataConfig().set(player.getUniqueId() + ".death", null);
|
||||
commandSender.sendMessage("Du wurdest Teleportiert. Dein todespunkt ist nun entfernt worden.");
|
||||
} catch (Exception ex) {
|
||||
commandSender.sendMessage("Tot nicht gefunden!");
|
||||
|
Reference in New Issue
Block a user