From be858f308b55a515312dad17739fda0b6780f449 Mon Sep 17 00:00:00 2001 From: sekwah Date: Thu, 22 Feb 2018 03:21:23 +0000 Subject: [PATCH] Added saving on create --- .../subcommands/desti/CreateDestiSubCommand.java | 10 ++++++---- .../subcommands/portal/CreatePortalSubCommand.java | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java b/src/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java index 28346894..55df5391 100644 --- a/src/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java +++ b/src/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java @@ -26,10 +26,12 @@ public class CreateDestiSubCommand extends CreateSubCommand implements SubComman ArrayList destiTags = this.getTagsFromArgs(args); try { Destination desti = AdvancedPortalsCore.getDestinationManager().createDesti(args[1], player, player.getLoc(), destiTags); - sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translateColor("command.createdesti.complete")); - sender.sendMessage(Lang.translateColor("command.create.tags")); - for (DataTag tag: desti.getArgs()) { - sender.sendMessage(tag.NAME + ":" + tag.VALUE); + if(desti != null) { + sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translateColor("command.createdesti.complete")); + sender.sendMessage(Lang.translateColor("command.create.tags")); + for (DataTag tag : desti.getArgs()) { + sender.sendMessage(tag.NAME + ":" + tag.VALUE); + } } } catch (PortalException portalTagExeption) { sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translateColor("command.createdesti.error") + " " diff --git a/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java b/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java index 07d8d1b5..af3a023c 100644 --- a/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java +++ b/src/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java @@ -26,10 +26,12 @@ public class CreatePortalSubCommand extends CreateSubCommand implements SubComma ArrayList portalTags = this.getTagsFromArgs(args); try { AdvancedPortal portal = AdvancedPortalsCore.getPortalManager().createPortal(args[1], player, portalTags); - sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translateColor("command.create.complete")); - sender.sendMessage(Lang.translateColor("command.create.tags")); - for (DataTag tag: portal.getArgs()) { - sender.sendMessage(tag.NAME + ":" + tag.VALUE); + if(portal != null) { + sender.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translateColor("command.create.complete")); + sender.sendMessage(Lang.translateColor("command.create.tags")); + for (DataTag tag: portal.getArgs()) { + sender.sendMessage(tag.NAME + ":" + tag.VALUE); + } } } catch (PortalException portalTagExeption) { sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translateColor("command.create.error") + " "