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 classMVWorld.NullLocationNull-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 booleanaddToVariable(java.lang.String property, java.lang.String value)Deprecated.This is deprecated.voidallowPortalMaking(AllowedPortalType portalType)Sets The types of portals that are allowed in this world.booleancanAnimalsSpawn()Gets whether or not animals are allowed to spawn in this world.booleancanMonstersSpawn()Gets whether or not monsters are allowed to spawn in this world.booleanclearList(java.lang.String property)Deprecated.This is deprecated.booleanclearVariable(java.lang.String property)Deprecated.This is deprecated.voidcopyValues(MVWorld other)Copies all properties from anotherMVWorldobject.voidcopyValues(WorldProperties other)Copies all properties from aWorldPropertiesobject.org.bukkit.permissions.PermissiongetAccessPermission()Gets the permission required to enter this world.booleangetAdjustSpawn()Gets whether or not Multiverse should auto-adjust the spawn for this world.java.lang.StringgetAlias()Gets the alias of this world.AllowedPortalTypegetAllowedPortals()Gets which type(s) of portals are allowed to be constructed in this world.booleangetAllowFlight()Whether or not players are allowed to fly in this world.java.lang.StringgetAllPropertyNames()Gets all the names of all properties that can be SET.java.util.List<java.lang.String>getAnimalList()Returns a list of animals.booleangetAutoHeal()Gets whether or not a world will auto-heal players if the difficulty is on peaceful.booleangetAutoLoad()Gets whether or not Multiverse should auto-load this world.booleangetBedRespawn()Gets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.org.bukkit.WorldgetCBWorld()Returns the Bukkit world object that this world describes.org.bukkit.ChatColorgetColor()Gets the color that this world's name/alias will display as.java.lang.StringgetColoredWorldString()Returns a very nicely colored string (using Alias and Color if they are set).org.bukkit.MaterialgetCurrency()Gets the type of currency that will be used when users enter this world.org.bukkit.DifficultygetDifficulty()Gets the difficulty of this world.org.bukkit.World.EnvironmentgetEnvironment()Gets the environment of this world.org.bukkit.permissions.PermissiongetExemptPermission()Gets the permission required to be exempt when entering.booleangetFakePVP()Deprecated.This is deprecated.org.bukkit.GameModegetGameMode()Gets the GameMode of this world.java.lang.StringgetGenerator()Gets the generator of this world.booleangetHunger()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.StringgetName()Gets the name of this world.java.lang.StringgetPermissibleName()Gets the lowercased name of the world.intgetPlayerLimit()Gets the player limit for this world after which players without an override permission node will not be allowed in.doublegetPrice()Gets the amount of currency it requires to enter this world.java.lang.StringgetPropertyHelp(java.lang.String property)Gets the help-message for a property.java.lang.StringgetPropertyValue(java.lang.String property)Gets a property asString.org.bukkit.WorldgetRespawnToWorld()Gets the world players will respawn in if they die in this one.doublegetScaling()Gets the scaling value of this world.Really only has an effect if you use Multiverse-NetherPortals.longgetSeed()Gets the world seed of this world.org.bukkit.LocationgetSpawnLocation()Gets the spawn location of this world.org.bukkit.ChatColorgetStyle()Gets the style that this world's name/alias will display as.java.lang.StringgetTime()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.WorldTypegetWorldType()Gets the type of this world.booleanisHidden()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.booleanisKeepingSpawnInMemory()Gets whether or not CraftBukkit is keeping the chunks for this world in memory.booleanisPVPEnabled()Gets whether or not PVP is enabled in this world in some form (fake or not).booleanisValidAliasColor(java.lang.String aliasColor)Deprecated.This is deprecated.booleanisWeatherEnabled()Gets whether weather is enabled in this world.booleanremoveFromVariable(java.lang.String property, java.lang.String value)Deprecated.This is deprecated.voidsetAdjustSpawn(boolean adjust)Sets whether or not Multiverse should auto-adjust the spawn for this world.voidsetAlias(java.lang.String alias)Sets the alias of the world.voidsetAllowAnimalSpawn(boolean animals)Sets whether or not animals can spawn.voidsetAllowFlight(boolean allowFlight)Sets whether or not players are allowed to fly in this world.voidsetAllowMonsterSpawn(boolean monsters)Sets whether or not monsters can spawn.voidsetAutoHeal(boolean heal)Sets whether or not a world will auto-heal players if the difficulty is on peaceful.voidsetAutoLoad(boolean load)Sets whether or not Multiverse should auto-load this world.voidsetBedRespawn(boolean respawn)Sets whether or not a player who dies in this world will respawn in their bed or follow the normal respawn pattern.booleansetColor(java.lang.String aliasColor)Sets the color that this world's name/alias will display as.voidsetCurrency(@Nullable org.bukkit.Material currency)Sets the type of item that will be required given the price is not 0.booleansetDifficulty(java.lang.String difficulty)Deprecated.This is deprecated.booleansetDifficulty(org.bukkit.Difficulty difficulty)Sets the difficulty of this world and returnstrueon success.voidsetEnableWeather(boolean weather)Sets whether or not there will be weather events in a given world.voidsetEnvironment(org.bukkit.World.Environment environment)Sets the environment of a world.booleansetGameMode(java.lang.String mode)Sets the game mode of this world.booleansetGameMode(org.bukkit.GameMode mode)Sets the game mode of this world.voidsetGenerator(java.lang.String generator)Sets the generator of this world.voidsetHidden(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.voidsetHunger(boolean hunger)Sets whether or not the hunger level of players will go down in a world.voidsetKeepSpawnInMemory(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.voidsetPlayerLimit(int limit)Sets the player limit for this world after which players without an override permission node will not be allowed in.voidsetPrice(double price)Sets the price for entry to this world.booleansetPropertyValue(java.lang.String property, java.lang.String value)Sets a property to a given value.voidsetPVPMode(boolean pvp)Turn pvp on or off.booleansetRespawnToWorld(java.lang.String respawnToWorld)Sets the world players will respawn in if they die in this one.booleansetScaling(double scaling)Sets the scale of this world.voidsetSeed(long seed)Sets the seed of this world.voidsetSpawnLocation(org.bukkit.Location l)Sets the spawn location for a world.booleansetStyle(java.lang.String style)Sets the style that this world's name/alias will display as.booleansetTime(java.lang.String timeAsString)Sets the current time in a world.java.lang.StringtoString()voidvalidateEntitySpawns()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 anotherMVWorldobject.- Parameters:
other- The other world object.
-
copyValues
public void copyValues(WorldProperties other)
Copies all properties from aWorldPropertiesobject.- Parameters:
other- The world properties object.
-
getCBWorld
public org.bukkit.World getCBWorld()
Returns the Bukkit world object that this world describes.- Specified by:
getCBWorldin 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:
getColoredWorldStringin 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:
clearListin 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:
clearVariablein interfaceMultiverseWorld- Parameters:
property- The name of aAddPropertiesto 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:
addToVariablein interfaceMultiverseWorld- Parameters:
property- The name of aAddPropertiesto 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:
removeFromVariablein interfaceMultiverseWorld- Parameters:
property- The name of aAddPropertiesto 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 PropertyDoesNotExistExceptionGets a property asString.- Specified by:
getPropertyValuein 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 PropertyDoesNotExistExceptionSets a property to a given value.- Specified by:
setPropertyValuein 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 PropertyDoesNotExistExceptionGets the help-message for a property.- Specified by:
getPropertyHelpin 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:
getWorldTypein interfaceMultiverseWorld- Returns:
- The Type of this world.
-
getEnvironment
public org.bukkit.World.Environment getEnvironment()
Gets the environment of this world.- Specified by:
getEnvironmentin 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:
setEnvironmentin interfaceMultiverseWorld- Parameters:
environment- AWorld.Environment.
-
getSeed
public long getSeed()
Gets the world seed of this world.- Specified by:
getSeedin interfaceMultiverseWorld- Returns:
- The Long version of the seed.
-
setSeed
public void setSeed(long seed)
Sets the seed of this world.- Specified by:
setSeedin interfaceMultiverseWorld- Parameters:
seed- A Long that is the seed.
-
getGenerator
public java.lang.String getGenerator()
Gets the generator of this world.- Specified by:
getGeneratorin interfaceMultiverseWorld- Returns:
- The name of the generator.
-
setGenerator
public void setGenerator(java.lang.String generator)
Sets the generator of this world.- Specified by:
setGeneratorin 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:
getPlayerLimitin 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:
setPlayerLimitin 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:
getNamein 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:
getPermissibleNamein 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:
getAliasin 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:
setAliasin 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:
canAnimalsSpawnin 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:
setAllowAnimalSpawnin 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:
getAnimalListin 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:
canMonstersSpawnin 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:
setAllowMonsterSpawnin 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:
getMonsterListin 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:
isPVPEnabledin 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:
setPVPModein 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:
isHiddenin 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:
setHiddenin 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:
getWorldBlacklistin 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:
getScalingin 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:
setScalingin 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:
setColorin 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:
isValidAliasColorin 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:
getColorin 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:
getFakePVPin 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:
getRespawnToWorldin 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:
setRespawnToWorldin 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:
getAccessPermissionin 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:
getCurrencyin 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:
setCurrencyin 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:
getPricein 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:
setPricein 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:
getExemptPermissionin 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:
setGameModein 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:MultiverseWorldSets the game mode of this world.- Specified by:
setGameModein 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:
getGameModein 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:
setEnableWeatherin 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:
isWeatherEnabledin 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:
isKeepingSpawnInMemoryin 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:
setKeepSpawnInMemoryin 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:
getHungerin 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:
setHungerin 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:
getSpawnLocationin 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:
setSpawnLocationin interfaceMultiverseWorld- Parameters:
l- The spawn location for a world.
-
getDifficulty
public org.bukkit.Difficulty getDifficulty()
Gets the difficulty of this world.- Specified by:
getDifficultyin 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:
setDifficultyin 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:MultiverseWorldSets the difficulty of this world and returnstrueon 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:
setDifficultyin 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:
getAutoHealin 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:
setAutoHealin 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:
setAdjustSpawnin 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:
getAdjustSpawnin 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:
setAutoLoadin 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:
getAutoLoadin 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:
setBedRespawnin 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:
getBedRespawnin 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:
getAllPropertyNamesin interfaceMultiverseWorld- Returns:
- All property names, with alternating colors.
-
getTime
public java.lang.String getTime()
Same asMultiverseWorld.getTime(), but returns a string.- Specified by:
getTimein 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:
setTimein 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:
getAllowedPortalsin 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:
allowPortalMakingin 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:
getStylein interfaceMultiverseWorld- Returns:
- The style of this world.
nullfor "normal" style.
-
setStyle
public boolean setStyle(java.lang.String style)
Sets the style that this world's name/alias will display as.- Specified by:
setStylein 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:
getAllowFlightin 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:
setAllowFlightin interfaceMultiverseWorld- Parameters:
allowFlight- True to allow flight in this world.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-