diff --git a/src/main/java/me/william278/huskhomes2/commands/TpCommand.java b/src/main/java/me/william278/huskhomes2/commands/TpCommand.java index 069b042b..d62bc0b3 100644 --- a/src/main/java/me/william278/huskhomes2/commands/TpCommand.java +++ b/src/main/java/me/william278/huskhomes2/commands/TpCommand.java @@ -71,10 +71,6 @@ public class TpCommand extends CommandBase { double z = Double.parseDouble(args[2]); String worldName = args[3]; String serverName = args[4]; - if (Bukkit.getWorld(worldName) == null) { - MessageManager.sendMessage(p, "error_invalid_syntax", "/tp "); - return; - } TeleportationPoint teleportationPoint = new TeleportationPoint(worldName, x, y, z, 0F, 0F, serverName); TeleportManager.teleportPlayer(p, teleportationPoint, connection); } catch (Exception e) { diff --git a/src/main/java/me/william278/huskhomes2/teleport/TeleportManager.java b/src/main/java/me/william278/huskhomes2/teleport/TeleportManager.java index b6e5183b..0ca8b8f2 100644 --- a/src/main/java/me/william278/huskhomes2/teleport/TeleportManager.java +++ b/src/main/java/me/william278/huskhomes2/teleport/TeleportManager.java @@ -23,7 +23,6 @@ public class TeleportManager { private static TeleportationPoint spawnLocation; - // todo this doesnt seem to work cross server public static void teleportPlayer(Player player, String targetPlayer, Connection connection) throws SQLException { DataManager.setPlayerLastPosition(player, new TeleportationPoint(player.getLocation(), HuskHomes.getSettings().getServerID()), connection); @@ -60,6 +59,8 @@ public class TeleportManager { } } catch (SQLException e) { plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred!", e); + } catch (Exception e) { + MessageManager.sendMessage(p, "error_invalid_on_arrival"); } }); } diff --git a/src/main/resources/Languages/en-gb.yml b/src/main/resources/Languages/en-gb.yml index 03f2d929..256bebdc 100644 --- a/src/main/resources/Languages/en-gb.yml +++ b/src/main/resources/Languages/en-gb.yml @@ -121,4 +121,5 @@ page_options_min: '\n[Viewing Page %1%/%2%](#00fb9a) [→](gray show_text=&7View page_options_min_max: '\n[Viewing Page %1%/%2%](#00fb9a)' page_options_max: '\n[←](gray show_text=&7View previous page run_command=%1%) [Viewing Page %2%/%3%](#00fb9a)' page_no_items: '[(No items to display on this page)](gray show_text=&7Try a different page number)' -command_list_header: '\n[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)' \ No newline at end of file +command_list_header: '\n[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)' +error_invalid_on_arrival: '[Error:](#ff3300) [Failed to finish your teleportation as the target world could not be found.](#ff7e5e)' diff --git a/src/main/resources/Languages/it-it.yml b/src/main/resources/Languages/it-it.yml index 7b656300..69c7aee2 100644 --- a/src/main/resources/Languages/it-it.yml +++ b/src/main/resources/Languages/it-it.yml @@ -121,4 +121,5 @@ page_options_min: '\n[Pagina %1%/%2%](#00fb9a) [→](gray show_text=&7Pagina suc page_options_min_max: '\n[Pagina %1%/%2%](#00fb9a)' page_options_max: '\n[←](gray show_text=&7Pagina precedente run_command=%1%) [Pagina %2%/%3%](#00fb9a)' page_no_items: '[(Nessun oggetto visibile in questa pagina)](gray show_text=&7Prova un numero differente)' -command_list_header: '\n[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)' \ No newline at end of file +command_list_header: '\n[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)' +error_invalid_on_arrival: '[Error:](#ff3300) [Failed to finish your teleportation as the target world could not be found.](#ff7e5e)' \ No newline at end of file