From 130ae818577f590dbde2c299b1b8f09d6fcad0dc Mon Sep 17 00:00:00 2001 From: sekwah Date: Wed, 21 Feb 2018 02:52:21 +0000 Subject: [PATCH] Updated some portal info --- .../core/api/managers/DestinationManager.java | 4 ---- .../core/api/managers/PortalManager.java | 16 ++++++++-------- .../core/api/portal/AdvancedPortal.java | 1 + .../subcommands/portal/CreateSubCommand.java | 2 +- .../subcommands/portal/RemoveSubCommand.java | 4 ++-- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/com/sekwah/advancedportals/core/api/managers/DestinationManager.java b/src/com/sekwah/advancedportals/core/api/managers/DestinationManager.java index 875e7ec4..47e6e2c8 100644 --- a/src/com/sekwah/advancedportals/core/api/managers/DestinationManager.java +++ b/src/com/sekwah/advancedportals/core/api/managers/DestinationManager.java @@ -29,10 +29,6 @@ public class DestinationManager { } public void createDesti(PlayerContainer player, PlayerLocation playerLocation, ArrayList dataTags) throws DestinationException { - if(player == null) { - throw new DestinationException(Lang.translate("error.notplayer")); - } - } diff --git a/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java b/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java index 13ea9d5c..0bbcbb04 100644 --- a/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java +++ b/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java @@ -100,7 +100,7 @@ public class PortalManager { this.createPortal(name, player, this.portalSelectorLeftClick.get(player.getUUID().toString()), this.portalSelectorRightClick.get(player.getUUID().toString()), tags); } else { - throw new PortalException(Lang.translate("portal.invalidselection")); + throw new PortalException("portal.invalidselection"); } } @@ -137,7 +137,7 @@ public class PortalManager { int minZ = Math.min(loc1.posZ, loc2.posZ); if(!loc1.worldName.equalsIgnoreCase(loc2.worldName)) { - throw new PortalException(Lang.translate("portal.error.selection.differentworlds")); + throw new PortalException("portal.error.selection.differentworlds"); } PortalLocation maxLoc = new PortalLocation(loc1.worldName, maxX, maxY, maxZ); @@ -152,10 +152,10 @@ public class PortalManager { creation.portalCreated(portal, player, portalTag.VALUE); } if(name == null || name.equals("")) { - throw new PortalException(Lang.translate("portal.error.noname")); + throw new PortalException("portal.error.noname"); } else if(this.portalHashMap.containsKey(name)) { - throw new PortalException(Lang.translate("portal.error.takenname")); + throw new PortalException("portal.error.takenname"); } this.portalHashMap.put(name, portal); this.updatePortalArray(); @@ -173,16 +173,16 @@ public class PortalManager { this.removePortal(player, portal); } catch(PortalException e) { - if(e.getMessage().equals(Lang.translate("command.remove.noname"))) { + if(e.getMessage().equals("command.remove.noname")) { this.selectedPortal.remove(player.getUUID()); - throw new PortalException(Lang.translate("command.remove.invalidselection")); + throw new PortalException("command.remove.invalidselection"); } else { throw e; } } } - throw new PortalException(Lang.translate("command.remove.noselection")); + throw new PortalException("command.remove.noselection"); } /** @@ -193,7 +193,7 @@ public class PortalManager { public void removePortal(PlayerContainer player, String portalName) throws PortalException { AdvancedPortal portal = this.getPortal(portalName); if(portal == null) { - throw new PortalException(Lang.translate("command.remove.noname")); + throw new PortalException("command.remove.noname"); } for(DataTag portalTag : portal.getArgs()) { diff --git a/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java b/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java index b4cd751c..c8d8bc35 100644 --- a/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java +++ b/src/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java @@ -17,6 +17,7 @@ import java.util.Set; * @author sekwah41 */ public class AdvancedPortal { + @SerializedName("max") private PortalLocation maxLoc; diff --git a/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreateSubCommand.java b/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreateSubCommand.java index a4dd9b48..e7e00d3d 100644 --- a/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreateSubCommand.java +++ b/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreateSubCommand.java @@ -54,7 +54,7 @@ public class CreateSubCommand implements SubCommand { AdvancedPortalsCore.getPortalManager().createPortal(args[1], player, portalTags); } catch (PortalException portalTagExeption) { sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translateColor("command.create.error") + " " - + portalTagExeption.getMessage()); + + Lang.translate(portalTagExeption.getMessage())); } } else { diff --git a/src/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java b/src/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java index b76caca5..d13500be 100644 --- a/src/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java +++ b/src/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java @@ -22,7 +22,7 @@ public class RemoveSubCommand implements SubCommand { AdvancedPortalsCore.getPortalManager().removePortal(sender.getPlayerContainer(), args[1]); } catch (PortalException portalTagExeption) { sender.sendMessage(Lang.translateColor("messageprefix.negative") - + Lang.translateColor("command.remove.error") + " " + portalTagExeption.getMessage()); + + Lang.translateColor("command.remove.error") + " " + Lang.translate(portalTagExeption.getMessage())); } } else { @@ -35,7 +35,7 @@ public class RemoveSubCommand implements SubCommand { AdvancedPortalsCore.getPortalManager().removePlayerSelection(player); } catch (PortalException portalTagExeption) { sender.sendMessage(Lang.translateColor("messageprefix.negative") - + Lang.translateColor("command.remove.error") + " " + portalTagExeption.getMessage()); + + Lang.translateColor("command.remove.error") + " " + Lang.translate(portalTagExeption.getMessage())); } } }