diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java index e4899b96..cfb7a86e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -28,6 +28,7 @@ import org.bukkit.Location; import org.bukkit.World.Environment; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.Event.Priority; @@ -35,7 +36,6 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.config.Configuration; -import javax.persistence.EntityNotFoundException; import java.io.*; import java.util.ArrayList; import java.util.Arrays; @@ -121,7 +121,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { debugLog = new DebugLog("Multiverse-Core", getDataFolder() + File.separator + "debug.log"); } - public Configuration getConfig() { + public Configuration getMVConfig() { return this.configMV; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java index 384ccd85..9fbb2190 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java @@ -25,7 +25,7 @@ public interface Core { * * @return The Multiverse config file. */ - public Configuration getConfig(); + public Configuration getMVConfig(); /** * Gets the Banking system that Multiverse-Core has hooked into. diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java index 4b50a64c..c06bed1e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java @@ -39,7 +39,7 @@ public class ConfigCommand extends MultiverseCommand { public void runCommand(CommandSender sender, List args) { if (args.get(0).equalsIgnoreCase("messagecooldown") || args.get(0).equalsIgnoreCase("teleportcooldown") || args.get(0).equalsIgnoreCase("debug")) { try { - this.plugin.getConfig().setProperty(args.get(0).toLowerCase(), Integer.parseInt(args.get(1))); + this.plugin.getMVConfig().setProperty(args.get(0).toLowerCase(), Integer.parseInt(args.get(1))); this.plugin.loadConfigs(); } catch (NumberFormatException e) { sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA + args.get(0) + ChatColor.WHITE + " must be an integer!"); @@ -47,7 +47,7 @@ public class ConfigCommand extends MultiverseCommand { } else { if (ConfigProperty.valueOf(args.get(0).toLowerCase()) != null) { try { - this.plugin.getConfig().setProperty(args.get(0).toLowerCase(), Boolean.parseBoolean(args.get(0))); + this.plugin.getMVConfig().setProperty(args.get(0).toLowerCase(), Boolean.parseBoolean(args.get(0))); this.plugin.loadConfigs(); } catch (Exception e) { sender.sendMessage(ChatColor.RED + "Sorry, " + ChatColor.AQUA + args.get(0) + ChatColor.WHITE + " must be true or false!"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java index 5b38e2a3..0687c662 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java @@ -54,13 +54,13 @@ public class VersionCommand extends MultiverseCommand { logAndAddToPasteBinBuffer("Multiverse Plugins Loaded: " + this.plugin.getPluginCount()); logAndAddToPasteBinBuffer("Economy being used: " + this.plugin.getBank().getEconUsed()); logAndAddToPasteBinBuffer("Permissions Plugin: " + this.plugin.getMVPerms().getType()); - logAndAddToPasteBinBuffer("Dumping Config Values: (version " + this.plugin.getConfig().getString("version", "NOT SET") + ")"); - logAndAddToPasteBinBuffer("messagecooldown: " + this.plugin.getConfig().getString("messagecooldown", "NOT SET")); - logAndAddToPasteBinBuffer("teleportcooldown: " + this.plugin.getConfig().getString("teleportcooldown", "NOT SET")); - logAndAddToPasteBinBuffer("worldnameprefix: " + this.plugin.getConfig().getString("worldnameprefix", "NOT SET")); - logAndAddToPasteBinBuffer("opfallback: " + this.plugin.getConfig().getString("opfallback", "NOT SET")); - logAndAddToPasteBinBuffer("disableautoheal: " + this.plugin.getConfig().getString("disableautoheal", "NOT SET")); - logAndAddToPasteBinBuffer("fakepvp: " + this.plugin.getConfig().getString("fakepvp", "NOT SET")); + logAndAddToPasteBinBuffer("Dumping Config Values: (version " + this.plugin.getMVConfig().getString("version", "NOT SET") + ")"); + logAndAddToPasteBinBuffer("messagecooldown: " + this.plugin.getMVConfig().getString("messagecooldown", "NOT SET")); + logAndAddToPasteBinBuffer("teleportcooldown: " + this.plugin.getMVConfig().getString("teleportcooldown", "NOT SET")); + logAndAddToPasteBinBuffer("worldnameprefix: " + this.plugin.getMVConfig().getString("worldnameprefix", "NOT SET")); + logAndAddToPasteBinBuffer("opfallback: " + this.plugin.getMVConfig().getString("opfallback", "NOT SET")); + logAndAddToPasteBinBuffer("disableautoheal: " + this.plugin.getMVConfig().getString("disableautoheal", "NOT SET")); + logAndAddToPasteBinBuffer("fakepvp: " + this.plugin.getMVConfig().getString("fakepvp", "NOT SET")); logAndAddToPasteBinBuffer("Special Code: FRN001"); MVVersionRequestEvent versionEvent = new MVVersionRequestEvent(pasteBinBuffer); diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java index 53b9db39..58ad2466 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java @@ -82,7 +82,7 @@ public class MVEntityListener extends EntityListener { MultiverseWorld world = this.worldManager.getMVWorld(w.getName()); if (attacker instanceof Player) { - if (!world.isPVPEnabled() && this.plugin.getConfig().getBoolean("fakepvp", false)) { + if (!world.isPVPEnabled() && this.plugin.getMVConfig().getBoolean("fakepvp", false)) { ((Player) attacker).sendMessage(ChatColor.RED + "PVP is disabled in this World."); event.setCancelled(true); } @@ -96,7 +96,7 @@ public class MVEntityListener extends EntityListener { return; } RegainReason reason = event.getRegainReason(); - if (reason == RegainReason.REGEN && this.plugin.getConfig().getBoolean("disableautoheal", false)) { + if (reason == RegainReason.REGEN && this.plugin.getMVConfig().getBoolean("disableautoheal", false)) { event.setCancelled(true); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 269489da..e4739fcf 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -38,8 +38,8 @@ public class MVPlayerListener extends PlayerListener { return; } // Check whether the Server is set to prefix the chat with the World name. If not we do nothing, if so we need to check if the World has an Alias. - if (this.plugin.getConfig().getBoolean("worldnameprefix", true)) { - this.plugin.getConfig().save(); + if (this.plugin.getMVConfig().getBoolean("worldnameprefix", true)) { + this.plugin.getMVConfig().save(); String world = event.getPlayer().getWorld().getName(); String prefix = ""; // If we're not a MV world, don't do anything @@ -62,7 +62,7 @@ public class MVPlayerListener extends PlayerListener { return; } - if (event.isBedSpawn() && this.plugin.getConfig().getBoolean("bedrespawn", true)) { + if (event.isBedSpawn() && this.plugin.getMVConfig().getBoolean("bedrespawn", true)) { this.plugin.log(Level.FINE, "Spawning " + event.getPlayer().getName() + " at their bed"); return; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java b/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java index 7c83593d..f0310ab2 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java @@ -16,7 +16,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; -import sun.security.util.Debug; import java.util.List; import java.util.logging.Level;