Record Class EnvironmentAttributes
java.lang.Object
java.lang.Record
fr.fidorial.world.environment.EnvironmentAttributes
- Record Components:
fogColor- distance fog color, packed RGB —minecraft:visual/fog_colorfogStartDistance- distance in blocks at which fog begins —minecraft:visual/fog_start_distancefogEndDistance- distance in blocks at which fog reaches full density —minecraft:visual/fog_end_distanceskyColor- sky color, packed RGB —minecraft:visual/sky_colorcloudColor- cloud color, packed ARGB —minecraft:visual/cloud_colorcloudHeight- height, in blocks, at which clouds render —minecraft:visual/cloud_heightskyLightColor- sky light color, packed RGB —minecraft:visual/sky_light_colorskyLightFactor- multiplier applied to sky light, within[0, 1]—minecraft:visual/sky_light_factorambientLightColor- ambient light color, packed RGB —minecraft:visual/ambient_light_colordefaultDripstoneParticle- particle used by dripping dripstone —minecraft:visual/default_dripstone_particlewaterFogColor- underwater fog color, packed RGB —minecraft:visual/water_fog_colorwaterFogEndDistance- distance in blocks at which underwater fog reaches full density —minecraft:visual/water_fog_end_distancemusicVolume- volume music fades to, within[0, 1]—minecraft:audio/music_volumecanStartRaid- whether a raid can begin here —minecraft:gameplay/can_start_raidcanPillagerPatrolSpawn- whether pillager patrols spawn here —minecraft:gameplay/can_pillager_patrol_spawnwaterEvaporates- whether placed water evaporates —minecraft:gameplay/water_evaporatesbedRule- when beds are usable to sleep/set spawn —minecraft:gameplay/bed_rulerespawnAnchorWorks- whether respawn anchors set spawn instead of exploding —minecraft:gameplay/respawn_anchor_worksnetherPortalSpawnsPiglin- whether entering a nether portal can spawn a piglin —minecraft:gameplay/nether_portal_spawns_piglinfastLava- whether lava flows and spreads at Nether speed —minecraft:gameplay/fast_lavaincreasedFireBurnout- whether fire burns out faster —minecraft:gameplay/increased_fire_burnoutpiglinsZombify- whether piglins and hoglins zombify —minecraft:gameplay/piglins_zombifysnowGolemMelts- whether snow golems take damage —minecraft:gameplay/snow_golem_meltsskyLightLevel- sky light level, within[0, 15]—minecraft:gameplay/sky_light_levelambientParticles- particles randomly spawned around the camera, possibly empty —minecraft:visual/ambient_particlesambientSounds- looping, mood and additions sounds —minecraft:audio/ambient_soundsbackgroundMusic- music tracks —minecraft:audio/background_music
public record EnvironmentAttributes(@Nullable Attribute<Integer> fogColor, @Nullable Attribute<Float> fogStartDistance, @Nullable Attribute<Float> fogEndDistance, @Nullable Attribute<Integer> skyColor, @Nullable Attribute<Integer> cloudColor, @Nullable Attribute<Float> cloudHeight, @Nullable Attribute<Integer> skyLightColor, @Nullable Attribute<Float> skyLightFactor, @Nullable Attribute<Integer> ambientLightColor, @Nullable Attribute<Key> defaultDripstoneParticle, @Nullable Attribute<Integer> waterFogColor, @Nullable Attribute<Float> waterFogEndDistance, @Nullable Attribute<Float> musicVolume, @Nullable Attribute<Boolean> canStartRaid, @Nullable Attribute<Boolean> canPillagerPatrolSpawn, @Nullable Attribute<Boolean> waterEvaporates, @Nullable Attribute<BedRule> bedRule, @Nullable Attribute<Boolean> respawnAnchorWorks, @Nullable Attribute<Boolean> netherPortalSpawnsPiglin, @Nullable Attribute<Boolean> fastLava, @Nullable Attribute<Boolean> increasedFireBurnout, @Nullable Attribute<Boolean> piglinsZombify, @Nullable Attribute<Boolean> snowGolemMelts, @Nullable Attribute<Float> skyLightLevel, List<AmbientParticle> ambientParticles, @Nullable AmbientSounds ambientSounds, @Nullable BackgroundMusic backgroundMusic)
extends Record
- Since:
- 0.1.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnvironmentAttributesSets nothing, letting the dimension and the vanilla defaults decide everything. -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentAttributes(@Nullable Attribute<Integer> fogColor, @Nullable Attribute<Float> fogStartDistance, @Nullable Attribute<Float> fogEndDistance, @Nullable Attribute<Integer> skyColor, @Nullable Attribute<Integer> cloudColor, @Nullable Attribute<Float> cloudHeight, @Nullable Attribute<Integer> skyLightColor, @Nullable Attribute<Float> skyLightFactor, @Nullable Attribute<Integer> ambientLightColor, @Nullable Attribute<Key> defaultDripstoneParticle, @Nullable Attribute<Integer> waterFogColor, @Nullable Attribute<Float> waterFogEndDistance, @Nullable Attribute<Float> musicVolume, @Nullable Attribute<Boolean> canStartRaid, @Nullable Attribute<Boolean> canPillagerPatrolSpawn, @Nullable Attribute<Boolean> waterEvaporates, @Nullable Attribute<BedRule> bedRule, @Nullable Attribute<Boolean> respawnAnchorWorks, @Nullable Attribute<Boolean> netherPortalSpawnsPiglin, @Nullable Attribute<Boolean> fastLava, @Nullable Attribute<Boolean> increasedFireBurnout, @Nullable Attribute<Boolean> piglinsZombify, @Nullable Attribute<Boolean> snowGolemMelts, @Nullable Attribute<Float> skyLightLevel, List<AmbientParticle> ambientParticles, @Nullable AmbientSounds ambientSounds, @Nullable BackgroundMusic backgroundMusic) Creates an instance of aEnvironmentAttributesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theambientLightColorrecord component.Returns the value of theambientParticlesrecord component.Returns the value of theambientSoundsrecord component.Returns the value of thebackgroundMusicrecord component.bedRule()Returns the value of thebedRulerecord component.builder()Returns a new, empty builder.builder(EnvironmentAttributes attributes) Returns a new builder pre-filled with the values ofattributes.Returns the value of thecanPillagerPatrolSpawnrecord component.Returns the value of thecanStartRaidrecord component.Returns the value of thecloudColorrecord component.Returns the value of thecloudHeightrecord component.Returns the value of thedefaultDripstoneParticlerecord component.final booleanIndicates whether some other object is "equal to" this one.fastLava()Returns the value of thefastLavarecord component.fogColor()Returns the value of thefogColorrecord component.Returns the value of thefogEndDistancerecord component.Returns the value of thefogStartDistancerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theincreasedFireBurnoutrecord component.booleanisEmpty()Returns whether this sets no attribute at all.Returns the value of themusicVolumerecord component.Returns the value of thenetherPortalSpawnsPiglinrecord component.Returns the value of thepiglinsZombifyrecord component.Returns the value of therespawnAnchorWorksrecord component.skyColor()Returns the value of theskyColorrecord component.static intskyColorFor(float temperature) Computes the sky color the vanilla generator derives from a given temperature.Returns the value of theskyLightColorrecord component.Returns the value of theskyLightFactorrecord component.Returns the value of theskyLightLevelrecord component.Returns the value of thesnowGolemMeltsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thewaterEvaporatesrecord component.Returns the value of thewaterFogColorrecord component.Returns the value of thewaterFogEndDistancerecord component.
-
Field Details
-
EMPTY
Sets nothing, letting the dimension and the vanilla defaults decide everything.
-
-
Constructor Details
-
EnvironmentAttributes
public EnvironmentAttributes(@Nullable Attribute<Integer> fogColor, @Nullable Attribute<Float> fogStartDistance, @Nullable Attribute<Float> fogEndDistance, @Nullable Attribute<Integer> skyColor, @Nullable Attribute<Integer> cloudColor, @Nullable Attribute<Float> cloudHeight, @Nullable Attribute<Integer> skyLightColor, @Nullable Attribute<Float> skyLightFactor, @Nullable Attribute<Integer> ambientLightColor, @Nullable Attribute<Key> defaultDripstoneParticle, @Nullable Attribute<Integer> waterFogColor, @Nullable Attribute<Float> waterFogEndDistance, @Nullable Attribute<Float> musicVolume, @Nullable Attribute<Boolean> canStartRaid, @Nullable Attribute<Boolean> canPillagerPatrolSpawn, @Nullable Attribute<Boolean> waterEvaporates, @Nullable Attribute<BedRule> bedRule, @Nullable Attribute<Boolean> respawnAnchorWorks, @Nullable Attribute<Boolean> netherPortalSpawnsPiglin, @Nullable Attribute<Boolean> fastLava, @Nullable Attribute<Boolean> increasedFireBurnout, @Nullable Attribute<Boolean> piglinsZombify, @Nullable Attribute<Boolean> snowGolemMelts, @Nullable Attribute<Float> skyLightLevel, List<AmbientParticle> ambientParticles, @Nullable AmbientSounds ambientSounds, @Nullable BackgroundMusic backgroundMusic) Creates an instance of aEnvironmentAttributesrecord class.- Parameters:
fogColor- the value for thefogColorrecord componentfogStartDistance- the value for thefogStartDistancerecord componentfogEndDistance- the value for thefogEndDistancerecord componentskyColor- the value for theskyColorrecord componentcloudColor- the value for thecloudColorrecord componentcloudHeight- the value for thecloudHeightrecord componentskyLightColor- the value for theskyLightColorrecord componentskyLightFactor- the value for theskyLightFactorrecord componentambientLightColor- the value for theambientLightColorrecord componentdefaultDripstoneParticle- the value for thedefaultDripstoneParticlerecord componentwaterFogColor- the value for thewaterFogColorrecord componentwaterFogEndDistance- the value for thewaterFogEndDistancerecord componentmusicVolume- the value for themusicVolumerecord componentcanStartRaid- the value for thecanStartRaidrecord componentcanPillagerPatrolSpawn- the value for thecanPillagerPatrolSpawnrecord componentwaterEvaporates- the value for thewaterEvaporatesrecord componentbedRule- the value for thebedRulerecord componentrespawnAnchorWorks- the value for therespawnAnchorWorksrecord componentnetherPortalSpawnsPiglin- the value for thenetherPortalSpawnsPiglinrecord componentfastLava- the value for thefastLavarecord componentincreasedFireBurnout- the value for theincreasedFireBurnoutrecord componentpiglinsZombify- the value for thepiglinsZombifyrecord componentsnowGolemMelts- the value for thesnowGolemMeltsrecord componentskyLightLevel- the value for theskyLightLevelrecord componentambientParticles- the value for theambientParticlesrecord componentambientSounds- the value for theambientSoundsrecord componentbackgroundMusic- the value for thebackgroundMusicrecord component
-
-
Method Details
-
builder
Returns a new, empty builder.- Returns:
- a new, empty builder
-
builder
@Contract(value="_ -> new", pure=true) public static EnvironmentAttributes.Builder builder(EnvironmentAttributes attributes) Returns a new builder pre-filled with the values ofattributes.- Parameters:
attributes- the attributes to copy- Returns:
- a new builder pre-filled with the values of
attributes
-
skyColorFor
public static int skyColorFor(float temperature) Computes the sky color the vanilla generator derives from a given temperature.- Parameters:
temperature- the biome temperature- Returns:
- the packed RGB sky color
-
isEmpty
public boolean isEmpty()Returns whether this sets no attribute at all.- Returns:
- whether this sets no attribute at all
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
fogColor
-
fogStartDistance
Returns the value of thefogStartDistancerecord component.- Returns:
- the value of the
fogStartDistancerecord component
-
fogEndDistance
Returns the value of thefogEndDistancerecord component.- Returns:
- the value of the
fogEndDistancerecord component
-
skyColor
-
cloudColor
Returns the value of thecloudColorrecord component.- Returns:
- the value of the
cloudColorrecord component
-
cloudHeight
Returns the value of thecloudHeightrecord component.- Returns:
- the value of the
cloudHeightrecord component
-
skyLightColor
Returns the value of theskyLightColorrecord component.- Returns:
- the value of the
skyLightColorrecord component
-
skyLightFactor
Returns the value of theskyLightFactorrecord component.- Returns:
- the value of the
skyLightFactorrecord component
-
ambientLightColor
Returns the value of theambientLightColorrecord component.- Returns:
- the value of the
ambientLightColorrecord component
-
defaultDripstoneParticle
Returns the value of thedefaultDripstoneParticlerecord component.- Returns:
- the value of the
defaultDripstoneParticlerecord component
-
waterFogColor
Returns the value of thewaterFogColorrecord component.- Returns:
- the value of the
waterFogColorrecord component
-
waterFogEndDistance
Returns the value of thewaterFogEndDistancerecord component.- Returns:
- the value of the
waterFogEndDistancerecord component
-
musicVolume
Returns the value of themusicVolumerecord component.- Returns:
- the value of the
musicVolumerecord component
-
canStartRaid
Returns the value of thecanStartRaidrecord component.- Returns:
- the value of the
canStartRaidrecord component
-
canPillagerPatrolSpawn
Returns the value of thecanPillagerPatrolSpawnrecord component.- Returns:
- the value of the
canPillagerPatrolSpawnrecord component
-
waterEvaporates
Returns the value of thewaterEvaporatesrecord component.- Returns:
- the value of the
waterEvaporatesrecord component
-
bedRule
-
respawnAnchorWorks
Returns the value of therespawnAnchorWorksrecord component.- Returns:
- the value of the
respawnAnchorWorksrecord component
-
netherPortalSpawnsPiglin
Returns the value of thenetherPortalSpawnsPiglinrecord component.- Returns:
- the value of the
netherPortalSpawnsPiglinrecord component
-
fastLava
-
increasedFireBurnout
Returns the value of theincreasedFireBurnoutrecord component.- Returns:
- the value of the
increasedFireBurnoutrecord component
-
piglinsZombify
Returns the value of thepiglinsZombifyrecord component.- Returns:
- the value of the
piglinsZombifyrecord component
-
snowGolemMelts
Returns the value of thesnowGolemMeltsrecord component.- Returns:
- the value of the
snowGolemMeltsrecord component
-
skyLightLevel
Returns the value of theskyLightLevelrecord component.- Returns:
- the value of the
skyLightLevelrecord component
-
ambientParticles
Returns the value of theambientParticlesrecord component.- Returns:
- the value of the
ambientParticlesrecord component
-
ambientSounds
Returns the value of theambientSoundsrecord component.- Returns:
- the value of the
ambientSoundsrecord component
-
backgroundMusic
Returns the value of thebackgroundMusicrecord component.- Returns:
- the value of the
backgroundMusicrecord component
-