diff --git a/src/main/java/com/onarandombox/MultiverseCore/LoggablePlugin.java b/src/main/java/com/onarandombox/MultiverseCore/LoggablePlugin.java index c135e627..003ad898 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/LoggablePlugin.java +++ b/src/main/java/com/onarandombox/MultiverseCore/LoggablePlugin.java @@ -7,11 +7,13 @@ package com.onarandombox.MultiverseCore; +import com.pneumaticraft.commandhandler.Command; + /** * Dummy class to make old MV Plugins not explode. * If this loads, the user WILL get a severe telling them to update said plugin! * WILL BE DELETED ON 11/1/11 */ @Deprecated -public interface LoggablePlugin { +public interface LoggablePlugin extends com.onarandombox.MultiverseCore.api.LoggablePlugin { } diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVPermissions.java b/src/main/java/com/onarandombox/MultiverseCore/MVPermissions.java index 8fa326f6..70c41c06 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVPermissions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVPermissions.java @@ -7,6 +7,7 @@ package com.onarandombox.MultiverseCore; +import com.pneumaticraft.commandhandler.Command; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; @@ -16,8 +17,8 @@ import org.bukkit.permissions.PermissionDefault; * WILL BE DELETED ON 11/1/11 */ @Deprecated -public class MVPermissions { - public Permission addPermission(String string, PermissionDefault def) { - return new Permission("update.all.multiverse.plugins"); +public class MVPermissions extends com.onarandombox.MultiverseCore.utils.MVPermissions{ + public MVPermissions(MultiverseCore plugin) { + super(plugin); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVPlugin.java b/src/main/java/com/onarandombox/MultiverseCore/MVPlugin.java index e9876cd2..ff2813cf 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVPlugin.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVPlugin.java @@ -13,5 +13,5 @@ package com.onarandombox.MultiverseCore; * WILL BE DELETED ON 11/1/11 */ @Deprecated -public interface MVPlugin { +public interface MVPlugin extends com.onarandombox.MultiverseCore.api.MVPlugin { } diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java index 02a45905..7f7df310 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java @@ -289,7 +289,7 @@ public class MVWorld implements MultiverseWorld { } else { this.world.setSpawnFlags(true, this.world.getAllowAnimals()); } - this.plugin.getWorldManager().getWorldPurger().purgeWorld(null, this); + this.plugin.getMVWorldManager().getWorldPurger().purgeWorld(null, this); } private boolean setVariable(String name, boolean value) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java index 18241185..04d44971 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -20,9 +20,7 @@ import com.onarandombox.MultiverseCore.listeners.MVPlayerListener; import com.onarandombox.MultiverseCore.listeners.MVPluginListener; import com.onarandombox.MultiverseCore.listeners.MVWeatherListener; import com.onarandombox.MultiverseCore.utils.*; -import com.onarandombox.MultiverseCore.utils.DebugLog; import com.onarandombox.MultiverseCore.utils.MVPermissions; -import com.onarandombox.utils.*; import com.pneumaticraft.commandhandler.CommandHandler; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -49,6 +47,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin { public static boolean outdatedPluginFound = false; private static int Protocol = 1; + @Override public String dumpVersionInfo(String buffer) { // I'm kinda cheating on this one, since we call the init event. @@ -393,8 +392,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin { @Deprecated public com.onarandombox.MultiverseCore.MVPermissions getPermissions() { - return new com.onarandombox.MultiverseCore.MVPermissions(); + return new com.onarandombox.MultiverseCore.MVPermissions(this); } + @Deprecated public PurgeWorlds getWorldPurger() { return this.worldManager.getWorldPurger(); @@ -562,10 +562,15 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin { this.bank = bank; } - public DestinationFactory getDestinationFactory() { + public DestinationFactory getDestFactory() { return this.destFactory; } + @Deprecated + public com.onarandombox.utils.DestinationFactory getDestinationFactory() { + return new com.onarandombox.utils.DestinationFactory (this); + } + /** * This is a convenience method to allow the QueuedCommand system to call it. You should NEVER call this directly. * @@ -608,10 +613,15 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin { return this.spoutInterface; } - public WorldManager getWorldManager() { + public WorldManager getMVWorldManager() { return this.worldManager; } + @Deprecated + public com.onarandombox.utils.WorldManager getWorldManager() { + return new com.onarandombox.utils.WorldManager(this); + } + public MVPlayerListener getPlayerListener() { return this.playerListener; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java index 1f5c8174..3b0425d4 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java @@ -33,7 +33,7 @@ public class CoordCommand extends MultiverseCommand { this.addKey("mvcoord"); this.addKey("mvco"); this.setPermission("multiverse.core.coord", "Returns detailed information on the Players where abouts.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java index a20cd053..3a3a0047 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java @@ -35,7 +35,7 @@ public class CreateCommand extends MultiverseCommand { this.addCommandExample("/mv create " + ChatColor.GOLD + "starwars" + ChatColor.AQUA + " skylands"); this.addCommandExample("/mv create " + ChatColor.GOLD + "gargamel" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " -s gargamel"); this.addCommandExample("/mv create " + ChatColor.GOLD + "moonworld" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " -g BukkitFullOfMoon"); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java index 6575b3bc..4574b5cc 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ImportCommand.java @@ -29,7 +29,7 @@ public class ImportCommand extends MultiverseCommand { this.addKey("mvim"); this.addKey("mv import"); this.setPermission("multiverse.core.import", "Imports a new world of the specified type.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java index 664ff88c..932ed9b7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/InfoCommand.java @@ -35,7 +35,7 @@ public class InfoCommand extends MultiverseCommand { this.addKey("mvi"); this.addKey("mv info"); this.setPermission("multiverse.core.info", "Returns detailed information on the world.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java index 4f1e3f7f..edb598e9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java @@ -38,7 +38,7 @@ public class ListCommand extends MultiverseCommand { } String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n"; - for (MVWorld world : this.plugin.getWorldManager().getMVWorlds()) { + for (MVWorld world : this.plugin.getMVWorldManager().getMVWorlds()) { if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) { continue; diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java index f713d67f..76828b66 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyAddCommand.java @@ -34,7 +34,7 @@ public class ModifyAddCommand extends MultiverseCommand { this.addKey("mv modify add"); this.addKey("mvmodify add"); this.setPermission("multiverse.core.modify.add", "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java index 2f4a2241..7711a66e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyClearCommand.java @@ -31,7 +31,7 @@ public class ModifyClearCommand extends MultiverseCommand { this.addKey("mv modify clear"); this.addKey("mvmodify clear"); this.setPermission("multiverse.core.modify.clear", "Removes all values from a property. This will work on properties that contain lists.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java index 31e8e0b4..85de9157 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyRemoveCommand.java @@ -35,7 +35,7 @@ public class ModifyRemoveCommand extends MultiverseCommand { this.addKey("mv modify delete"); this.addKey("mvmodify delete"); this.setPermission("multiverse.core.modify.remove", "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java index bc4038a5..f0afb753 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifySetCommand.java @@ -31,7 +31,7 @@ public class ModifySetCommand extends MultiverseCommand { this.addKey("mv modify set"); this.addKey("mvmodify set"); this.setPermission("multiverse.core.modify.set", "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java index 48242f2c..24d640ec 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java @@ -31,7 +31,7 @@ public class PurgeCommand extends MultiverseCommand { this.addKey("mvpurge"); this.addKey("mv purge"); this.setPermission("multiverse.core.purge", "Removed the specified type of mob from the specified world.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java index 49c0f55a..9121e329 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java @@ -32,7 +32,7 @@ public class ReloadCommand extends MultiverseCommand { public void runCommand(CommandSender sender, List args) { sender.sendMessage(ChatColor.GOLD + "Reloading all Multiverse Plugin configs..."); this.plugin.loadConfigs(); - this.plugin.getWorldManager().loadWorlds(true); + this.plugin.getMVWorldManager().loadWorlds(true); // Create the event List configsLoaded = new ArrayList(); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java index aabf3608..0fad7b7d 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java @@ -28,7 +28,7 @@ public class RemoveCommand extends MultiverseCommand { @Override public void runCommand(CommandSender sender, List args) { - if (this.plugin.getWorldManager().removeWorldFromConfig(args.get(0))) { + if (this.plugin.getMVWorldManager().removeWorldFromConfig(args.get(0))) { sender.sendMessage("World removed from config!"); } else { sender.sendMessage("Error trying to remove world from config!"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java index f6751e8c..b4356ffe 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SetSpawnCommand.java @@ -39,7 +39,7 @@ public class SetSpawnCommand extends MultiverseCommand { Player p = (Player) sender; Location l = p.getLocation(); World w = p.getWorld(); - MVWorld foundWorld = this.plugin.getWorldManager().getMVWorld(w.getName()); + MVWorld foundWorld = this.plugin.getMVWorldManager().getMVWorld(w.getName()); if (foundWorld != null) { foundWorld.setSpawn(p.getLocation()); sender.sendMessage("Spawn was set to: " + LocationManipulation.strCoords(p.getLocation())); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java index 6e95ab16..31f488c1 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/SpawnCommand.java @@ -73,7 +73,7 @@ public class SpawnCommand extends MultiverseCommand { } private void spawnAccurately(Player player) { - MVWorld world = this.plugin.getWorldManager().getMVWorld(player.getWorld().getName()); + MVWorld world = this.plugin.getMVWorldManager().getMVWorld(player.getWorld().getName()); if (world != null) { player.teleport(world.getSpawnLocation()); } else { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java index 0f84b675..ae061f22 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java @@ -81,7 +81,7 @@ public class TeleportCommand extends MultiverseCommand { } } - DestinationFactory df = this.plugin.getDestinationFactory(); + DestinationFactory df = this.plugin.getDestFactory(); MVDestination d = df.getDestination(destinationName); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java index 16c9ddf3..4c0ef2ac 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/UnloadCommand.java @@ -28,7 +28,7 @@ public class UnloadCommand extends MultiverseCommand { @Override public void runCommand(CommandSender sender, List args) { - if (this.plugin.getWorldManager().removeWorldFromList(args.get(0))) { + if (this.plugin.getMVWorldManager().removeWorldFromList(args.get(0))) { sender.sendMessage("World Unloaded!"); } else { sender.sendMessage("Error trying to unload world!"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java index 17092f9a..5b38e2a3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java @@ -50,7 +50,7 @@ public class VersionCommand extends MultiverseCommand { logAndAddToPasteBinBuffer("Multiverse-Core Version: " + this.plugin.getDescription().getVersion()); logAndAddToPasteBinBuffer("Bukkit Version: " + this.plugin.getServer().getVersion()); - logAndAddToPasteBinBuffer("Loaded Worlds: " + this.plugin.getWorldManager().getMVWorlds().size()); + logAndAddToPasteBinBuffer("Loaded Worlds: " + this.plugin.getMVWorldManager().getMVWorlds().size()); logAndAddToPasteBinBuffer("Multiverse Plugins Loaded: " + this.plugin.getPluginCount()); logAndAddToPasteBinBuffer("Economy being used: " + this.plugin.getBank().getEconUsed()); logAndAddToPasteBinBuffer("Permissions Plugin: " + this.plugin.getMVPerms().getType()); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java index af8336e1..df727cd2 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java @@ -31,7 +31,7 @@ public class WhoCommand extends MultiverseCommand { this.addKey("mvw"); this.addKey("mvwho"); this.setPermission("multiverse.core.list.who", "States who is in what world.", PermissionDefault.OP); - this.worldManager = this.plugin.getWorldManager(); + this.worldManager = this.plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/CannonDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/CannonDestination.java index 575f3374..38af42af 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/CannonDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/CannonDestination.java @@ -58,7 +58,7 @@ public class CannonDestination implements MVDestination { } // If it's not a MV world - if (!((MultiverseCore) plugin).getWorldManager().isMVWorld(parsed.get(1))) { + if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) { return false; } // Verify X,Y,Z are numbers @@ -104,12 +104,12 @@ public class CannonDestination implements MVDestination { return; } - if (!((MultiverseCore) plugin).getWorldManager().isMVWorld(parsed.get(1))) { + if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) { this.isValid = false; return; } - this.location = new Location(((MultiverseCore) plugin).getWorldManager().getMVWorld(parsed.get(1)).getCBWorld(), 0, 0, 0); + this.location = new Location(((MultiverseCore) plugin).getMVWorldManager().getMVWorld(parsed.get(1)).getCBWorld(), 0, 0, 0); if (!parsed.get(2).matches(this.coordRegex)) { this.isValid = false; diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/ExactDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/ExactDestination.java index f025d19a..1cc65753 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/ExactDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/ExactDestination.java @@ -50,7 +50,7 @@ public class ExactDestination implements MVDestination { } // If it's not a MV world - if (!((MultiverseCore) plugin).getWorldManager().isMVWorld(parsed.get(1))) { + if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) { return false; } @@ -100,11 +100,11 @@ public class ExactDestination implements MVDestination { return; } - if (!((MultiverseCore) plugin).getWorldManager().isMVWorld(parsed.get(1))) { + if (!((MultiverseCore) plugin).getMVWorldManager().isMVWorld(parsed.get(1))) { this.isValid = false; return; } - this.location = new Location(((MultiverseCore) plugin).getWorldManager().getMVWorld(parsed.get(1)).getCBWorld(), 0, 0, 0); + this.location = new Location(((MultiverseCore) plugin).getMVWorldManager().getMVWorld(parsed.get(1)).getCBWorld(), 0, 0, 0); if (!parsed.get(2).matches(this.coordRegex)) { this.isValid = false; diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/WorldDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/WorldDestination.java index 6d007fc5..68ea153f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/WorldDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/WorldDestination.java @@ -34,14 +34,14 @@ public class WorldDestination implements MVDestination { if (items.length > 3) { return false; } - if (items.length == 1 && ((MultiverseCore) plugin).getWorldManager().isMVWorld(items[0])) { + if (items.length == 1 && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[0])) { // This case is: world return true; } - if (items.length == 2 && ((MultiverseCore) plugin).getWorldManager().isMVWorld(items[0])) { + if (items.length == 2 && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[0])) { // This case is: world:n return true; - } else if (items[0].equalsIgnoreCase("w") && ((MultiverseCore) plugin).getWorldManager().isMVWorld(items[1])) { + } else if (items[0].equalsIgnoreCase("w") && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[1])) { // This case is: w:world // and w:world:ne return true; @@ -79,18 +79,18 @@ public class WorldDestination implements MVDestination { isValid = false; return; } - if (items.length == 1 && ((MultiverseCore) plugin).getWorldManager().isMVWorld(items[0])) { + if (items.length == 1 && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[0])) { isValid = true; - this.world = ((MultiverseCore) plugin).getWorldManager().getMVWorld(items[0]); + this.world = ((MultiverseCore) plugin).getMVWorldManager().getMVWorld(items[0]); return; } - if (items.length == 2 && ((MultiverseCore) plugin).getWorldManager().isMVWorld(items[0])) { - this.world = ((MultiverseCore) plugin).getWorldManager().getMVWorld(items[0]); + if (items.length == 2 && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[0])) { + this.world = ((MultiverseCore) plugin).getMVWorldManager().getMVWorld(items[0]); this.yaw = LocationManipulation.getYaw(items[1]); return; } - if (items[0].equalsIgnoreCase("w") && ((MultiverseCore) plugin).getWorldManager().isMVWorld(items[1])) { - this.world = ((MultiverseCore) plugin).getWorldManager().getMVWorld(items[1]); + if (items[0].equalsIgnoreCase("w") && ((MultiverseCore) plugin).getMVWorldManager().isMVWorld(items[1])) { + this.world = ((MultiverseCore) plugin).getMVWorldManager().getMVWorld(items[1]); isValid = true; if (items.length == 3) { this.yaw = LocationManipulation.getYaw(items[2]); diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java index feaf8693..dcbd7863 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVEntityListener.java @@ -29,14 +29,14 @@ public class MVEntityListener extends EntityListener { public MVEntityListener(MultiverseCore plugin) { this.plugin = plugin; - this.worldManager = plugin.getWorldManager(); + this.worldManager = plugin.getMVWorldManager(); } @Override public void onFoodLevelChange(FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player) { Player p = (Player) event.getEntity(); - MVWorld w = this.plugin.getWorldManager().getMVWorld(p.getWorld().getName()); + MVWorld w = this.plugin.getMVWorldManager().getMVWorld(p.getWorld().getName()); if (w != null && !w.getHunger()) { // If the world has hunger set to false, do not let the level go down if (event.getFoodLevel() < ((Player) event.getEntity()).getFoodLevel()) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 353a8563..bccf12ca 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -29,7 +29,7 @@ public class MVPlayerListener extends PlayerListener { public MVPlayerListener(MultiverseCore plugin) { this.plugin = plugin; - worldManager = plugin.getWorldManager(); + worldManager = plugin.getMVWorldManager(); } @Override diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPluginListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPluginListener.java index ec3bbbbc..12e409b4 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPluginListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPluginListener.java @@ -33,8 +33,8 @@ public class MVPluginListener extends ServerListener { this.plugin.log(Level.SEVERE, "Please grab the latest version from:"); this.plugin.log(Level.SEVERE, "http://bukkit.onarandombox.com/?dir="+event.getPlugin().getDescription().getName().toLowerCase()); this.plugin.log(Level.SEVERE, "I'm going to disable " + event.getPlugin().getDescription().getName() + " now."); + this.plugin.log(Level.SEVERE, "IF YOU DO NOT UPDATE, YOUR SERVER WILL **NOT** FUNCTION PROPERLY!!!"); this.plugin.getServer().getPluginManager().disablePlugin(event.getPlugin()); - } // Let AllPay handle all econ plugin loadings, only go for econ plugins we support if (Arrays.asList(AllPay.validEconPlugins).contains(event.getPlugin().getDescription().getName())) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVWeatherListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVWeatherListener.java index 1f6099f1..2cd351bf 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVWeatherListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVWeatherListener.java @@ -23,7 +23,7 @@ public class MVWeatherListener extends WeatherListener { @Override public void onWeatherChange(WeatherChangeEvent event) { - MVWorld world = this.plugin.getWorldManager().getMVWorld(event.getWorld().getName()); + MVWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld().getName()); if (world != null) { // If it's going to start raining and we have weather disabled event.setCancelled((event.toWeatherState() && !world.getWeatherEnabled())); @@ -33,7 +33,7 @@ public class MVWeatherListener extends WeatherListener { @Override public void onThunderChange(ThunderChangeEvent event) { - MVWorld world = this.plugin.getWorldManager().getMVWorld(event.getWorld().getName()); + MVWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld().getName()); if (world != null) { // If it's going to start raining and we have weather disabled event.setCancelled((event.toThunderState() && !world.getWeatherEnabled())); diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java b/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java index c3d9f91d..a2307b59 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java @@ -10,7 +10,6 @@ package com.onarandombox.MultiverseCore.utils; import com.onarandombox.MultiverseCore.MVWorld; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.api.MVDestination; -import com.onarandombox.MultiverseCore.utils.WorldManager; import com.pneumaticraft.commandhandler.PermissionsInterface; import org.bukkit.Location; import org.bukkit.command.CommandSender; @@ -33,7 +32,7 @@ public class MVPermissions implements PermissionsInterface { */ public MVPermissions(MultiverseCore plugin) { this.plugin = plugin; - this.worldMgr = plugin.getWorldManager(); + this.worldMgr = plugin.getMVWorldManager(); } /** @@ -87,7 +86,7 @@ public class MVPermissions implements PermissionsInterface { return false; } String worldName = l.getWorld().getName(); - if (!this.plugin.getWorldManager().isMVWorld(worldName)) { + if (!this.plugin.getMVWorldManager().isMVWorld(worldName)) { return false; } return this.hasPermission(p, "multiverse.access." + worldName, false); diff --git a/src/main/java/com/onarandombox/utils/DebugLog.java b/src/main/java/com/onarandombox/utils/DebugLog.java index d5a5da0f..9268ae28 100644 --- a/src/main/java/com/onarandombox/utils/DebugLog.java +++ b/src/main/java/com/onarandombox/utils/DebugLog.java @@ -14,7 +14,8 @@ package com.onarandombox.utils; */ @Deprecated -public class DebugLog { - public DebugLog(String dummy, String dummy2) { +public class DebugLog extends com.onarandombox.MultiverseCore.utils.DebugLog{ + public DebugLog(String logger, String file) { + super(logger, file); } } diff --git a/src/main/java/com/onarandombox/utils/DestinationFactory.java b/src/main/java/com/onarandombox/utils/DestinationFactory.java new file mode 100644 index 00000000..708ac69a --- /dev/null +++ b/src/main/java/com/onarandombox/utils/DestinationFactory.java @@ -0,0 +1,33 @@ +/****************************************************************************** + * Multiverse 2 Copyright (c) the Multiverse Team 2011. * + * Multiverse 2 is licensed under the BSD License. * + * For more information please check the README.md file included * + * with this project. * + ******************************************************************************/ + +package com.onarandombox.utils; + +import com.onarandombox.MultiverseCore.MultiverseCore; +import com.onarandombox.utils.MVDestination; +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.util.Vector; + +/** + * Dummy class to make old MV Plugins not explode. + * If this loads, the user WILL get a severe telling them to update said plugin! + * WILL BE DELETED ON 11/1/11 + */ + +@Deprecated +public class DestinationFactory extends com.onarandombox.MultiverseCore.destination.DestinationFactory { + public DestinationFactory(MultiverseCore plugin) { + super(plugin); + } + + @Override + public MVDestination getDestination(String destination) { + return new InvalidDestination(); + } +} diff --git a/src/main/java/com/onarandombox/utils/InvalidDestination.java b/src/main/java/com/onarandombox/utils/InvalidDestination.java new file mode 100644 index 00000000..1b6f50df --- /dev/null +++ b/src/main/java/com/onarandombox/utils/InvalidDestination.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Multiverse 2 Copyright (c) the Multiverse Team 2011. * + * Multiverse 2 is licensed under the BSD License. * + * For more information please check the README.md file included * + * with this project. * + ******************************************************************************/ + +package com.onarandombox.utils; + +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.util.Vector; + +/** + * Dummy class to make old MV Plugins not explode. + * If this loads, the user WILL get a severe telling them to update said plugin! + * WILL BE DELETED ON 11/1/11 + */ + +@Deprecated +public class InvalidDestination implements com.onarandombox.utils.MVDestination { + /** + * Returns the identifier or prefix that is required for this destination. + *

+ * Portals have a prefix of "p" for example and OpenWarp (third party plugin) uses "ow". This is derived from a + * hash and cannot have duplicate values. Read that as your plugin cannot use 'p' because it's already used. + * Please check the wiki when adding a custom destination! + * + * @return The identifier or prefix that is required for this destination. + */ + @Override + public String getIdentifier() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Allows you to determine if a Destination is valid for the type it thinks it is. + *

+ * An example of this would be the exact destination. A valid string would be: e:0,0,0 where an invalid one would + * be e:1:2:3. The first string would return true the second would return false. This is simply a convenience + * method + * and does not even NEED to be called, but it's highly recommended if you're teleporting, but it's mainly for + * Multiverse Internal use. + * + * @param plugin The plugin who the type belongs to. + * @param destination The destination string. ex: p:MyPortal:nw + * + * @return True if the destination is valid, false if not. + */ + @Override + public boolean isThisType(JavaPlugin plugin, String destination) { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Returns the location a specific entity will spawn at. + *

+ * To just retrieve the location as it is stored you can just pass null, but be warned some destinations may return + * null back to you if you do this. It is always safer to pass an actual entity. This is used so things like + * minecarts can be teleported. + *

+ * Do not forget to use {@link #getVelocity()} as destinations can use this too! + * + * @param entity The entity to be teleported. + * + * @return The location of the entity. + */ + @Override + public Location getLocation(Entity entity) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Returns the velocity vector for this destination. + *

+ * Plugins wishing to fully support MVDestinations MUST implement this. + * + * @return A vector representing the speed/direction the player should travel when arriving + */ + @Override + public Vector getVelocity() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Sets the destination string. + *

+ * This should be used when you want to tell this destination object about a change in where it should take people. + * The destination param should be match the result from {@link #getIdentifier()}. A valid example would be that if + * {@link #getIdentifier()} returned "ow" our destination string could be "ow:TownCenter" but could not be + * "p:HomePortal" + * + * @param plugin The plugin who the type belongs to. + * @param destination The destination string. ex: p:MyPortal:nw + */ + @Override + public void setDestination(JavaPlugin plugin, String destination) { + //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Returns true if the destination is valid and players will be taken to it. + *

+ * Even if destinations are in the correct format (p:MyPortal) MyPortal may not exist, and therefore this would + * return false. + * + * @return True if the destination is valid; false if not. + */ + @Override + public boolean isValid() { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Gives you a general friendly description of the type of destination. + *

+ * For example, the PlayerDestination sets this to "Player". You can use this to show where a player will be taken. + * + * @return A friendly string description of the type of destination. + */ + @Override + public String getType() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Gives you a specific name of the destination. + *

+ * For example, the PlayerDestination sets this to The Player's Name. + * + * @return A friendly string stating the name of the destination. + */ + @Override + public String getName() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Returns the permissions string required to go here. + *

+ * ex: multiverse.access.world + *

+ * NOTE: This is NOT the permission to use the teleport command. + * + * @return the permissions string required to go here. + */ + @Override + public String getRequiredPermission() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + /** + * Should the Multiverse SafeTeleporter be used? + *

+ * If not, MV will blindly take people to the location specified. + * + * @return True if the SafeTeleporter will be used, false if not. + */ + @Override + public boolean useSafeTeleporter() { + return false; //To change body of implemented methods use File | Settings | File Templates. + } +} diff --git a/src/main/java/com/onarandombox/utils/MVDestination.java b/src/main/java/com/onarandombox/utils/MVDestination.java new file mode 100644 index 00000000..f0135572 --- /dev/null +++ b/src/main/java/com/onarandombox/utils/MVDestination.java @@ -0,0 +1,18 @@ +/****************************************************************************** + * Multiverse 2 Copyright (c) the Multiverse Team 2011. * + * Multiverse 2 is licensed under the BSD License. * + * For more information please check the README.md file included * + * with this project. * + ******************************************************************************/ + +package com.onarandombox.utils; + +/** + * Dummy class to make old MV Plugins not explode. + * If this loads, the user WILL get a severe telling them to update said plugin! + * WILL BE DELETED ON 11/1/11 + */ + +@Deprecated +public interface MVDestination extends com.onarandombox.MultiverseCore.api.MVDestination { +} diff --git a/src/main/java/com/onarandombox/utils/WorldManager.java b/src/main/java/com/onarandombox/utils/WorldManager.java new file mode 100644 index 00000000..7e6b5643 --- /dev/null +++ b/src/main/java/com/onarandombox/utils/WorldManager.java @@ -0,0 +1,22 @@ +/****************************************************************************** + * Multiverse 2 Copyright (c) the Multiverse Team 2011. * + * Multiverse 2 is licensed under the BSD License. * + * For more information please check the README.md file included * + * with this project. * + ******************************************************************************/ + +package com.onarandombox.utils; + +import com.onarandombox.MultiverseCore.MultiverseCore; + +/** + * Dummy class to make old MV Plugins not explode. + * If this loads, the user WILL get a severe telling them to update said plugin! + * WILL BE DELETED ON 11/1/11 + */ +@Deprecated +public class WorldManager extends com.onarandombox.MultiverseCore.utils.WorldManager { + public WorldManager(MultiverseCore core) { + super(core); + } +}