Class EnvironmentBuilder
java.lang.Object
de.freesoccerhdx.advancedworldcreatorapi.EnvironmentBuilder
- All Implemented Interfaces:
org.bukkit.Keyed
Represents various types of options that may change the Environment of a World created with the WorldCreator
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EnvironmentBuilder
static final EnvironmentBuilder
static final EnvironmentBuilder
-
Constructor Summary
ConstructorDescriptionEnvironmentBuilder
(org.bukkit.NamespacedKey namespacedKey) Creates an EnvironmentBuilder with default Overworld-Settings NOTE: Setting an already existing NamespacedKey will load stored settingsEnvironmentBuilder
(org.bukkit.NamespacedKey namespacedKey, Long fixedTime, boolean hasSkylight, boolean hasCeiling, boolean ultraWarm, boolean natural, double coordinateScale, boolean piglinSafe, boolean bedWorks, boolean respawnAnchorWorks, boolean hasRaids, int minY, int height, int logicalHeight, org.bukkit.Tag<org.bukkit.Material> infiniburn, org.bukkit.NamespacedKey effectsLocation, float ambientLight) Creates an EnvironmentBuilder with every Option this Class has as Argument NOTE: Setting an already existing NamespacedKey will load stored settings -
Method Summary
Modifier and TypeMethodDescriptionfloat
Gets the settings about if there is ambient lightdouble
Gets the settings about the scale of Coordinates when using Portalsorg.bukkit.NamespacedKey
Gets the settings about the resource location for effects in the WorldGets the settings about if the World has a fixed Worldtime or null for default Day-Night-Timeint
Gets the settings about the total height of the Worldorg.bukkit.Tag<org.bukkit.Material>
Gets the settings about the resource location for infinity burning blocks in the Worldorg.bukkit.NamespacedKey
getKey()
int
Gets the settings about the logical height of the Worldint
getMinY()
Gets the settings about the lowest usable Y-Coordinate in the Worldint
Gets Maximum block light required when the monster spawns.int
Gets Maximum light required when the monster spawns.boolean
Gets the settings about if Bed Worksboolean
Gets the settings about if Bedrock at the top of the World will generateboolean
Gets the settings about if Players with Bad Omen-Effect can trigger Raidsboolean
Gets the settings about the World has Skylightboolean
Gets the settings about the World is natural or notboolean
Gets whether settings can be replaced with new one(true) or not(false)boolean
Gets the settings about if Piglins shake and transformboolean
Gets the settings about if Players can use respawn anchors.boolean
Gets the settings about if Players with Bad Omen-Effect can trigger RaidssetAmbientLight
(Float ambientLight) How much light the dimension has, default is 0.1 for the Nether and 0.0 for Overworld and EndsetBedWorks
(boolean bedWorks) When false, the bed blows up when trying to sleep.setCoordinateScale
(double coordinateScale) The multiplier applied to coordinates when traveling to the dimension.setEffectsLocation
(org.bukkit.NamespacedKey effectsLocation) Can be "minecraft:overworld", "minecraft:the_nether" and "minecraft:the_end" minecraft:overworld: World will have clouds, sun, stars and moon (like the Overworld) the_nether: World will have thick fog that blocks sight (like the Nether) the_end: World will have dark spotted sky (like the End)setFixedTime
(Long fixedTime) Can be null or any value from 0 to 24000 If set to null the World will have a normal Day and Night CyclesetHasCeiling
(boolean hasCeiling) Whether the dimension has a bedrock ceiling or not.setHasRaids
(boolean hasRaids) Whether players with the Bad Omen effect can cause a raid.setHasSkylight
(boolean hasSkylight) Whether the World has skylight access or not.setHeight
(int height) The total height in which blocks can exist within this World.setInfiniburn
(org.bukkit.Tag<org.bukkit.Material> infiniburn) A Tag defining what blocks can be used for infiniburn.setLogicalHeight
(int logicalHeight) The maximum height to which chorus fruits and nether portals can bring players within this World.setMinY
(int minY) The minimum height in which blocks can exist within this dimension.void
setMonsterSpawnBlockLightLimit
(int monsterSpawnBlockLightLimit) Sets Maximum block light required when the monster spawns.void
setMonsterSpawnLightTest
(int monsterSpawnLightTest) Sets Maximum light required when the monster spawns.setNatural
(boolean natural) When false, compasses spin randomly, and using a bed to set the respawn point or sleep, is disabled.void
setOverwriteSettingsIfExist
(boolean overwriteSettingsIfExist) Sets if those settings will overwrite existing settings with the same keysetPiglinSafe
(boolean piglinSafe) Whether piglins shake and transform to zombified piglins.setRespawnAnchorWorks
(boolean respawnAnchorWorks) Whether players can charge and use respawn anchors.setUltraWarm
(boolean ultraWarm) Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not.toString()
-
Field Details
-
OVERWORLD
-
THE_END
-
THE_NETHER
-
-
Constructor Details
-
EnvironmentBuilder
public EnvironmentBuilder(org.bukkit.NamespacedKey namespacedKey) Creates an EnvironmentBuilder with default Overworld-Settings NOTE: Setting an already existing NamespacedKey will load stored settings- Parameters:
namespacedKey
- A Key that can be used to load predefined settings (e.g. Datapacks or Mojang)
-
EnvironmentBuilder
public EnvironmentBuilder(org.bukkit.NamespacedKey namespacedKey, Long fixedTime, boolean hasSkylight, boolean hasCeiling, boolean ultraWarm, boolean natural, double coordinateScale, boolean piglinSafe, boolean bedWorks, boolean respawnAnchorWorks, boolean hasRaids, int minY, int height, int logicalHeight, org.bukkit.Tag<org.bukkit.Material> infiniburn, org.bukkit.NamespacedKey effectsLocation, float ambientLight) Creates an EnvironmentBuilder with every Option this Class has as Argument NOTE: Setting an already existing NamespacedKey will load stored settings- Parameters:
namespacedKey
- A Key that can be used to load predefined settings (e.g. Datapacks or Mojang)fixedTime
- seesetFixedTime(Long)
}hasSkylight
- seesetHasSkylight(boolean)
hasCeiling
- seesetHasCeiling(boolean)
ultraWarm
- seesetUltraWarm(boolean)
natural
- seesetNatural(boolean)
coordinateScale
- seesetCoordinateScale(double)
piglinSafe
- seesetPiglinSafe(boolean)
bedWorks
- seesetBedWorks(boolean)
respawnAnchorWorks
- seesetRespawnAnchorWorks(boolean)
hasRaids
- seesetHasRaids(boolean)
minY
- seesetMinY(int)
height
- seesetHeight(int)
logicalHeight
- seesetLogicalHeight(int)
infiniburn
- seesetInfiniburn(Tag<Material>)
effectsLocation
- seesetEffectsLocation(NamespacedKey)
ambientLight
- seesetAmbientLight(Float)
-
-
Method Details
-
toString
-
setOverwriteSettingsIfExist
public void setOverwriteSettingsIfExist(boolean overwriteSettingsIfExist) Sets if those settings will overwrite existing settings with the same key- Parameters:
overwriteSettingsIfExist
- If true allows to replace registered settings
-
isOverwriteSettingsIfExist
public boolean isOverwriteSettingsIfExist()Gets whether settings can be replaced with new one(true) or not(false)- Returns:
- If replacing is allowed or not
-
setAmbientLight
How much light the dimension has, default is 0.1 for the Nether and 0.0 for Overworld and End- Parameters:
ambientLight
- A float to set the Ambient-Light- Returns:
- This object, for chaining
-
setBedWorks
When false, the bed blows up when trying to sleep.- Parameters:
bedWorks
- Whether to allow Beds- Returns:
- This object, for chaining
-
setCoordinateScale
The multiplier applied to coordinates when traveling to the dimension. Nether has 8.0 while End and Overworld have 1.0- Parameters:
coordinateScale
- The scale of the coordinates- Returns:
- This object, for chaining
-
setEffectsLocation
Can be "minecraft:overworld", "minecraft:the_nether" and "minecraft:the_end" minecraft:overworld: World will have clouds, sun, stars and moon (like the Overworld) the_nether: World will have thick fog that blocks sight (like the Nether) the_end: World will have dark spotted sky (like the End)- Parameters:
effectsLocation
-NamespacedKey
to use for World-Effects- Returns:
- This object, for chaining
-
setFixedTime
Can be null or any value from 0 to 24000 If set to null the World will have a normal Day and Night Cycle- Parameters:
fixedTime
- Time to set- Returns:
- This object, for chaining
-
setHasCeiling
Whether the dimension has a bedrock ceiling or not. If set to true it will generate Bedrock at the Top like in the Nether- Parameters:
hasCeiling
- If a Ceiling should generate- Returns:
- This object, for chaining
-
setHasRaids
Whether players with the Bad Omen effect can cause a raid.- Parameters:
hasRaids
- If a Bad Omen can trigger- Returns:
- This object, for chaining
-
setHasSkylight
Whether the World has skylight access or not. If set to false Mobs will probably spawn all the time at the surface- Parameters:
hasSkylight
- If the World has Skylight- Returns:
- This object, for chaining
-
setHeight
The total height in which blocks can exist within this World. This will count up from thesetMinY(int)
: The maxY will be minY+Height (assuming minY is the exact value(-64 by default)) Should be between 15 and 4064 and be a multiple of 16. Note: THIS WILL NOT GENERATE EXTRA TERRAIN! It only allows to place blocks there. SeeGeneratorConfiguration
to change the Terrain too.- Parameters:
height
- The total height- Returns:
- This object, for chaining
-
setInfiniburn
A Tag defining what blocks can be used for infiniburn. Blocks with that Tag will burn normally forever. seeTag
for some examples to use- Parameters:
infiniburn
- Theorg.bukkit.Tag<org.bukkit.Material>
to use- Returns:
- This object, for chaining
-
setLogicalHeight
The maximum height to which chorus fruits and nether portals can bring players within this World. This excludes portals that were already built above the limit as they still connect normally. May not be greater than height.- Parameters:
logicalHeight
- The logical Height of the World- Returns:
- This object, for chaining
-
setMinY
The minimum height in which blocks can exist within this dimension. Should be between -2032 and 2016 and be a multiple of 16.- Parameters:
minY
- The lowest Y-Coordinate for usage- Returns:
- This object, for chaining
-
setNatural
When false, compasses spin randomly, and using a bed to set the respawn point or sleep, is disabled. When true, nether portals can spawn zombified piglins.- Parameters:
natural
- If the World is natural- Returns:
- This object, for chaining
-
setPiglinSafe
Whether piglins shake and transform to zombified piglins.- Parameters:
piglinSafe
- If the World is safe for piglins- Returns:
- This object, for chaining
-
setRespawnAnchorWorks
Whether players can charge and use respawn anchors.- Parameters:
respawnAnchorWorks
- If Players can use respawn anchors- Returns:
- This object, for chaining
-
setUltraWarm
Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not.- Parameters:
ultraWarm
- If the World is ultra Warm- Returns:
- This object, for chaining
-
setMonsterSpawnBlockLightLimit
public void setMonsterSpawnBlockLightLimit(int monsterSpawnBlockLightLimit) Sets Maximum block light required when the monster spawns. Value between 0 and 15 (both inclusive).- Parameters:
monsterSpawnBlockLightLimit
- The maximum light-level
-
setMonsterSpawnLightTest
public void setMonsterSpawnLightTest(int monsterSpawnLightTest) Sets Maximum light required when the monster spawns. Value between 0 and 15 (both inclusive). The formula of this light is: max( skyLight - 10, blockLight ) during thunderstorms, and max( internalSkyLight, blockLight ) during other weather.- Parameters:
monsterSpawnLightTest
- The maximum light-level
-
isBedWorks
public boolean isBedWorks()Gets the settings about if Bed Works- Returns:
- If Bed works in the World
-
isHasCeiling
public boolean isHasCeiling()Gets the settings about if Bedrock at the top of the World will generate- Returns:
- If Top-Bedrock will generate
-
isHasRaids
public boolean isHasRaids()Gets the settings about if Players with Bad Omen-Effect can trigger Raids- Returns:
- If Bad Omen triggers Raids
-
isHasSkylight
public boolean isHasSkylight()Gets the settings about the World has Skylight- Returns:
- If the World has Skylight
-
isNatural
public boolean isNatural()Gets the settings about the World is natural or not- Returns:
- If the World is natural
-
isPiglinSafe
public boolean isPiglinSafe()Gets the settings about if Piglins shake and transform- Returns:
- If the World is safe for Piglins
-
isRespawnAnchorWorks
public boolean isRespawnAnchorWorks()Gets the settings about if Players can use respawn anchors.- Returns:
- If the respawn anchors will work
-
isUltraWarm
public boolean isUltraWarm()Gets the settings about if Players with Bad Omen-Effect can trigger Raids- Returns:
- If Bad Omen triggers Raids
-
getCoordinateScale
public double getCoordinateScale()Gets the settings about the scale of Coordinates when using Portals- Returns:
- Gets the Coordinate scale
-
getAmbientLight
public float getAmbientLight()Gets the settings about if there is ambient light- Returns:
- Gets the ambient light
-
getHeight
public int getHeight()Gets the settings about the total height of the World- Returns:
- The total Height of the World
-
getLogicalHeight
public int getLogicalHeight()Gets the settings about the logical height of the World- Returns:
- The logical height of the World
-
getMinY
public int getMinY()Gets the settings about the lowest usable Y-Coordinate in the World- Returns:
- The lowest Y-Coordinate
-
getFixedTime
Gets the settings about if the World has a fixed Worldtime or null for default Day-Night-Time- Returns:
- Gets the fixed Worldtime or null
-
getEffectsLocation
public org.bukkit.NamespacedKey getEffectsLocation()Gets the settings about the resource location for effects in the World- Returns:
- The
NamespacedKey
for effects
-
getInfiniburn
public org.bukkit.Tag<org.bukkit.Material> getInfiniburn()Gets the settings about the resource location for infinity burning blocks in the World- Returns:
- The
NamespacedKey
for infinity burning blocks
-
getMonsterSpawnBlockLightLimit
public int getMonsterSpawnBlockLightLimit()Gets Maximum block light required when the monster spawns. Value between 0 and 15 (both inclusive).- Returns:
- The maximum light-level
-
getMonsterSpawnLightTest
public int getMonsterSpawnLightTest()Gets Maximum light required when the monster spawns. Value between 0 and 15 (both inclusive). The formula of this light is: max( skyLight - 10, blockLight ) during thunderstorms, and max( internalSkyLight, blockLight ) during other weather.- Returns:
- The maximum light-level
-
getKey
public org.bukkit.NamespacedKey getKey()- Specified by:
getKey
in interfaceorg.bukkit.Keyed
-