From 2162f1a883224e1b44e82da630ff4950408d8b39 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 7 Mar 2018 13:39:36 -0500 Subject: [PATCH] Use TeleportManager in /spawn --- .../src/mineplex/mapparser/MapParser.java | 3 ++- .../src/mineplex/mapparser/command/SpawnCommand.java | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index bc19ca16c..c13f08687 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -123,7 +123,6 @@ public class MapParser extends JavaPlugin commandModule.add(new SaveCommand(this)); commandModule.add(new WorldsCommand(this)); commandModule.add(new CopyCommand(this)); - commandModule.add(new SpawnCommand(this)); commandModule.add(new SetSpawnCommand(this)); commandModule.add(new ItemNameCommand(this)); commandModule.add(new AddLoreCommand(this)); @@ -151,6 +150,8 @@ public class MapParser extends JavaPlugin commandModule.add(new BackCommand(_teleportManager)); commandModule.add(new TopCommand(_teleportManager)); + commandModule.add(new SpawnCommand(_teleportManager)); + loadInfo(); addSplashText(); } diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/SpawnCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/SpawnCommand.java index e43f7515d..db2ae874d 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/SpawnCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/SpawnCommand.java @@ -3,20 +3,23 @@ package mineplex.mapparser.command; import org.bukkit.entity.Player; import mineplex.mapparser.MapParser; +import mineplex.mapparser.command.teleport.TeleportManager; 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 public boolean execute(Player player, String alias, String[] args) { - player.teleport(player.getWorld().getSpawnLocation()); - + _teleportManager.teleportPlayer(player, player.getWorld().getSpawnLocation()); return true; }