Class EnvironmentBuilder

java.lang.Object
de.freesoccerhdx.advancedworldcreatorapi.EnvironmentBuilder
All Implemented Interfaces:
org.bukkit.Keyed

public class EnvironmentBuilder extends Object implements org.bukkit.Keyed
Represents various types of options that may change the Environment of a World created with the WorldCreator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final EnvironmentBuilder
     
    static final EnvironmentBuilder
     
    static final EnvironmentBuilder
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    EnvironmentBuilder(org.bukkit.NamespacedKey namespacedKey)
    Creates an EnvironmentBuilder with default Overworld-Settings NOTE: Setting an already existing NamespacedKey will load stored settings
    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
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Gets the settings about if there is ambient light
    double
    Gets the settings about the scale of Coordinates when using Portals
    org.bukkit.NamespacedKey
    Gets the settings about the resource location for effects in the World
    Gets the settings about if the World has a fixed Worldtime or null for default Day-Night-Time
    int
    Gets the settings about the total height of the World
    org.bukkit.Tag<org.bukkit.Material>
    Gets the settings about the resource location for infinity burning blocks in the World
    org.bukkit.NamespacedKey
     
    int
    Gets the settings about the logical height of the World
    int
    Gets the settings about the lowest usable Y-Coordinate in the World
    int
    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 Works
    boolean
    Gets the settings about if Bedrock at the top of the World will generate
    boolean
    Gets the settings about if Players with Bad Omen-Effect can trigger Raids
    boolean
    Gets the settings about the World has Skylight
    boolean
    Gets the settings about the World is natural or not
    boolean
    Gets whether settings can be replaced with new one(true) or not(false)
    boolean
    Gets the settings about if Piglins shake and transform
    boolean
    Gets the settings about if Players can use respawn anchors.
    boolean
    Gets the settings about if Players with Bad Omen-Effect can trigger Raids
    setAmbientLight(Float ambientLight)
    How much light the dimension has, default is 0.1 for the Nether and 0.0 for Overworld and End
    setBedWorks(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 Cycle
    setHasCeiling(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 key
    setPiglinSafe(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.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public EnvironmentBuilder setAmbientLight(Float ambientLight)
      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

      public EnvironmentBuilder setBedWorks(boolean bedWorks)
      When false, the bed blows up when trying to sleep.
      Parameters:
      bedWorks - Whether to allow Beds
      Returns:
      This object, for chaining
    • setCoordinateScale

      public EnvironmentBuilder setCoordinateScale(double coordinateScale)
      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

      public EnvironmentBuilder 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)
      Parameters:
      effectsLocation - NamespacedKey to use for World-Effects
      Returns:
      This object, for chaining
    • setFixedTime

      public EnvironmentBuilder 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 Cycle
      Parameters:
      fixedTime - Time to set
      Returns:
      This object, for chaining
    • setHasCeiling

      public EnvironmentBuilder setHasCeiling(boolean hasCeiling)
      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

      public EnvironmentBuilder setHasRaids(boolean hasRaids)
      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

      public EnvironmentBuilder setHasSkylight(boolean hasSkylight)
      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

      public EnvironmentBuilder setHeight(int height)
      The total height in which blocks can exist within this World. This will count up from the setMinY(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. See GeneratorConfiguration to change the Terrain too.
      Parameters:
      height - The total height
      Returns:
      This object, for chaining
    • setInfiniburn

      public EnvironmentBuilder setInfiniburn(org.bukkit.Tag<org.bukkit.Material> infiniburn)
      A Tag defining what blocks can be used for infiniburn. Blocks with that Tag will burn normally forever. see Tag for some examples to use
      Parameters:
      infiniburn - The org.bukkit.Tag<org.bukkit.Material> to use
      Returns:
      This object, for chaining
    • setLogicalHeight

      public EnvironmentBuilder setLogicalHeight(int logicalHeight)
      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

      public EnvironmentBuilder setMinY(int minY)
      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

      public EnvironmentBuilder setNatural(boolean natural)
      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

      public EnvironmentBuilder setPiglinSafe(boolean piglinSafe)
      Whether piglins shake and transform to zombified piglins.
      Parameters:
      piglinSafe - If the World is safe for piglins
      Returns:
      This object, for chaining
    • setRespawnAnchorWorks

      public EnvironmentBuilder setRespawnAnchorWorks(boolean respawnAnchorWorks)
      Whether players can charge and use respawn anchors.
      Parameters:
      respawnAnchorWorks - If Players can use respawn anchors
      Returns:
      This object, for chaining
    • setUltraWarm

      public EnvironmentBuilder setUltraWarm(boolean ultraWarm)
      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

      public Long 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 interface org.bukkit.Keyed