diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVReload.java b/src/com/onarandombox/MultiVerseCore/commands/MVReload.java deleted file mode 100644 index 2d83a03a..00000000 --- a/src/com/onarandombox/MultiVerseCore/commands/MVReload.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.onarandombox.MultiVerseCore.commands; - -import org.bukkit.command.CommandSender; - -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; - -public class MVReload extends MVCommandHandler { - - public MVReload(MultiVerseCore plugin) { - super(plugin); - } - - @Override - public boolean perform(CommandSender sender, String[] args) { - // TODO: Implement Permissions - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "Reloading MultiVerse"); - plugin.loadConfigs(); - plugin.loadWorlds(); - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "Reload Complete!"); - return true; - } - -} diff --git a/src/com/onarandombox/MultiVerseCore/MVBlockListener.java b/src/com/onarandombox/MultiverseCore/MVBlockListener.java similarity index 84% rename from src/com/onarandombox/MultiVerseCore/MVBlockListener.java rename to src/com/onarandombox/MultiverseCore/MVBlockListener.java index 02481328..283f99d5 100644 --- a/src/com/onarandombox/MultiVerseCore/MVBlockListener.java +++ b/src/com/onarandombox/MultiverseCore/MVBlockListener.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockListener; @@ -9,9 +9,9 @@ import org.bukkit.event.block.BlockPlaceEvent; public class MVBlockListener extends BlockListener { - MultiVerseCore plugin; + MultiverseCore plugin; - public MVBlockListener(MultiVerseCore plugin) { + public MVBlockListener(MultiverseCore plugin) { this.plugin = plugin; } diff --git a/src/com/onarandombox/MultiVerseCore/MVCommandHandler.java b/src/com/onarandombox/MultiverseCore/MVCommandHandler.java similarity index 56% rename from src/com/onarandombox/MultiVerseCore/MVCommandHandler.java rename to src/com/onarandombox/MultiverseCore/MVCommandHandler.java index 0f01c886..e71ad354 100644 --- a/src/com/onarandombox/MultiVerseCore/MVCommandHandler.java +++ b/src/com/onarandombox/MultiverseCore/MVCommandHandler.java @@ -1,12 +1,12 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import org.bukkit.command.CommandSender; public abstract class MVCommandHandler { - protected final MultiVerseCore plugin; + protected final MultiverseCore plugin; - public MVCommandHandler(MultiVerseCore plugin) { + public MVCommandHandler(MultiverseCore plugin) { this.plugin = plugin; } diff --git a/src/com/onarandombox/MultiVerseCore/MVEntityListener.java b/src/com/onarandombox/MultiverseCore/MVEntityListener.java similarity index 93% rename from src/com/onarandombox/MultiVerseCore/MVEntityListener.java rename to src/com/onarandombox/MultiverseCore/MVEntityListener.java index 34319446..e17fabfb 100644 --- a/src/com/onarandombox/MultiVerseCore/MVEntityListener.java +++ b/src/com/onarandombox/MultiverseCore/MVEntityListener.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import java.util.List; @@ -23,9 +23,9 @@ import org.bukkit.event.entity.EntityListener; public class MVEntityListener extends EntityListener { - MultiVerseCore plugin; + MultiverseCore plugin; - public MVEntityListener(MultiVerseCore plugin) { + public MVEntityListener(MultiverseCore plugin) { this.plugin = plugin; } @@ -53,7 +53,7 @@ public class MVEntityListener extends EntityListener { Entity defender = event.getEntity(); World w = defender.getWorld(); - if (!(MultiVerseCore.configWorlds.getBoolean("worlds." + w.getName() + ".enablehealth", true))) { + if (!(MultiverseCore.configWorlds.getBoolean("worlds." + w.getName() + ".enablehealth", true))) { event.setCancelled(true); return; } @@ -153,7 +153,7 @@ public class MVEntityListener extends EntityListener { int count = 0; for (Entity entity : entities) { if (entity instanceof Ghast) { - if (count >= MultiVerseCore.configMV.getInt("ghastlimit", 50)) { + if (count >= MultiverseCore.configMV.getInt("ghastlimit", 50)) { event.setCancelled(true); return; } diff --git a/src/com/onarandombox/MultiVerseCore/MVPermissions.java b/src/com/onarandombox/MultiverseCore/MVPermissions.java similarity index 86% rename from src/com/onarandombox/MultiVerseCore/MVPermissions.java rename to src/com/onarandombox/MultiverseCore/MVPermissions.java index 58eb0a2d..837b2f6d 100644 --- a/src/com/onarandombox/MultiVerseCore/MVPermissions.java +++ b/src/com/onarandombox/MultiverseCore/MVPermissions.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import java.util.List; @@ -7,13 +7,13 @@ import org.bukkit.entity.Player; public class MVPermissions { - private MultiVerseCore plugin; + private MultiverseCore plugin; /** * Constructor FTW * @param plugin Pass along the Core Plugin. */ - public MVPermissions(MultiVerseCore plugin) { + public MVPermissions(MultiverseCore plugin) { this.plugin = plugin; } @@ -27,8 +27,8 @@ public class MVPermissions { public boolean has(Player p, String node) { boolean result = false; - if (MultiVerseCore.Permissions != null) { - result = MultiVerseCore.Permissions.has(p, node); + if (MultiverseCore.Permissions != null) { + result = MultiverseCore.Permissions.has(p, node); } else if (p.isOp()) { result = true; } @@ -72,8 +72,8 @@ public class MVPermissions { public Boolean canEnterWorld(Player p, World w) { String group = ""; - if (MultiVerseCore.Permissions != null) { - group = MultiVerseCore.Permissions.getGroup(p.getName(), p.getWorld().getName()); + if (MultiverseCore.Permissions != null) { + group = MultiverseCore.Permissions.getGroup(p.getName(), p.getWorld().getName()); } List whiteList = this.plugin.worlds.get(w.getName()).joinWhitelist; diff --git a/src/com/onarandombox/MultiVerseCore/MVPlayerListener.java b/src/com/onarandombox/MultiverseCore/MVPlayerListener.java similarity index 90% rename from src/com/onarandombox/MultiVerseCore/MVPlayerListener.java rename to src/com/onarandombox/MultiverseCore/MVPlayerListener.java index 9eda4d45..cfda4d5d 100644 --- a/src/com/onarandombox/MultiVerseCore/MVPlayerListener.java +++ b/src/com/onarandombox/MultiverseCore/MVPlayerListener.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -10,9 +10,9 @@ import org.bukkit.event.player.PlayerRespawnEvent; public class MVPlayerListener extends PlayerListener { - MultiVerseCore plugin; + MultiverseCore plugin; - public MVPlayerListener(MultiVerseCore plugin) { + public MVPlayerListener(MultiverseCore plugin) { this.plugin = plugin; } diff --git a/src/com/onarandombox/MultiVerseCore/MVPlayerSession.java b/src/com/onarandombox/MultiverseCore/MVPlayerSession.java similarity index 93% rename from src/com/onarandombox/MultiVerseCore/MVPlayerSession.java rename to src/com/onarandombox/MultiverseCore/MVPlayerSession.java index 94ba62f6..492059ea 100644 --- a/src/com/onarandombox/MultiVerseCore/MVPlayerSession.java +++ b/src/com/onarandombox/MultiverseCore/MVPlayerSession.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import java.util.Date; @@ -21,7 +21,7 @@ public class MVPlayerSession { private Configuration config; // Configuration file to find out Cooldown Timers. - public MVPlayerSession(Player player, Configuration config, MultiVerseCore multiVerseCore) { + public MVPlayerSession(Player player, Configuration config, MultiverseCore multiVerseCore) { this.player = player; this.loc = player.getLocation(); this.config = config; diff --git a/src/com/onarandombox/MultiVerseCore/MVPluginListener.java b/src/com/onarandombox/MultiverseCore/MVPluginListener.java similarity index 62% rename from src/com/onarandombox/MultiVerseCore/MVPluginListener.java rename to src/com/onarandombox/MultiverseCore/MVPluginListener.java index 14a09111..7bb9c55d 100644 --- a/src/com/onarandombox/MultiVerseCore/MVPluginListener.java +++ b/src/com/onarandombox/MultiverseCore/MVPluginListener.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import org.bukkit.event.server.PluginEvent; import org.bukkit.event.server.ServerListener; @@ -9,9 +9,9 @@ import com.nijikokun.bukkit.Permissions.Permissions; public class MVPluginListener extends ServerListener { - MultiVerseCore plugin; + MultiverseCore plugin; - public MVPluginListener(MultiVerseCore plugin) { + public MVPluginListener(MultiverseCore plugin) { this.plugin = plugin; } @@ -24,20 +24,20 @@ public class MVPluginListener extends ServerListener { * Check to see if Permissions was just enabled, we only wan't to perform the following if GroupManager is not found. */ if (event.getPlugin().getDescription().getName().equals("Permissions")) { - MultiVerseCore.Permissions = ((Permissions) plugin.getServer().getPluginManager().getPlugin("Permissions")).getHandler(); - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "- Found Permissions"); + MultiverseCore.Permissions = ((Permissions) plugin.getServer().getPluginManager().getPlugin("Permissions")).getHandler(); + //MultiverseCore.log.info(MultiverseCore.logPrefix + "- Found Permissions"); } /** * Use the METHOD supplied by iConomy to register it etc... */ - if (MultiVerseCore.getiConomy() == null) { + if (MultiverseCore.getiConomy() == null) { Plugin iConomy = plugin.getServer().getPluginManager().getPlugin("iConomy"); if (iConomy != null) { if (iConomy.isEnabled()) { - MultiVerseCore.iConomy = (iConomy) iConomy; - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "- Found iConomy"); + MultiverseCore.iConomy = (iConomy) iConomy; + //MultiverseCore.log.info(MultiverseCore.logPrefix + "- Found iConomy"); } } } @@ -51,16 +51,16 @@ public class MVPluginListener extends ServerListener { * Check to see if Permissions just disabled. */ if (event.getPlugin().getDescription().getName().equals("Permissions")) { - MultiVerseCore.Permissions = null; - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "- Permissions has been Disabled"); + MultiverseCore.Permissions = null; + //MultiverseCore.log.info(MultiverseCore.logPrefix + "- Permissions has been Disabled"); } /** * Check to see if iConomy just disabled. */ - if (MultiVerseCore.getiConomy() != null) { - MultiVerseCore.iConomy = null; - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "- iConom has been Disabled"); + if (MultiverseCore.getiConomy() != null) { + MultiverseCore.iConomy = null; + //MultiverseCore.log.info(MultiverseCore.logPrefix + "- iConom has been Disabled"); } } diff --git a/src/com/onarandombox/MultiVerseCore/MVTeleport.java b/src/com/onarandombox/MultiverseCore/MVTeleport.java similarity index 89% rename from src/com/onarandombox/MultiVerseCore/MVTeleport.java rename to src/com/onarandombox/MultiverseCore/MVTeleport.java index fab8c351..9ab30ebf 100644 --- a/src/com/onarandombox/MultiVerseCore/MVTeleport.java +++ b/src/com/onarandombox/MultiverseCore/MVTeleport.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import java.util.ArrayList; @@ -12,11 +12,11 @@ import com.onarandombox.utils.BlockSafety; public class MVTeleport { - MultiVerseCore plugin; + MultiverseCore plugin; BlockSafety bs = new BlockSafety(); - public MVTeleport(MultiVerseCore plugin) { + public MVTeleport(MultiverseCore plugin) { this.plugin = plugin; } @@ -39,7 +39,7 @@ public class MVTeleport { double srcComp = plugin.worlds.get(l.getWorld().getName()).compression; double trgComp = plugin.worlds.get(w.getName()).compression; - MultiVerseCore.debugMsg(p.getName() + " -> " + p.getWorld().getName() + "(" + srcComp + ") -> " + w.getName() + "(" + trgComp + ")"); + //MultiverseCore.debugMsg(p.getName() + " -> " + p.getWorld().getName() + "(" + srcComp + ") -> " + w.getName() + "(" + trgComp + ")"); // If the Targets Compression is 0 then we teleport them to the Spawn of the World. if (trgComp == 0.0) { @@ -105,11 +105,11 @@ public class MVTeleport { } if (aux == -1) { - MultiVerseCore.debugMsg("Uh oh, no safe location."); + //MultiverseCore.debugMsg("Uh oh, no safe location."); return null; } - MultiVerseCore.debugMsg("Target location (safe): " + x + ", " + aux + ", " + z); + //MultiverseCore.debugMsg("Target location (safe): " + x + ", " + aux + ", " + z); return new Location(w, x, aux, z); } diff --git a/src/com/onarandombox/MultiVerseCore/MVWorld.java b/src/com/onarandombox/MultiverseCore/MVWorld.java similarity index 93% rename from src/com/onarandombox/MultiVerseCore/MVWorld.java rename to src/com/onarandombox/MultiverseCore/MVWorld.java index 9516ee07..66929602 100644 --- a/src/com/onarandombox/MultiVerseCore/MVWorld.java +++ b/src/com/onarandombox/MultiverseCore/MVWorld.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import java.util.ArrayList; import java.util.List; @@ -10,7 +10,7 @@ import org.bukkit.util.config.Configuration; @SuppressWarnings("unused") public class MVWorld { - private MultiVerseCore plugin; // Hold the Plugin Instance. + private MultiverseCore plugin; // Hold the Plugin Instance. private Configuration config; // Hold the Configuration File. public World world; // The World Instance. @@ -36,7 +36,7 @@ public class MVWorld { public Double compression; // How stretched/compressed distances are - public MVWorld(World world, Configuration config, MultiVerseCore instance) { + public MVWorld(World world, Configuration config, MultiverseCore instance) { this.config = config; this.plugin = instance; diff --git a/src/com/onarandombox/MultiVerseCore/MultiVerseCore.java b/src/com/onarandombox/MultiverseCore/MultiverseCore.java similarity index 78% rename from src/com/onarandombox/MultiVerseCore/MultiVerseCore.java rename to src/com/onarandombox/MultiverseCore/MultiverseCore.java index f1598c45..769f21c7 100644 --- a/src/com/onarandombox/MultiVerseCore/MultiVerseCore.java +++ b/src/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore; +package com.onarandombox.MultiverseCore; import java.io.File; import java.util.ArrayList; @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Server; @@ -25,30 +26,34 @@ import org.bukkit.util.config.Configuration; import com.nijiko.coelho.iConomy.iConomy; import com.nijiko.permissions.PermissionHandler; import com.nijikokun.bukkit.Permissions.Permissions; -import com.onarandombox.MultiVerseCore.commands.MVCoord; -import com.onarandombox.MultiVerseCore.commands.MVCreate; -import com.onarandombox.MultiVerseCore.commands.MVImport; -import com.onarandombox.MultiVerseCore.commands.MVList; -import com.onarandombox.MultiVerseCore.commands.MVModify; -import com.onarandombox.MultiVerseCore.commands.MVReload; -import com.onarandombox.MultiVerseCore.commands.MVRemove; -import com.onarandombox.MultiVerseCore.commands.MVSetSpawn; -import com.onarandombox.MultiVerseCore.commands.MVSpawn; -import com.onarandombox.MultiVerseCore.commands.MVTP; -import com.onarandombox.MultiVerseCore.commands.MVWho; -import com.onarandombox.MultiVerseCore.configuration.DefaultConfiguration; +import com.onarandombox.MultiverseCore.commands.MVCoord; +import com.onarandombox.MultiverseCore.commands.MVCreate; +import com.onarandombox.MultiverseCore.commands.MVImport; +import com.onarandombox.MultiverseCore.commands.MVList; +import com.onarandombox.MultiverseCore.commands.MVModify; +import com.onarandombox.MultiverseCore.commands.MVReload; +import com.onarandombox.MultiverseCore.commands.MVRemove; +import com.onarandombox.MultiverseCore.commands.MVSetSpawn; +import com.onarandombox.MultiverseCore.commands.MVSpawn; +import com.onarandombox.MultiverseCore.commands.MVTP; +import com.onarandombox.MultiverseCore.commands.MVWho; +import com.onarandombox.MultiverseCore.configuration.DefaultConfiguration; +import com.onarandombox.utils.DebugLog; +import com.onarandombox.utils.Messaging; import com.onarandombox.utils.UpdateChecker; -public class MultiVerseCore extends JavaPlugin { +public class MultiverseCore extends JavaPlugin { // Setup our Map for our Commands using the CommandHandler. private Map commands = new HashMap(); // Variable to state whether we are displaying Debug Messages or not. public static boolean debug = true; - + // Useless stuff to keep us going. - public static final Logger log = Logger.getLogger("Minecraft"); + private static final Logger log = Logger.getLogger("Minecraft"); + private static DebugLog debugLog; + public static final String logPrefix = "[MultiVerse-Core] "; public static Plugin instance; public static Server server; @@ -56,8 +61,11 @@ public class MultiVerseCore extends JavaPlugin { // Setup a variable to hold our DataFolder which will house everything to do with MultiVerse // Using this instead of getDataFolder(), allows all modules to use the same direectory. - public static final File dataFolder = new File("plugins" + File.separator + "MultiVerse"); + public static final File dataFolder = new File("plugins" + File.separator + "Multiverse"); + // Messaging + private Messaging messaging = new Messaging(); + // MultiVerse Permissions Handler public MVPermissions ph = new MVPermissions(this); @@ -86,11 +94,10 @@ public class MultiVerseCore extends JavaPlugin { // HashMap to contain information relating to the Players. public HashMap playerSessions = new HashMap(); - /** - * Constructor... Perform the Necessary tasks here. - */ - public MultiVerseCore() { - + @Override + public void onLoad() { + dataFolder.mkdirs(); + debugLog = new DebugLog("Multiverse", dataFolder + File.separator + "debug.log"); } /** @@ -121,7 +128,7 @@ public class MultiVerseCore extends JavaPlugin { setupCommands(); // Start the Update Checker - updateCheck = new UpdateChecker(this.getDescription().getName(), this.getDescription().getVersion()); + //updateCheck = new UpdateChecker(this.getDescription().getName(), this.getDescription().getVersion()); } /** @@ -153,10 +160,10 @@ public class MultiVerseCore extends JavaPlugin { private void setupPermissions() { Plugin p = this.getServer().getPluginManager().getPlugin("Permissions"); - if (MultiVerseCore.Permissions == null) { + if (MultiverseCore.Permissions == null) { if (p != null && p.isEnabled()) { - MultiVerseCore.Permissions = ((Permissions) p).getHandler(); - MultiVerseCore.log.info(logPrefix + "- Attached to Permissions"); + MultiverseCore.Permissions = ((Permissions) p).getHandler(); + MultiverseCore.log.info(logPrefix + "- Attached to Permissions"); } } } @@ -167,9 +174,9 @@ public class MultiVerseCore extends JavaPlugin { private void setupiConomy() { Plugin test = this.getServer().getPluginManager().getPlugin("iConomy"); - if (MultiVerseCore.iConomy == null) { + if (MultiverseCore.iConomy == null) { if (test != null) { - MultiVerseCore.iConomy = (iConomy) test; + MultiverseCore.iConomy = (iConomy) test; } } } @@ -191,18 +198,18 @@ public class MultiVerseCore extends JavaPlugin { configMV.load(); log.info(logPrefix + "- MultiVerse Config -- Loaded"); } catch (Exception e) { - log.info(MultiVerseCore.logPrefix + "- Failed to load config.yml"); + log.info(MultiverseCore.logPrefix + "- Failed to load config.yml"); } try { configWorlds.load(); log.info(logPrefix + "- World Config -- Loaded"); } catch (Exception e) { - log.info(MultiVerseCore.logPrefix + "- Failed to load worlds.yml"); + log.info(MultiverseCore.logPrefix + "- Failed to load worlds.yml"); } // Setup the Debug option, we'll default to false because this option will not be in the default config. - MultiVerseCore.debug = configMV.getBoolean("debug", false); + MultiverseCore.debug = configMV.getBoolean("debug", false); } /** @@ -254,7 +261,7 @@ public class MultiVerseCore extends JavaPlugin { public void loadWorlds() { // Basic Counter to count how many Worlds we are loading. int count = 0; - List worldKeys = MultiVerseCore.configWorlds.getKeys("worlds"); // Grab all the Worlds from the Config. + List worldKeys = MultiverseCore.configWorlds.getKeys("worlds"); // Grab all the Worlds from the Config. if (worldKeys != null) { for (String worldKey : worldKeys) { @@ -263,7 +270,7 @@ public class MultiVerseCore extends JavaPlugin { continue; } - String wEnvironment = MultiVerseCore.configWorlds.getString("worlds." + worldKey + ".environment", "NORMAL"); // Grab the Environment as a String. + String wEnvironment = MultiverseCore.configWorlds.getString("worlds." + worldKey + ".environment", "NORMAL"); // Grab the Environment as a String. Environment env; if (wEnvironment.equalsIgnoreCase("NETHER")) // Check if the selected Environment is NETHER, otherwise we just default to NORMAL. @@ -275,7 +282,7 @@ public class MultiVerseCore extends JavaPlugin { World world = getServer().createWorld(worldKey, env); - worlds.put(worldKey, new MVWorld(world, MultiVerseCore.configWorlds, this)); // Place the World into the HashMap. + worlds.put(worldKey, new MVWorld(world, MultiverseCore.configWorlds, this)); // Place the World into the HashMap. count++; // Increment the World Count. } @@ -288,7 +295,7 @@ public class MultiVerseCore extends JavaPlugin { */ @Override public void onDisable() { - MultiVerseCore.Permissions = null; + MultiverseCore.Permissions = null; log.info(logPrefix + "- Disabled"); } @@ -301,7 +308,7 @@ public class MultiVerseCore extends JavaPlugin { if (playerSessions.containsKey(player.getName())) { return playerSessions.get(player.getName()); } else { - playerSessions.put(player.getName(), new MVPlayerSession(player, MultiVerseCore.configMV, this)); + playerSessions.put(player.getName(), new MVPlayerSession(player, MultiverseCore.configMV, this)); return playerSessions.get(player.getName()); } } @@ -329,13 +336,6 @@ public class MultiVerseCore extends JavaPlugin { return this.ph; } - /** - * This fires before plugins get Enabled... Not needed but saves Console Spam. - */ - @Override - public void onLoad() { - } - /** * onCommand */ @@ -356,19 +356,31 @@ public class MultiVerseCore extends JavaPlugin { } /** - * Basic Debug Output function, if we've enabled debugging we'll output more information. + * Print messages to the server Log as well as to our DebugLog. + * 'debugLog' is used to seperate Heroes information from the Servers Log Output. + * @param level + * @param msg */ - public static void debugMsg(String msg) { - debugMsg(msg, null); + public void log(Level level, String msg) { + log.log(level, "[Multiverse-Core] " + msg); + debugLog.log(level, "[Multiverse-Core] " + msg); } - public static void debugMsg(String msg, Player p) { - if (debug) { - log.info(msg); - if (p != null) { - p.sendMessage(msg); - } + /** + * Print messages to the Debug Log, if the servers in Debug Mode then we + * also wan't to print the messages to the standard Server Console. + * @param level + * @param msg + */ + public void debugLog(Level level, String msg) { + if (MultiverseCore.debug) { + log.log(level, "[Debug] " + msg); } + debugLog.log(level, "[Debug] " + msg); + } + + public Messaging getMessaging() { + return messaging; } /** diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVCoord.java b/src/com/onarandombox/MultiverseCore/commands/MVCoord.java similarity index 84% rename from src/com/onarandombox/MultiVerseCore/commands/MVCoord.java rename to src/com/onarandombox/MultiverseCore/commands/MVCoord.java index f3d10b94..21fbe1c0 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVCoord.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVCoord.java @@ -1,21 +1,20 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.utils.LocationManipulation; public class MVCoord extends MVCommandHandler { private LocationManipulation locMan = new LocationManipulation(); - public MVCoord(MultiVerseCore plugin) { + public MVCoord(MultiverseCore plugin) { super(plugin); - // TODO Auto-generated constructor stub } @Override diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVCreate.java b/src/com/onarandombox/MultiverseCore/commands/MVCreate.java similarity index 85% rename from src/com/onarandombox/MultiVerseCore/commands/MVCreate.java rename to src/com/onarandombox/MultiverseCore/commands/MVCreate.java index a174a74c..cca63374 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVCreate.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVCreate.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import java.io.File; @@ -6,12 +6,12 @@ import org.bukkit.ChatColor; import org.bukkit.World.Environment; import org.bukkit.command.CommandSender; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVCreate extends MVCommandHandler { - public MVCreate(MultiVerseCore plugin) { + public MVCreate(MultiverseCore plugin) { super(plugin); } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVImport.java b/src/com/onarandombox/MultiverseCore/commands/MVImport.java similarity index 58% rename from src/com/onarandombox/MultiVerseCore/commands/MVImport.java rename to src/com/onarandombox/MultiverseCore/commands/MVImport.java index a3ed5933..ee33955f 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVImport.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVImport.java @@ -1,13 +1,13 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.command.CommandSender; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVImport extends MVCommandHandler { - public MVImport(MultiVerseCore plugin) { + public MVImport(MultiverseCore plugin) { super(plugin); // TODO Auto-generated constructor stub } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVList.java b/src/com/onarandombox/MultiverseCore/commands/MVList.java similarity index 85% rename from src/com/onarandombox/MultiVerseCore/commands/MVList.java rename to src/com/onarandombox/MultiverseCore/commands/MVList.java index a1ffb0fb..3ea9514d 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVList.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVList.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.ChatColor; import org.bukkit.World; @@ -6,12 +6,12 @@ import org.bukkit.World.Environment; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVList extends MVCommandHandler { - public MVList(MultiVerseCore plugin) { + public MVList(MultiverseCore plugin) { super(plugin); } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVModify.java b/src/com/onarandombox/MultiverseCore/commands/MVModify.java similarity index 58% rename from src/com/onarandombox/MultiVerseCore/commands/MVModify.java rename to src/com/onarandombox/MultiverseCore/commands/MVModify.java index f11b68fb..b96fbb9d 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVModify.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVModify.java @@ -1,13 +1,13 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.command.CommandSender; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVModify extends MVCommandHandler { - public MVModify(MultiVerseCore plugin) { + public MVModify(MultiverseCore plugin) { super(plugin); // TODO Auto-generated constructor stub } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVPurge.java b/src/com/onarandombox/MultiverseCore/commands/MVPurge.java similarity index 78% rename from src/com/onarandombox/MultiVerseCore/commands/MVPurge.java rename to src/com/onarandombox/MultiverseCore/commands/MVPurge.java index 8282660e..c3721f97 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVPurge.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVPurge.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import java.util.ArrayList; import java.util.List; @@ -6,13 +6,13 @@ import java.util.List; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.utils.PurgeWorlds; public class MVPurge extends MVCommandHandler { - public MVPurge(MultiVerseCore plugin) { + public MVPurge(MultiverseCore plugin) { super(plugin); } diff --git a/src/com/onarandombox/MultiverseCore/commands/MVReload.java b/src/com/onarandombox/MultiverseCore/commands/MVReload.java new file mode 100644 index 00000000..0a24e244 --- /dev/null +++ b/src/com/onarandombox/MultiverseCore/commands/MVReload.java @@ -0,0 +1,26 @@ +package com.onarandombox.MultiverseCore.commands; + +import java.util.logging.Level; + +import org.bukkit.command.CommandSender; + +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; + +public class MVReload extends MVCommandHandler { + + public MVReload(MultiverseCore plugin) { + super(plugin); + } + + @Override + public boolean perform(CommandSender sender, String[] args) { + // TODO: Implement Permissions + plugin.log(Level.INFO, "Reloading Multiverse-Core config"); + plugin.loadConfigs(); + plugin.loadWorlds(); + plugin.log(Level.INFO, "Reload Complete!"); + return true; + } + +} diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVRemove.java b/src/com/onarandombox/MultiverseCore/commands/MVRemove.java similarity index 58% rename from src/com/onarandombox/MultiVerseCore/commands/MVRemove.java rename to src/com/onarandombox/MultiverseCore/commands/MVRemove.java index 52b235d0..2d3d3b31 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVRemove.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVRemove.java @@ -1,13 +1,13 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.command.CommandSender; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVRemove extends MVCommandHandler { - public MVRemove(MultiVerseCore plugin) { + public MVRemove(MultiverseCore plugin) { super(plugin); // TODO Auto-generated constructor stub } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVSetSpawn.java b/src/com/onarandombox/MultiverseCore/commands/MVSetSpawn.java similarity index 76% rename from src/com/onarandombox/MultiVerseCore/commands/MVSetSpawn.java rename to src/com/onarandombox/MultiverseCore/commands/MVSetSpawn.java index 381b09c4..30533565 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVSetSpawn.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVSetSpawn.java @@ -1,16 +1,16 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVSetSpawn extends MVCommandHandler { - public MVSetSpawn(MultiVerseCore plugin) { + public MVSetSpawn(MultiverseCore plugin) { super(plugin); } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVSpawn.java b/src/com/onarandombox/MultiverseCore/commands/MVSpawn.java similarity index 68% rename from src/com/onarandombox/MultiVerseCore/commands/MVSpawn.java rename to src/com/onarandombox/MultiverseCore/commands/MVSpawn.java index bd2e8f1c..ee0de1b4 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVSpawn.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVSpawn.java @@ -1,14 +1,14 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVSpawn extends MVCommandHandler { - public MVSpawn(MultiVerseCore plugin) { + public MVSpawn(MultiverseCore plugin) { super(plugin); } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVTP.java b/src/com/onarandombox/MultiverseCore/commands/MVTP.java similarity index 58% rename from src/com/onarandombox/MultiVerseCore/commands/MVTP.java rename to src/com/onarandombox/MultiverseCore/commands/MVTP.java index 326628be..4b049158 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVTP.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVTP.java @@ -1,13 +1,13 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import org.bukkit.command.CommandSender; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVTP extends MVCommandHandler { - public MVTP(MultiVerseCore plugin) { + public MVTP(MultiverseCore plugin) { super(plugin); // TODO Auto-generated constructor stub } diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVWho.java b/src/com/onarandombox/MultiverseCore/commands/MVWho.java similarity index 87% rename from src/com/onarandombox/MultiVerseCore/commands/MVWho.java rename to src/com/onarandombox/MultiverseCore/commands/MVWho.java index d4473303..e43d1c6c 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVWho.java +++ b/src/com/onarandombox/MultiverseCore/commands/MVWho.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore.commands; +package com.onarandombox.MultiverseCore.commands; import java.util.ArrayList; import java.util.List; @@ -9,12 +9,12 @@ import org.bukkit.World.Environment; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.onarandombox.MultiVerseCore.MVCommandHandler; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MVCommandHandler; +import com.onarandombox.MultiverseCore.MultiverseCore; public class MVWho extends MVCommandHandler { - public MVWho(MultiVerseCore plugin) { + public MVWho(MultiverseCore plugin) { super(plugin); } diff --git a/src/com/onarandombox/MultiVerseCore/configuration/DefaultConfiguration.java b/src/com/onarandombox/MultiverseCore/configuration/DefaultConfiguration.java similarity index 91% rename from src/com/onarandombox/MultiVerseCore/configuration/DefaultConfiguration.java rename to src/com/onarandombox/MultiverseCore/configuration/DefaultConfiguration.java index 5922cbb9..12c55fb9 100644 --- a/src/com/onarandombox/MultiVerseCore/configuration/DefaultConfiguration.java +++ b/src/com/onarandombox/MultiverseCore/configuration/DefaultConfiguration.java @@ -1,4 +1,4 @@ -package com.onarandombox.MultiVerseCore.configuration; +package com.onarandombox.MultiverseCore.configuration; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -10,7 +10,7 @@ import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MultiverseCore; /** * https://github.com/Nijikokun/iConomy3/blob/master/com/nijiko/coelho/iConomy/iConomy.java @@ -39,7 +39,7 @@ public class DefaultConfiguration { output.write(buf, 0, length); } - MultiVerseCore.log.info(MultiVerseCore.logPrefix + "Default config file written: " + name); + //MultiverseCore.log.info(MultiverseCore.logPrefix + "Default config file written: " + name); } catch (Exception e) { e.printStackTrace(); } finally { diff --git a/src/com/onarandombox/utils/PurgeWorlds.java b/src/com/onarandombox/utils/PurgeWorlds.java index 28ffbefa..bea3deb3 100644 --- a/src/com/onarandombox/utils/PurgeWorlds.java +++ b/src/com/onarandombox/utils/PurgeWorlds.java @@ -19,13 +19,13 @@ import org.bukkit.entity.Spider; import org.bukkit.entity.Squid; import org.bukkit.entity.Zombie; -import com.onarandombox.MultiVerseCore.MultiVerseCore; +import com.onarandombox.MultiverseCore.MultiverseCore; public class PurgeWorlds { - MultiVerseCore plugin; + MultiverseCore plugin; - public PurgeWorlds(MultiVerseCore plugin) { + public PurgeWorlds(MultiverseCore plugin) { this.plugin = plugin; } diff --git a/src/plugin.yml b/src/plugin.yml index e51ff1fb..2143f0dc 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ -name: MultiVerse-Core -main: com.onarandombox.MultiVerseCore.MultiVerseCore -authors: ['Rigby','Protected'] +name: Multiverse-Core +main: com.onarandombox.MultiverseCore.MultiverseCore +authors: ['Rigby', 'Herocraft Coding Team'] version: 2.0 commands: mvcreate: