Record Class VirtualBiome
java.lang.Object
java.lang.Record
dev.wyck.renderer.packet.data.VirtualBiome
@NullMarked
@AsOf("2.2.0")
public record VirtualBiome(ResourceKey biomeResourceKey, List<BlockReplacement> blockReplacements, BiPredicate<Player, ChunkLocation> conditional, @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition, PacketHandler.Priority priority)
extends Record
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.
Two conditions gate whether this biome applies to a chunk:
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.
- 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 an instance of aVirtualBiomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbiome()Gets theBiomeassociated with this phony biome.Returns the value of thebiomeConditionrecord component.Returns the value of thebiomeResourceKeyrecord component.Returns the value of theblockReplacementsrecord component.static VirtualBiome.Builderbuilder()Creates a new Builder instance.Returns the value of theconditionalrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.priority()Returns the value of thepriorityrecord component.Converts this PhonyCustomBiome to a Builder.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
VirtualBiome
public VirtualBiome(ResourceKey biomeResourceKey, List<BlockReplacement> blockReplacements, BiPredicate<Player, ChunkLocation> conditional, @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition, PacketHandler.Priority priority) Creates an instance of aVirtualBiomerecord class.- Parameters:
biomeResourceKey- the value for thebiomeResourceKeyrecord componentblockReplacements- the value for theblockReplacementsrecord componentconditional- the value for theconditionalrecord componentbiomeCondition- the value for thebiomeConditionrecord componentpriority- the value for thepriorityrecord component
-
-
Method Details
-
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
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). -
hashCode
-
builder
Creates a new Builder instance.- Returns:
- a new Builder instance
- Since:
- 0.0.10
-
toString
-
biomeResourceKey
Returns the value of thebiomeResourceKeyrecord component.- Returns:
- the value of the
biomeResourceKeyrecord component
-
blockReplacements
Returns the value of theblockReplacementsrecord component.- Returns:
- the value of the
blockReplacementsrecord component
-
conditional
Returns the value of theconditionalrecord component.- Returns:
- the value of the
conditionalrecord component
-
biomeCondition
Returns the value of thebiomeConditionrecord component.- Returns:
- the value of the
biomeConditionrecord component
-
priority
Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-