Bump protocol to 4

This commit is contained in:
Eric Stokes 2011-10-08 14:29:44 -06:00
parent 84e178d12e
commit ff47610424
4 changed files with 49 additions and 14 deletions

View File

@ -44,7 +44,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
private final static int Protocol = 3; private final static int Protocol = 4;
@Override @Override
public String dumpVersionInfo(String buffer) { public String dumpVersionInfo(String buffer) {

View File

@ -8,6 +8,7 @@
package com.onarandombox.MultiverseCore.api; package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.MVWorld; import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.utils.PurgeWorlds;
import org.bukkit.World.Environment; import org.bukkit.World.Environment;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
@ -16,7 +17,8 @@ import java.util.Collection;
/** /**
* Multiverse 2 World Manager API * Multiverse 2 World Manager API
* <p/> * <p/>
* This API contains all of the world managing functions that your heart desires! * This API contains all of the world managing
* functions that your heart desires!
*/ */
public interface MVWorldManager { public interface MVWorldManager {
/** /**
@ -24,7 +26,8 @@ public interface MVWorldManager {
* *
* @param name World Name * @param name World Name
* @param env Environment Type * @param env Environment Type
* @param seedString The seed in the form of a string. If the seed is a Long, * @param seedString The seed in the form of a string.
* If the seed is a Long,
* it will be interpreted as such. * it will be interpreted as such.
* @param generator The Custom generator plugin to use. * @param generator The Custom generator plugin to use.
* *
@ -33,7 +36,8 @@ public interface MVWorldManager {
public boolean addWorld(String name, Environment env, String seedString, String generator); public boolean addWorld(String name, Environment env, String seedString, String generator);
/** /**
* Remove the world from the Multiverse list, from the config and deletes the folder * Remove the world from the Multiverse list, from the
* config and deletes the folder
* *
* @param name The name of the world to remove * @param name The name of the world to remove
* *
@ -44,14 +48,15 @@ public interface MVWorldManager {
/** /**
* Unload a world from Multiverse * Unload a world from Multiverse
* *
* @param name Name of the world to unload * @param name Name of the world to unload
* *
* @return True if the world was unloaded, false if not. * @return True if the world was unloaded, false if not.
*/ */
public boolean unloadWorld(String name); public boolean unloadWorld(String name);
/** /**
* Loads the world. Only use this if the world has been unloaded with {@link removeWorldFromList(String)}. * Loads the world. Only use this if the world has been
* unloaded with {@link #unloadWorld(String)}.
* *
* @param name The name of the world to load * @param name The name of the world to load
* *
@ -79,11 +84,36 @@ public interface MVWorldManager {
/** /**
* Returns a {@link MVWorld} if it exists, and null if it does not. This will search name AND alias. * Returns a {@link MVWorld} if it exists, and null if it does not.
* This will search name AND alias.
* *
* @param name The name or alias of the world to get. * @param name The name or alias of the world to get.
* *
* @return A {@link MVWorld} or null. * @return A {@link MVWorld} or null.
*/ */
public MVWorld getMVWorld(String name); public MVWorld getMVWorld(String name);
/**
* Checks to see if the given name is a valid {@link MVWorld}
*
* @param name The name or alias of the world to check.
*
* @return True if the world exists, false if not.
*/
public boolean isMVWorld(String name);
/**
* Load the Worlds & Settings from the configuration file.
*
* @param forceLoad If set to true, this will perform a total
* reset and not just load new worlds.
*/
public void loadWorlds(boolean forceLoad);
/**
* Return the World Purger.
*
* @return A valid {@link PurgeWorlds}.
*/
public PurgeWorlds getWorldPurger();
} }

View File

@ -38,8 +38,8 @@ public class BedDestination implements MVDestination {
@Override @Override
public Location getLocation(Entity entity) { public Location getLocation(Entity entity) {
if(entity instanceof Player) { if (entity instanceof Player) {
this.knownBedLoc = ((Player)entity).getBedSpawnLocation(); this.knownBedLoc = ((Player) entity).getBedSpawnLocation();
return this.knownBedLoc; return this.knownBedLoc;
} }
return null; return null;
@ -72,8 +72,8 @@ public class BedDestination implements MVDestination {
@Override @Override
public String getRequiredPermission() { public String getRequiredPermission() {
if(knownBedLoc != null){ if (knownBedLoc != null) {
return "multiverse.access."+knownBedLoc.getWorld().getName(); return "multiverse.access." + knownBedLoc.getWorld().getName();
} }
return ""; return "";
} }
@ -83,4 +83,8 @@ public class BedDestination implements MVDestination {
// Bukkit should have already checked this. // Bukkit should have already checked this.
return false; return false;
} }
@Override
public String toString() {
return "b:playerbed";
}
} }

View File

@ -317,6 +317,7 @@ public class WorldManager implements MVWorldManager {
* *
* @return True if the world exists, false if not. * @return True if the world exists, false if not.
*/ */
@Override
public boolean isMVWorld(String name) { public boolean isMVWorld(String name) {
return (this.worlds.containsKey(name) || isMVWorldAlias(name)); return (this.worlds.containsKey(name) || isMVWorldAlias(name));
} }