From 319a701a166e23c7c3f7fdd5d319c986e346ac98 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Tue, 14 Aug 2012 15:00:08 -0400 Subject: [PATCH] Modifying world values now persists again! (When the hell did this break???) --- .../onarandombox/MultiverseCore/commands/ModifyAddCommand.java | 3 +++ .../MultiverseCore/commands/ModifyClearCommand.java | 3 +++ .../MultiverseCore/commands/ModifyRemoveCommand.java | 3 +++ .../onarandombox/MultiverseCore/commands/ModifySetCommand.java | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java index 40425de4..e7526118 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java @@ -85,6 +85,9 @@ public class ModifyAddCommand extends MultiverseCommand { if (world.addToVariable(property, value)) { sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.GREEN + "added to " + ChatColor.GREEN + property); + if (!plugin.saveWorldConfig()) { + sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!"); + } } else { sender.sendMessage(value + " could not be added to " + property); } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java index d30b66f8..6f153834 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java @@ -80,6 +80,9 @@ public class ModifyClearCommand extends MultiverseCommand { sender.sendMessage(property + " was cleared. It contains 0 values now."); sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + property + ChatColor.WHITE + " was " + ChatColor.GREEN + "CLEARED" + ChatColor.WHITE + ". It contains " + ChatColor.LIGHT_PURPLE + "0" + ChatColor.WHITE + " values now."); + if (!plugin.saveWorldConfig()) { + sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!"); + } } else { sender.sendMessage(ChatColor.RED + "Error: " + ChatColor.GOLD + property + ChatColor.WHITE + " was " + ChatColor.GOLD + "NOT" + ChatColor.WHITE + " cleared."); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java index f61efeff..c60d733f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java @@ -85,6 +85,9 @@ public class ModifyRemoveCommand extends MultiverseCommand { if (world.removeFromVariable(property, value)) { sender.sendMessage(ChatColor.GREEN + "Success! " + ChatColor.AQUA + value + ChatColor.WHITE + " was " + ChatColor.RED + "removed from " + ChatColor.GREEN + property); + if (!plugin.saveWorldConfig()) { + sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!"); + } } else { sender.sendMessage(ChatColor.RED + "There was an error removing " + ChatColor.GRAY + value + ChatColor.WHITE + " from " + ChatColor.GOLD + property); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java index 5df8b93e..54bf8a11 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java @@ -111,6 +111,9 @@ public class ModifySetCommand extends MultiverseCommand { if (world.setPropertyValue(property, value)) { sender.sendMessage(ChatColor.GREEN + "Success!" + ChatColor.WHITE + " Property " + ChatColor.AQUA + property + ChatColor.WHITE + " was set to " + ChatColor.GREEN + value); + if (!plugin.saveWorldConfig()) { + sender.sendMessage(ChatColor.RED + "There was an issue saving worlds.yml! Your changes will only be temporary!"); + } } else { sender.sendMessage(ChatColor.RED + world.getPropertyHelp(property)); }