Use TeleportManager in /spawn

This commit is contained in:
Spencer 2018-03-07 13:39:36 -05:00 committed by Alexander Meech
parent 3f2ef4eab4
commit 2162f1a883
2 changed files with 9 additions and 5 deletions

View File

@ -123,7 +123,6 @@ public class MapParser extends JavaPlugin
commandModule.add(new SaveCommand(this)); commandModule.add(new SaveCommand(this));
commandModule.add(new WorldsCommand(this)); commandModule.add(new WorldsCommand(this));
commandModule.add(new CopyCommand(this)); commandModule.add(new CopyCommand(this));
commandModule.add(new SpawnCommand(this));
commandModule.add(new SetSpawnCommand(this)); commandModule.add(new SetSpawnCommand(this));
commandModule.add(new ItemNameCommand(this)); commandModule.add(new ItemNameCommand(this));
commandModule.add(new AddLoreCommand(this)); commandModule.add(new AddLoreCommand(this));
@ -151,6 +150,8 @@ public class MapParser extends JavaPlugin
commandModule.add(new BackCommand(_teleportManager)); commandModule.add(new BackCommand(_teleportManager));
commandModule.add(new TopCommand(_teleportManager)); commandModule.add(new TopCommand(_teleportManager));
commandModule.add(new SpawnCommand(_teleportManager));
loadInfo(); loadInfo();
addSplashText(); addSplashText();
} }

View File

@ -3,20 +3,23 @@ package mineplex.mapparser.command;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import mineplex.mapparser.MapParser; import mineplex.mapparser.MapParser;
import mineplex.mapparser.command.teleport.TeleportManager;
public class SpawnCommand extends BaseCommand public class SpawnCommand extends BaseCommand
{ {
private TeleportManager _teleportManager;
public SpawnCommand(MapParser plugin) public SpawnCommand(TeleportManager plugin)
{ {
super(plugin, "spawn"); super(plugin.getPlugin(), "spawn");
_teleportManager = plugin;
} }
@Override @Override
public boolean execute(Player player, String alias, String[] args) public boolean execute(Player player, String alias, String[] args)
{ {
player.teleport(player.getWorld().getSpawnLocation()); _teleportManager.teleportPlayer(player, player.getWorld().getSpawnLocation());
return true; return true;
} }