diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapData.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapData.java index 7ac663744..e7cfe73a0 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapData.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapData.java @@ -6,7 +6,11 @@ import com.google.common.collect.Sets; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayerBase; import mineplex.core.common.util.UtilWorld; + +import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.WorldCreator; import org.bukkit.entity.Player; import java.io.BufferedReader; diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/InfoCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/GameTypeInfoCommand.java similarity index 92% rename from Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/InfoCommand.java rename to Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/GameTypeInfoCommand.java index e2436d51d..5598871df 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/InfoCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/GameTypeInfoCommand.java @@ -11,12 +11,12 @@ import org.bukkit.entity.Player; /** * */ -public class InfoCommand extends BaseCommand +public class GameTypeInfoCommand extends BaseCommand { - public InfoCommand(MapParser plugin) + public GameTypeInfoCommand(MapParser plugin) { - super(plugin, "gameinfo"); + super(plugin, "gameinfo", "gametypeinfo"); setUsage("/info & /info addInfo "); } diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/MapCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/MapCommand.java index 40b6c97f1..75df5ed4e 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/MapCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/MapCommand.java @@ -97,19 +97,7 @@ public class MapCommand extends BaseCommand System.out.println("Could not delete uid.dat for " + worldName); } - World world = getPlugin().getMapWorld(worldName); - if (world == null) - { - if (getPlugin().doesMapExist(worldName)) - { - world = Bukkit.createWorld(new WorldCreator(worldName)); - } - else - { - message(player, "Map Not Found: " + F.elem(worldName)); - return true; - } - } + World world = getPlugin().getWorldFromName(worldName); //Error (This should not occur!) if (world == null) @@ -119,9 +107,9 @@ public class MapCommand extends BaseCommand } //Permission - if (!getPlugin().getData(world.getName()).CanJoin(player)) + if (!_teleportManager.canTeleportTo(player, world.getSpawnLocation())) { - message(player, "You do not have Join-Access on this Map."); + message(player, "You are not permitted to access this map."); return true; } diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/BackCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/BackCommand.java index d2f244a4f..9d5795789 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/BackCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/BackCommand.java @@ -5,7 +5,6 @@ import java.util.LinkedList; import org.bukkit.Location; import org.bukkit.entity.Player; -import mineplex.mapparser.MapParser; import mineplex.mapparser.command.BaseCommand; public class BackCommand extends BaseCommand @@ -70,12 +69,18 @@ public class BackCommand extends BaseCommand return true; } - if (_teleportManager.canTeleportTo(player, location)) + if (!_teleportManager.canTeleportTo(player, location)) { message(player, "You don't have access to teleport back to that location."); return true; } + // If the world doesn't already exist, load it + if (location.getWorld() == null || (!location.getWorld().equals(player.getWorld()) && location.getWorld().getPlayers().size() == 0)) + { + _teleportManager.getPlugin().getWorldFromName(location.getWorld().getName()); + } + player.teleport(location); return true; } diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TeleportManager.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TeleportManager.java index 953c31684..6997404f4 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TeleportManager.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TeleportManager.java @@ -2,7 +2,6 @@ package mineplex.mapparser.command.teleport; import java.util.HashMap; import java.util.LinkedList; -import java.util.List; import java.util.Map; import org.bukkit.Location;