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;
public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
private final static int Protocol = 3;
private final static int Protocol = 4;
@Override
public String dumpVersionInfo(String buffer) {

View File

@ -8,6 +8,7 @@
package com.onarandombox.MultiverseCore.api;
import com.onarandombox.MultiverseCore.MVWorld;
import com.onarandombox.MultiverseCore.utils.PurgeWorlds;
import org.bukkit.World.Environment;
import org.bukkit.generator.ChunkGenerator;
@ -16,7 +17,8 @@ import java.util.Collection;
/**
* Multiverse 2 World Manager API
* <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 {
/**
@ -24,7 +26,8 @@ public interface MVWorldManager {
*
* @param name World Name
* @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.
* @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);
/**
* 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
*
@ -44,21 +48,22 @@ public interface MVWorldManager {
/**
* 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.
*/
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
*
*
* @return True if success, false if failure.
*/
public boolean loadWorld(String name);
/**
* Test if a given chunk generator is valid.
*
@ -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.
*
* @return A {@link MVWorld} or null.
*/
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
public Location getLocation(Entity entity) {
if(entity instanceof Player) {
this.knownBedLoc = ((Player)entity).getBedSpawnLocation();
if (entity instanceof Player) {
this.knownBedLoc = ((Player) entity).getBedSpawnLocation();
return this.knownBedLoc;
}
return null;
@ -72,8 +72,8 @@ public class BedDestination implements MVDestination {
@Override
public String getRequiredPermission() {
if(knownBedLoc != null){
return "multiverse.access."+knownBedLoc.getWorld().getName();
if (knownBedLoc != null) {
return "multiverse.access." + knownBedLoc.getWorld().getName();
}
return "";
}
@ -83,4 +83,8 @@ public class BedDestination implements MVDestination {
// Bukkit should have already checked this.
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.
*/
@Override
public boolean isMVWorld(String name) {
return (this.worlds.containsKey(name) || isMVWorldAlias(name));
}