Package com.onarandombox.MultiverseCore
Class MVWorld
- java.lang.Object
-
- com.onarandombox.MultiverseCore.MVWorld
-
- All Implemented Interfaces:
MultiverseWorld
public class MVWorld extends java.lang.Object implements MultiverseWorld
The implementation of a Multiverse handled world.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MVWorld.NullLocation
Null-location.
-
Constructor Summary
Constructors Constructor Description MVWorld(MultiverseCore plugin, org.bukkit.World world, WorldProperties properties)
MVWorld(MultiverseCore plugin, org.bukkit.World world, WorldProperties properties, boolean fixSpawn)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addToVariable(java.lang.String property, java.lang.String value)
Deprecated.This is deprecated.void
allowPortalMaking(AllowedPortalType portalType)
Sets The types of portals that are allowed in this world.boolean
canAnimalsSpawn()
Gets whether or not animals are allowed to spawn in this world.boolean
canMonstersSpawn()
Gets whether or not monsters are allowed to spawn in this world.boolean
clearList(java.lang.String property)
Deprecated.This is deprecated.boolean
clearVariable(java.lang.String property)
Deprecated.This is deprecated.void
copyValues(MVWorld other)
Copies all properties from anotherMVWorld
object.void
copyValues(WorldProperties other)
Copies all properties from aWorldProperties
object.org.bukkit.permissions.Permission
getAccessPermission()
Gets the permission required to enter this world.boolean
getAdjustSpawn()
Gets whether or not Multiverse should auto-adjust the spawn for this world.java.lang.String
getAlias()
Gets the alias of this world.AllowedPortalType
getAllowedPortals()
Gets which type(s) of portals are allowed to be constructed in this world.boolean
getAllowFlight()
Whether or not players are allowed to fly in this world.java.lang.String
getAllPropertyNames()
Gets all the names of all properties that can be SET.java.util.List<java.lang.String>
getAnimalList()
Returns a list of animals.boolean
getAutoHeal()
Gets whether or not a world will auto-heal players if the difficulty is on peaceful.boolean
getAutoLoad()
Gets whether or not Multiverse should auto-load this world.boolean
getBedRespawn()
Gets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.org.bukkit.World
getCBWorld()
Returns the Bukkit world object that this world describes.org.bukkit.ChatColor
getColor()
Gets the color that this world's name/alias will display as.java.lang.String
getColoredWorldString()
Returns a very nicely colored string (using Alias and Color if they are set).org.bukkit.Material
getCurrency()
Gets the type of currency that will be used when users enter this world.org.bukkit.Difficulty
getDifficulty()
Gets the difficulty of this world.org.bukkit.World.Environment
getEnvironment()
Gets the environment of this world.org.bukkit.permissions.Permission
getExemptPermission()
Gets the permission required to be exempt when entering.boolean
getFakePVP()
Deprecated.This is deprecated.org.bukkit.GameMode
getGameMode()
Gets the GameMode of this world.java.lang.String
getGenerator()
Gets the generator of this world.boolean
getHunger()
Gets whether or not the hunger level of players will go down in a world.java.util.List<java.lang.String>
getMonsterList()
Returns a list of monsters.java.lang.String
getName()
Gets the name of this world.java.lang.String
getPermissibleName()
Gets the lowercased name of the world.int
getPlayerLimit()
Gets the player limit for this world after which players without an override permission node will not be allowed in.double
getPrice()
Gets the amount of currency it requires to enter this world.java.lang.String
getPropertyHelp(java.lang.String property)
Gets the help-message for a property.java.lang.String
getPropertyValue(java.lang.String property)
Gets a property asString
.org.bukkit.World
getRespawnToWorld()
Gets the world players will respawn in if they die in this one.double
getScaling()
Gets the scaling value of this world.Really only has an effect if you use Multiverse-NetherPortals.long
getSeed()
Gets the world seed of this world.org.bukkit.Location
getSpawnLocation()
Gets the spawn location of this world.org.bukkit.ChatColor
getStyle()
Gets the style that this world's name/alias will display as.java.lang.String
getTime()
Same asMultiverseWorld.getTime()
, but returns a string.java.util.List<java.lang.String>
getWorldBlacklist()
Gets a list of all the worlds that players CANNOT travel to from this world, regardless of their access permissions.org.bukkit.WorldType
getWorldType()
Gets the type of this world.boolean
isHidden()
Gets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.boolean
isKeepingSpawnInMemory()
Gets whether or not CraftBukkit is keeping the chunks for this world in memory.boolean
isPVPEnabled()
Gets whether or not PVP is enabled in this world in some form (fake or not).boolean
isValidAliasColor(java.lang.String aliasColor)
Deprecated.This is deprecated.boolean
isWeatherEnabled()
Gets whether weather is enabled in this world.boolean
removeFromVariable(java.lang.String property, java.lang.String value)
Deprecated.This is deprecated.void
setAdjustSpawn(boolean adjust)
Sets whether or not Multiverse should auto-adjust the spawn for this world.void
setAlias(java.lang.String alias)
Sets the alias of the world.void
setAllowAnimalSpawn(boolean animals)
Sets whether or not animals can spawn.void
setAllowFlight(boolean allowFlight)
Sets whether or not players are allowed to fly in this world.void
setAllowMonsterSpawn(boolean monsters)
Sets whether or not monsters can spawn.void
setAutoHeal(boolean heal)
Sets whether or not a world will auto-heal players if the difficulty is on peaceful.void
setAutoLoad(boolean load)
Sets whether or not Multiverse should auto-load this world.void
setBedRespawn(boolean respawn)
Sets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.boolean
setColor(java.lang.String aliasColor)
Sets the color that this world's name/alias will display as.void
setCurrency(@Nullable org.bukkit.Material currency)
Sets the type of item that will be required given the price is not 0.boolean
setDifficulty(java.lang.String difficulty)
Deprecated.This is deprecated.boolean
setDifficulty(org.bukkit.Difficulty difficulty)
Sets the difficulty of this world and returnstrue
on success.void
setEnableWeather(boolean weather)
Sets whether or not there will be weather events in a given world.void
setEnvironment(org.bukkit.World.Environment environment)
Sets the environment of a world.boolean
setGameMode(java.lang.String mode)
Sets the game mode of this world.boolean
setGameMode(org.bukkit.GameMode mode)
Sets the game mode of this world.void
setGenerator(java.lang.String generator)
Sets the generator of this world.void
setHidden(boolean hidden)
Sets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.void
setHunger(boolean hunger)
Sets whether or not the hunger level of players will go down in a world.void
setKeepSpawnInMemory(boolean value)
If true, tells Craftbukkit to keep a worlds spawn chunks loaded in memory (default: true) If not, CraftBukkit will attempt to free memory when players have not used that world.void
setPlayerLimit(int limit)
Sets the player limit for this world after which players without an override permission node will not be allowed in.void
setPrice(double price)
Sets the price for entry to this world.boolean
setPropertyValue(java.lang.String property, java.lang.String value)
Sets a property to a given value.void
setPVPMode(boolean pvp)
Turn pvp on or off.boolean
setRespawnToWorld(java.lang.String respawnToWorld)
Sets the world players will respawn in if they die in this one.boolean
setScaling(double scaling)
Sets the scale of this world.void
setSeed(long seed)
Sets the seed of this world.void
setSpawnLocation(org.bukkit.Location l)
Sets the spawn location for a world.boolean
setStyle(java.lang.String style)
Sets the style that this world's name/alias will display as.boolean
setTime(java.lang.String timeAsString)
Sets the current time in a world.java.lang.String
toString()
void
validateEntitySpawns()
This method is here to provide a stopgap until the add/remove/clear methods are implemented with SerializationConfig.
-
-
-
Constructor Detail
-
MVWorld
public MVWorld(MultiverseCore plugin, org.bukkit.World world, WorldProperties properties)
-
MVWorld
public MVWorld(MultiverseCore plugin, org.bukkit.World world, WorldProperties properties, boolean fixSpawn)
-
-
Method Detail
-
validateEntitySpawns
public void validateEntitySpawns()
This method is here to provide a stopgap until the add/remove/clear methods are implemented with SerializationConfig.
-
copyValues
public void copyValues(MVWorld other)
Copies all properties from anotherMVWorld
object.- Parameters:
other
- The other world object.
-
copyValues
public void copyValues(WorldProperties other)
Copies all properties from aWorldProperties
object.- Parameters:
other
- The world properties object.
-
getCBWorld
public org.bukkit.World getCBWorld()
Returns the Bukkit world object that this world describes.- Specified by:
getCBWorld
in interfaceMultiverseWorld
- Returns:
- A
World
-
getColoredWorldString
public java.lang.String getColoredWorldString()
Returns a very nicely colored string (using Alias and Color if they are set).- Specified by:
getColoredWorldString
in interfaceMultiverseWorld
- Returns:
- A nicely colored string.
-
clearList
@Deprecated public boolean clearList(java.lang.String property)
Deprecated.This is deprecated.Clears a list property (sets it to []).- Specified by:
clearList
in interfaceMultiverseWorld
- Parameters:
property
- The property to clear.- Returns:
- True if success, false if fail.
-
clearVariable
@Deprecated public boolean clearVariable(java.lang.String property)
Deprecated.This is deprecated.Removes all values from the given property. The property must be aAddProperties
.- Specified by:
clearVariable
in interfaceMultiverseWorld
- Parameters:
property
- The name of aAddProperties
to clear.- Returns:
- True if it was cleared, false if not.
-
addToVariable
@Deprecated public boolean addToVariable(java.lang.String property, java.lang.String value)
Deprecated.This is deprecated.Adds a value to the given property. The property must be aAddProperties
.- Specified by:
addToVariable
in interfaceMultiverseWorld
- Parameters:
property
- The name of aAddProperties
to add a value to.value
- A value in string representation, it will be parsed to the correct type.- Returns:
- True if the value was added, false if not.
-
removeFromVariable
@Deprecated public boolean removeFromVariable(java.lang.String property, java.lang.String value)
Deprecated.This is deprecated.Removes a value from the given property. The property must be aAddProperties
.- Specified by:
removeFromVariable
in interfaceMultiverseWorld
- Parameters:
property
- The name of aAddProperties
to remove a value from.value
- A value in string representation, it will be parsed to the correct type.- Returns:
- True if the value was removed, false if not.
-
getPropertyValue
public java.lang.String getPropertyValue(java.lang.String property) throws PropertyDoesNotExistException
Gets a property asString
.- Specified by:
getPropertyValue
in interfaceMultiverseWorld
- Parameters:
property
- The name of a world property to get.- Returns:
- The string-representation of that property.
- Throws:
PropertyDoesNotExistException
- Thrown if the property was not found in the world.
-
setPropertyValue
public boolean setPropertyValue(java.lang.String property, java.lang.String value) throws PropertyDoesNotExistException
Sets a property to a given value.- Specified by:
setPropertyValue
in interfaceMultiverseWorld
- Parameters:
property
- The name of a world property to set.value
- A value in string representation, it will be parsed to the correct type.- Returns:
- True if the value was set, false if not.
- Throws:
PropertyDoesNotExistException
- Thrown if the property was not found in the world.
-
getPropertyHelp
public java.lang.String getPropertyHelp(java.lang.String property) throws PropertyDoesNotExistException
Gets the help-message for a property.- Specified by:
getPropertyHelp
in interfaceMultiverseWorld
- Parameters:
property
- The name of the property.- Returns:
- The help-message.
- Throws:
PropertyDoesNotExistException
- Thrown if the property was not found.
-
getWorldType
public org.bukkit.WorldType getWorldType()
Gets the type of this world. As of 1.2 this will be: FLAT, NORMAL or VERSION_1_1This is not the generator.
- Specified by:
getWorldType
in interfaceMultiverseWorld
- Returns:
- The Type of this world.
-
getEnvironment
public org.bukkit.World.Environment getEnvironment()
Gets the environment of this world.- Specified by:
getEnvironment
in interfaceMultiverseWorld
- Returns:
- A
World.Environment
.
-
setEnvironment
public void setEnvironment(org.bukkit.World.Environment environment)
Sets the environment of a world.Note: This will ONLY take effect once the world is unloaded/reloaded.
- Specified by:
setEnvironment
in interfaceMultiverseWorld
- Parameters:
environment
- AWorld.Environment
.
-
getSeed
public long getSeed()
Gets the world seed of this world.- Specified by:
getSeed
in interfaceMultiverseWorld
- Returns:
- The Long version of the seed.
-
setSeed
public void setSeed(long seed)
Sets the seed of this world.- Specified by:
setSeed
in interfaceMultiverseWorld
- Parameters:
seed
- A Long that is the seed.
-
getGenerator
public java.lang.String getGenerator()
Gets the generator of this world.- Specified by:
getGenerator
in interfaceMultiverseWorld
- Returns:
- The name of the generator.
-
setGenerator
public void setGenerator(java.lang.String generator)
Sets the generator of this world.- Specified by:
setGenerator
in interfaceMultiverseWorld
- Parameters:
generator
- The new generator's name.
-
getPlayerLimit
public int getPlayerLimit()
Gets the player limit for this world after which players without an override permission node will not be allowed in. A value of -1 or less signifies no limit- Specified by:
getPlayerLimit
in interfaceMultiverseWorld
- Returns:
- The player limit
-
setPlayerLimit
public void setPlayerLimit(int limit)
Sets the player limit for this world after which players without an override permission node will not be allowed in. A value of -1 or less signifies no limit- Specified by:
setPlayerLimit
in interfaceMultiverseWorld
- Parameters:
limit
- The new limit
-
getName
public java.lang.String getName()
Gets the name of this world. The name cannot be changed.Note for plugin developers: Usually
MultiverseWorld.getAlias()
is what you want to use instead of this method.- Specified by:
getName
in interfaceMultiverseWorld
- Returns:
- The name of the world as a String.
-
getPermissibleName
public java.lang.String getPermissibleName()
Gets the lowercased name of the world. This method is required, since the permissables lowercase all permissions when recalculating.Note: This also means if a user has worlds named: world and WORLD, that they can both exist, and both be teleported to independently, but their permissions **cannot** be uniqueified at this time. See bug report #.
- Specified by:
getPermissibleName
in interfaceMultiverseWorld
- Returns:
- The lowercased name of the world.
-
getAlias
public java.lang.String getAlias()
Gets the alias of this world.This alias allows users to have a world named "world" but show up in the list as "FernIsland"
- Specified by:
getAlias
in interfaceMultiverseWorld
- Returns:
- The alias of the world as a String.
-
setAlias
public void setAlias(java.lang.String alias)
Sets the alias of the world.- Specified by:
setAlias
in interfaceMultiverseWorld
- Parameters:
alias
- A string that is the new alias.
-
canAnimalsSpawn
public boolean canAnimalsSpawn()
Gets whether or not animals are allowed to spawn in this world.- Specified by:
canAnimalsSpawn
in interfaceMultiverseWorld
- Returns:
- True if ANY animal can, false if no animals can spawn.
-
setAllowAnimalSpawn
public void setAllowAnimalSpawn(boolean animals)
Sets whether or not animals can spawn. If there are values inMultiverseWorld.getAnimalList()
and this is false, those animals become the exceptions, and will spawn- Specified by:
setAllowAnimalSpawn
in interfaceMultiverseWorld
- Parameters:
animals
- True to allow spawning of monsters, false to prevent.
-
getAnimalList
public java.util.List<java.lang.String> getAnimalList()
Returns a list of animals. This list always negates theMultiverseWorld.canAnimalsSpawn()
result.- Specified by:
getAnimalList
in interfaceMultiverseWorld
- Returns:
- A list of animals that will spawn if
MultiverseWorld.canAnimalsSpawn()
is false.
-
canMonstersSpawn
public boolean canMonstersSpawn()
Gets whether or not monsters are allowed to spawn in this world.- Specified by:
canMonstersSpawn
in interfaceMultiverseWorld
- Returns:
- True if ANY monster can, false if no monsters can spawn.
-
setAllowMonsterSpawn
public void setAllowMonsterSpawn(boolean monsters)
Sets whether or not monsters can spawn. If there are values inMultiverseWorld.getMonsterList()
and this is false, those monsters become the exceptions, and will spawn- Specified by:
setAllowMonsterSpawn
in interfaceMultiverseWorld
- Parameters:
monsters
- True to allow spawning of monsters, false to prevent.
-
getMonsterList
public java.util.List<java.lang.String> getMonsterList()
Returns a list of monsters. This list always negates theMultiverseWorld.canMonstersSpawn()
result.- Specified by:
getMonsterList
in interfaceMultiverseWorld
- Returns:
- A list of monsters that will spawn if
MultiverseWorld.canMonstersSpawn()
is false.
-
isPVPEnabled
public boolean isPVPEnabled()
Gets whether or not PVP is enabled in this world in some form (fake or not).- Specified by:
isPVPEnabled
in interfaceMultiverseWorld
- Returns:
- True if players can take damage from other players.
-
setPVPMode
public void setPVPMode(boolean pvp)
Turn pvp on or off. This setting is used to set the world's PVP mode.- Specified by:
setPVPMode
in interfaceMultiverseWorld
- Parameters:
pvp
- True to enable PVP damage, false to disable it.
-
isHidden
public boolean isHidden()
Gets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.- Specified by:
isHidden
in interfaceMultiverseWorld
- Returns:
- True if the world will be hidden, false if not.
-
setHidden
public void setHidden(boolean hidden)
Sets whether or not this world will display in chat, mvw and mvl regardless if a user has the access permissions to go to this world.- Specified by:
setHidden
in interfaceMultiverseWorld
- Parameters:
hidden
- Set
-
getWorldBlacklist
public java.util.List<java.lang.String> getWorldBlacklist()
Gets a list of all the worlds that players CANNOT travel to from this world, regardless of their access permissions.- Specified by:
getWorldBlacklist
in interfaceMultiverseWorld
- Returns:
- A List of world names.
-
getScaling
public double getScaling()
Gets the scaling value of this world.Really only has an effect if you use Multiverse-NetherPortals.- Specified by:
getScaling
in interfaceMultiverseWorld
- Returns:
- This world's non-negative, non-zero scale.
-
setScaling
public boolean setScaling(double scaling)
Sets the scale of this world. Really only has an effect if you use Multiverse-NetherPortals.- Specified by:
setScaling
in interfaceMultiverseWorld
- Parameters:
scaling
- A scaling value, cannot be negative or 0.- Returns:
- Whether the scale was set successfully.
-
setColor
public boolean setColor(java.lang.String aliasColor)
Sets the color that this world's name/alias will display as.- Specified by:
setColor
in interfaceMultiverseWorld
- Parameters:
aliasColor
- A valid color name.- Returns:
- True if the color was set, false if not.
-
isValidAliasColor
@Deprecated public boolean isValidAliasColor(java.lang.String aliasColor)
Deprecated.This is deprecated.Tells you if someone entered a valid color.- Specified by:
isValidAliasColor
in interfaceMultiverseWorld
- Parameters:
aliasColor
- A string that may translate to a color.- Returns:
- True if it is a color, false if not.
-
getColor
public org.bukkit.ChatColor getColor()
Gets the color that this world's name/alias will display as.- Specified by:
getColor
in interfaceMultiverseWorld
- Returns:
- The color of this world.
-
getFakePVP
@Deprecated public boolean getFakePVP()
Deprecated.This is deprecated.Turn pvp on or off. This setting is used to set the world's PVP mode, and thus relies on fakePVP- Specified by:
getFakePVP
in interfaceMultiverseWorld
- Returns:
- True if this world has fakepvp on
-
getRespawnToWorld
public org.bukkit.World getRespawnToWorld()
Gets the world players will respawn in if they die in this one.- Specified by:
getRespawnToWorld
in interfaceMultiverseWorld
- Returns:
- A world that exists on the server.
-
setRespawnToWorld
public boolean setRespawnToWorld(java.lang.String respawnToWorld)
Sets the world players will respawn in if they die in this one. Returns true upon success, false upon failure.- Specified by:
setRespawnToWorld
in interfaceMultiverseWorld
- Parameters:
respawnToWorld
- The name of a world that exists on the server.- Returns:
- True if respawnWorld existed, false if not.
-
getAccessPermission
public org.bukkit.permissions.Permission getAccessPermission()
Gets the permission required to enter this world.- Specified by:
getAccessPermission
in interfaceMultiverseWorld
- Returns:
- The permission required to be exempt from charges to/from this world.
-
getCurrency
public org.bukkit.Material getCurrency()
Gets the type of currency that will be used when users enter this world. A value of null indicates a non-item based currency is used.- Specified by:
getCurrency
in interfaceMultiverseWorld
- Returns:
- The type of currency that will be used when users enter this world.
-
setCurrency
public void setCurrency(@Nullable @Nullable org.bukkit.Material currency)
Sets the type of item that will be required given the price is not 0. Use a value of null to specify a non-item based currency.- Specified by:
setCurrency
in interfaceMultiverseWorld
- Parameters:
currency
- The Type of currency that will be used when users enter this world.
-
getPrice
public double getPrice()
Gets the amount of currency it requires to enter this world.- Specified by:
getPrice
in interfaceMultiverseWorld
- Returns:
- The amount it costs to enter this world.
-
setPrice
public void setPrice(double price)
Sets the price for entry to this world. You can think of this like an amount. The type can be set withMultiverseWorld.setCurrency(Material)
- Specified by:
setPrice
in interfaceMultiverseWorld
- Parameters:
price
- The Amount of money/item to enter the world.
-
getExemptPermission
public org.bukkit.permissions.Permission getExemptPermission()
Gets the permission required to be exempt when entering.- Specified by:
getExemptPermission
in interfaceMultiverseWorld
- Returns:
- The permission required to be exempt when entering.
-
setGameMode
public boolean setGameMode(java.lang.String mode)
Sets the game mode of this world.- Specified by:
setGameMode
in interfaceMultiverseWorld
- Parameters:
mode
- A valid game mode string (either an int ex. 0 or a string ex. creative).- Returns:
- True if the game mode was successfully changed, false if not.
-
setGameMode
public boolean setGameMode(org.bukkit.GameMode mode)
Description copied from interface:MultiverseWorld
Sets the game mode of this world.- Specified by:
setGameMode
in interfaceMultiverseWorld
- Parameters:
mode
- The newGameMode
.- Returns:
- True if the game mode was successfully changed, false if not.
-
getGameMode
public org.bukkit.GameMode getGameMode()
Gets the GameMode of this world.- Specified by:
getGameMode
in interfaceMultiverseWorld
- Returns:
- The GameMode of this world.
-
setEnableWeather
public void setEnableWeather(boolean weather)
Sets whether or not there will be weather events in a given world. If set to false, Multiverse will disable the weather in the world immediately.- Specified by:
setEnableWeather
in interfaceMultiverseWorld
- Parameters:
weather
- True if weather events should occur in a world, false if not.
-
isWeatherEnabled
public boolean isWeatherEnabled()
Gets whether weather is enabled in this world.- Specified by:
isWeatherEnabled
in interfaceMultiverseWorld
- Returns:
- True if weather events will occur, false if not.
-
isKeepingSpawnInMemory
public boolean isKeepingSpawnInMemory()
Gets whether or not CraftBukkit is keeping the chunks for this world in memory.- Specified by:
isKeepingSpawnInMemory
in interfaceMultiverseWorld
- Returns:
- True if CraftBukkit is keeping spawn chunks in memory.
-
setKeepSpawnInMemory
public void setKeepSpawnInMemory(boolean value)
If true, tells Craftbukkit to keep a worlds spawn chunks loaded in memory (default: true) If not, CraftBukkit will attempt to free memory when players have not used that world. This will not happen immediately.- Specified by:
setKeepSpawnInMemory
in interfaceMultiverseWorld
- Parameters:
value
- If true, CraftBukkit will keep the spawn chunks loaded in memory.
-
getHunger
public boolean getHunger()
Gets whether or not the hunger level of players will go down in a world.- Specified by:
getHunger
in interfaceMultiverseWorld
- Returns:
- True if it will go down, false if it will remain steady.
-
setHunger
public void setHunger(boolean hunger)
Sets whether or not the hunger level of players will go down in a world.- Specified by:
setHunger
in interfaceMultiverseWorld
- Parameters:
hunger
- True if hunger will go down, false to keep it at the level they entered a world with.
-
getSpawnLocation
public org.bukkit.Location getSpawnLocation()
Gets the spawn location of this world.- Specified by:
getSpawnLocation
in interfaceMultiverseWorld
- Returns:
- The spawn location of this world.
-
setSpawnLocation
public void setSpawnLocation(org.bukkit.Location l)
Sets the spawn location for a world.- Specified by:
setSpawnLocation
in interfaceMultiverseWorld
- Parameters:
l
- The spawn location for a world.
-
getDifficulty
public org.bukkit.Difficulty getDifficulty()
Gets the difficulty of this world.- Specified by:
getDifficulty
in interfaceMultiverseWorld
- Returns:
- The difficulty of this world.
-
setDifficulty
@Deprecated public boolean setDifficulty(java.lang.String difficulty)
Deprecated.This is deprecated.Sets the difficulty of this world and returns true if success. Valid string values are either an integer of difficulty(0-3) or the name that resides in the Bukkit enum, ex.PEACEFUL
- Specified by:
setDifficulty
in interfaceMultiverseWorld
- Parameters:
difficulty
- The difficulty to set the world to as a string.- Returns:
- True if success, false if the provided string could not be translated to a difficulty.
-
setDifficulty
public boolean setDifficulty(org.bukkit.Difficulty difficulty)
Description copied from interface:MultiverseWorld
Sets the difficulty of this world and returnstrue
on success. Valid string values are either an integer of difficulty(0-3) or the name that resides in the Bukkit enum, ex. PEACEFUL- Specified by:
setDifficulty
in interfaceMultiverseWorld
- Parameters:
difficulty
- The new difficulty.- Returns:
- True if success, false if the operation failed... for whatever reason.
-
getAutoHeal
public boolean getAutoHeal()
Gets whether or not a world will auto-heal players if the difficulty is on peaceful.- Specified by:
getAutoHeal
in interfaceMultiverseWorld
- Returns:
- True if the world should heal (default), false if not.
-
setAutoHeal
public void setAutoHeal(boolean heal)
Sets whether or not a world will auto-heal players if the difficulty is on peaceful.- Specified by:
setAutoHeal
in interfaceMultiverseWorld
- Parameters:
heal
- True if the world will heal.
-
setAdjustSpawn
public void setAdjustSpawn(boolean adjust)
Sets whether or not Multiverse should auto-adjust the spawn for this world.- Specified by:
setAdjustSpawn
in interfaceMultiverseWorld
- Parameters:
adjust
- True if multiverse should adjust the spawn, false if not.
-
getAdjustSpawn
public boolean getAdjustSpawn()
Gets whether or not Multiverse should auto-adjust the spawn for this world.- Specified by:
getAdjustSpawn
in interfaceMultiverseWorld
- Returns:
- True if Multiverse should adjust the spawn, false if not.
-
setAutoLoad
public void setAutoLoad(boolean load)
Sets whether or not Multiverse should auto-load this world.True is default.
- Specified by:
setAutoLoad
in interfaceMultiverseWorld
- Parameters:
load
- True if multiverse should autoload this world the spawn, false if not.
-
getAutoLoad
public boolean getAutoLoad()
Gets whether or not Multiverse should auto-load this world.- Specified by:
getAutoLoad
in interfaceMultiverseWorld
- Returns:
- True if Multiverse should auto-load this world.
-
setBedRespawn
public void setBedRespawn(boolean respawn)
Sets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.True is default.
- Specified by:
setBedRespawn
in interfaceMultiverseWorld
- Parameters:
respawn
- True if players dying in this world respawn at their bed.
-
getBedRespawn
public boolean getBedRespawn()
Gets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.- Specified by:
getBedRespawn
in interfaceMultiverseWorld
- Returns:
- True if players dying in this world should respawn at their bed.
-
getAllPropertyNames
public java.lang.String getAllPropertyNames()
Gets all the names of all properties that can be SET.- Specified by:
getAllPropertyNames
in interfaceMultiverseWorld
- Returns:
- All property names, with alternating colors.
-
getTime
public java.lang.String getTime()
Same asMultiverseWorld.getTime()
, but returns a string.- Specified by:
getTime
in interfaceMultiverseWorld
- Returns:
- The time as a short string: 12:34pm
-
setTime
public boolean setTime(java.lang.String timeAsString)
Sets the current time in a world.This method will take the following formats: 11:37am 4:30p day(morning), night, noon, midnight
- Specified by:
setTime
in interfaceMultiverseWorld
- Parameters:
timeAsString
- The formatted time to set the world to.- Returns:
- True if the time was set, false if not.
-
getAllowedPortals
public AllowedPortalType getAllowedPortals()
Gets which type(s) of portals are allowed to be constructed in this world.- Specified by:
getAllowedPortals
in interfaceMultiverseWorld
- Returns:
- The type of portals that are allowed.
-
allowPortalMaking
public void allowPortalMaking(AllowedPortalType portalType)
Sets The types of portals that are allowed in this world.- Specified by:
allowPortalMaking
in interfaceMultiverseWorld
- Parameters:
portalType
- The type of portals allowed in this world.
-
getStyle
public org.bukkit.ChatColor getStyle()
Gets the style that this world's name/alias will display as.- Specified by:
getStyle
in interfaceMultiverseWorld
- Returns:
- The style of this world.
null
for "normal" style.
-
setStyle
public boolean setStyle(java.lang.String style)
Sets the style that this world's name/alias will display as.- Specified by:
setStyle
in interfaceMultiverseWorld
- Parameters:
style
- A valid style name.- Returns:
- True if the style was set, false if not.
-
getAllowFlight
public boolean getAllowFlight()
Whether or not players are allowed to fly in this world.- Specified by:
getAllowFlight
in interfaceMultiverseWorld
- Returns:
- True if players allowed to fly in this world.
-
setAllowFlight
public void setAllowFlight(boolean allowFlight)
Sets whether or not players are allowed to fly in this world.- Specified by:
setAllowFlight
in interfaceMultiverseWorld
- Parameters:
allowFlight
- True to allow flight in this world.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-