Class VirtualBiome
java.lang.Object
dev.wyck.renderer.packet.data.VirtualBiome
A class representing a "virtual" or fake custom biome designed for sending via packets.
The
Biome must exist and be registered, but phony custom biomes are never
actually set to any chunks and only exist for packet sending purposes.
Three conditions control where this biome applies:
conditional()— the inexpensive, biome-independent spatial gate ((player, chunkLocation)). Evaluated before the chunk is decoded, so put world/permission/region checks here.biomeCondition()— optional, biome-aware refinement ((player, snapshotChunkData)). Evaluated after decoding, only for chunks that passed the spatial gate. May benull, in which case it always passes.positionCondition()— optional, quart-resolution refinement evaluated for every biome cell after the chunk-level conditions pass.
- Since:
- 0.0.6
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for creating PhonyCustomBiome instances. -
Constructor Summary
ConstructorsConstructorDescriptionVirtualBiome(ResourceKey biomeResourceKey, List<BlockReplacement> blockReplacements, BiPredicate<Player, ChunkLocation> conditional, @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition, PacketHandler.Priority priority) Creates a virtual biome using chunk-level conditions only.VirtualBiome(ResourceKey biomeResourceKey, List<BlockReplacement> blockReplacements, BiPredicate<Player, ChunkLocation> conditional, @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition, @Nullable BiPredicate<Player, BiomePosition> positionCondition, PacketHandler.Priority priority) Creates a virtual biome. -
Method Summary
Modifier and TypeMethodDescriptionbiome()Gets theBiomeassociated with this phony biome.Gets the biome-aware refinement evaluated after the chunk is decoded.Gets the resource key of the biome this virtual biome renders.Gets the client-side block replacements applied alongside this biome.static VirtualBiome.Builderbuilder()Creates a new Builder instance.Gets the inexpensive, biome-independent spatial gate.booleaninthashCode()Gets the quart-resolution refinement evaluated for every biome cell.priority()Gets the priority used when multiple virtual biomes match.Converts this PhonyCustomBiome to a Builder.toString()
-
Constructor Details
-
VirtualBiome
@AsOf("3.3.0") public VirtualBiome(ResourceKey biomeResourceKey, List<BlockReplacement> blockReplacements, BiPredicate<Player, ChunkLocation> conditional, @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition, @Nullable BiPredicate<Player, BiomePosition> positionCondition, PacketHandler.Priority priority) Creates a virtual biome.- Parameters:
biomeResourceKey- the biome to renderblockReplacements- the client-side block replacementsconditional- the inexpensive chunk-level conditionbiomeCondition- the condition evaluated against decoded chunk datapositionCondition- the condition evaluated for every biome cellpriority- the priority used when multiple biomes match- Since:
- 3.3.0
-
VirtualBiome
@AsOf("0.0.6") public VirtualBiome(ResourceKey biomeResourceKey, List<BlockReplacement> blockReplacements, BiPredicate<Player, ChunkLocation> conditional, @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition, PacketHandler.Priority priority) Creates a virtual biome using chunk-level conditions only.- Parameters:
biomeResourceKey- the biome to renderblockReplacements- the client-side block replacementsconditional- the inexpensive chunk-level conditionbiomeCondition- the condition evaluated against decoded chunk datapriority- the priority used when multiple biomes match- Since:
- 0.0.6
-
-
Method Details
-
biomeResourceKey
Gets the resource key of the biome this virtual biome renders.- Returns:
- the biome resource key
- Since:
- 0.0.6
-
blockReplacements
Gets the client-side block replacements applied alongside this biome.- Returns:
- the block replacements
- Since:
- 0.0.6
-
conditional
Gets the inexpensive, biome-independent spatial gate.- Returns:
- the chunk-level condition
- Since:
- 0.0.6
-
biomeCondition
Gets the biome-aware refinement evaluated after the chunk is decoded.- Returns:
- the biome condition, or null if the chunk always passes
- Since:
- 2.2.0
-
positionCondition
Gets the quart-resolution refinement evaluated for every biome cell.- Returns:
- the position condition, or null if the whole chunk is affected
- Since:
- 3.3.0
-
priority
Gets the priority used when multiple virtual biomes match.- Returns:
- the priority
- Since:
- 0.0.6
-
biome
-
toBuilder
Converts this PhonyCustomBiome to a Builder.- Returns:
- A new Builder instance with the same properties as this instance.
- Since:
- 3.0.0
-
equals
-
hashCode
-
toString
-
builder
Creates a new Builder instance.- Returns:
- a new Builder instance
- Since:
- 0.0.10
-