diff --git a/src/org/mcteam/ancientgates/Gate.java b/src/org/mcteam/ancientgates/Gate.java index b9f87b6..aea1b16 100644 --- a/src/org/mcteam/ancientgates/Gate.java +++ b/src/org/mcteam/ancientgates/Gate.java @@ -274,6 +274,7 @@ public class Gate try { DiscUtil.write(file, Plugin.gson.toJson(instances)); + Plugin.log("Saved gates to disk"); } catch (IOException e) { @@ -288,6 +289,7 @@ public class Gate return false; } + return true; } diff --git a/src/org/mcteam/ancientgates/commands/CommandClose.java b/src/org/mcteam/ancientgates/commands/CommandClose.java index 5ae67d7..dd6aa62 100644 --- a/src/org/mcteam/ancientgates/commands/CommandClose.java +++ b/src/org/mcteam/ancientgates/commands/CommandClose.java @@ -1,5 +1,7 @@ package org.mcteam.ancientgates.commands; +import org.mcteam.ancientgates.Gate; + public class CommandClose extends BaseCommand { public CommandClose() { @@ -12,7 +14,10 @@ public class CommandClose extends BaseCommand { public void perform() { gate.close(); + sendMessage("The gate was closed."); + + Gate.save(); } } diff --git a/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java b/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java index fbc7ebc..0b0fbbf 100644 --- a/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java +++ b/src/org/mcteam/ancientgates/commands/CommandCreateSetFrom.java @@ -36,7 +36,6 @@ public class CommandCreateSetFrom extends BaseCommand } Gate.create(id); - Gate.save(); sendMessage("Gate with id \"" + id + "\" was created."); gate = Gate.get(id); @@ -76,5 +75,7 @@ public class CommandCreateSetFrom extends BaseCommand sendMessage("From location for gate \""+gate.getId()+"\" is now where you stand."); sendMessage("Your gate includes " + gateBlocks.size() + " Blocks."); + + Gate.save(); } } diff --git a/src/org/mcteam/ancientgates/commands/CommandHide.java b/src/org/mcteam/ancientgates/commands/CommandHide.java index 52a17ef..b5e7b02 100644 --- a/src/org/mcteam/ancientgates/commands/CommandHide.java +++ b/src/org/mcteam/ancientgates/commands/CommandHide.java @@ -1,5 +1,7 @@ package org.mcteam.ancientgates.commands; +import org.mcteam.ancientgates.Gate; + public class CommandHide extends BaseCommand { @@ -16,5 +18,7 @@ public class CommandHide extends BaseCommand { gate.setHidden(true); sendMessage("The gate " + gate.getId() + " is now hidden."); + + Gate.save(); } } \ No newline at end of file diff --git a/src/org/mcteam/ancientgates/commands/CommandInfo.java b/src/org/mcteam/ancientgates/commands/CommandInfo.java index 61febad..101934c 100644 --- a/src/org/mcteam/ancientgates/commands/CommandInfo.java +++ b/src/org/mcteam/ancientgates/commands/CommandInfo.java @@ -1,6 +1,7 @@ package org.mcteam.ancientgates.commands; import org.bukkit.ChatColor; +import org.mcteam.ancientgates.Gate; public class CommandInfo extends BaseCommand @@ -44,5 +45,7 @@ public class CommandInfo extends BaseCommand else sendMessage(ChatColor.GREEN + "this gate has no 'to' location"); + + Gate.save(); } } diff --git a/src/org/mcteam/ancientgates/commands/CommandList.java b/src/org/mcteam/ancientgates/commands/CommandList.java index 3c663d1..9be9974 100644 --- a/src/org/mcteam/ancientgates/commands/CommandList.java +++ b/src/org/mcteam/ancientgates/commands/CommandList.java @@ -210,6 +210,8 @@ public class CommandList extends BaseCommand else sendMessage(messages); } + + Gate.save(); } } diff --git a/src/org/mcteam/ancientgates/commands/CommandOpen.java b/src/org/mcteam/ancientgates/commands/CommandOpen.java index e16ca77..f45bb46 100644 --- a/src/org/mcteam/ancientgates/commands/CommandOpen.java +++ b/src/org/mcteam/ancientgates/commands/CommandOpen.java @@ -1,6 +1,7 @@ package org.mcteam.ancientgates.commands; import org.bukkit.Material; +import org.mcteam.ancientgates.Gate; public class CommandOpen extends BaseCommand { @@ -35,6 +36,8 @@ public class CommandOpen extends BaseCommand { sendMessage("Failed to open the gate. Have you built a frame?"); sendMessage("More info here: " + new CommandHelp().getUsageTemplate(true, true)); } + + Gate.save(); } } diff --git a/src/org/mcteam/ancientgates/commands/CommandRename.java b/src/org/mcteam/ancientgates/commands/CommandRename.java index 53a58f1..ba9bb78 100644 --- a/src/org/mcteam/ancientgates/commands/CommandRename.java +++ b/src/org/mcteam/ancientgates/commands/CommandRename.java @@ -36,5 +36,7 @@ public class CommandRename extends BaseCommand Gate.rename(gate, newId); sendMessage("Gate " + oldId + " is now known as " + newId + "."); + + Gate.save(); } } diff --git a/src/org/mcteam/ancientgates/commands/CommandUnhide.java b/src/org/mcteam/ancientgates/commands/CommandUnhide.java index dfc8a12..d78ecc1 100644 --- a/src/org/mcteam/ancientgates/commands/CommandUnhide.java +++ b/src/org/mcteam/ancientgates/commands/CommandUnhide.java @@ -1,5 +1,7 @@ package org.mcteam.ancientgates.commands; +import org.mcteam.ancientgates.Gate; + public class CommandUnhide extends BaseCommand { @@ -18,5 +20,7 @@ public class CommandUnhide extends BaseCommand sendMessage("The gate " + gate.getId() + " is no longer hidden."); else sendMessage("Failed to unhide the gate. Does the portal have a frame?"); + + Gate.save(); } } \ No newline at end of file