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 be null, in which case it always passes.
Since:
0.0.6
  • 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 a VirtualBiome record class.
      Parameters:
      biomeResourceKey - the value for the biomeResourceKey record component
      blockReplacements - the value for the blockReplacements record component
      conditional - the value for the conditional record component
      biomeCondition - the value for the biomeCondition record component
      priority - the value for the priority record component
  • Method Details

    • biome

      @AsOf("0.0.10") public Biome biome()
      Gets the Biome associated with this phony biome. If the custom biome does not exist, it will be created without being registered.
      Returns:
      the CustomBiome associated with this phony biome.
      Since:
      0.0.10
    • toBuilder

      @AsOf("3.0.0") public VirtualBiome.Builder toBuilder()
      Converts this PhonyCustomBiome to a Builder.
      Returns:
      A new Builder instance with the same properties as this instance.
      Since:
      3.0.0
    • equals

      public boolean equals(Object obj)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • builder

      @AsOf("0.0.10") public static VirtualBiome.Builder builder()
      Creates a new Builder instance.
      Returns:
      a new Builder instance
      Since:
      0.0.10
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • biomeResourceKey

      public ResourceKey biomeResourceKey()
      Returns the value of the biomeResourceKey record component.
      Returns:
      the value of the biomeResourceKey record component
    • blockReplacements

      public List<BlockReplacement> blockReplacements()
      Returns the value of the blockReplacements record component.
      Returns:
      the value of the blockReplacements record component
    • conditional

      public BiPredicate<Player, ChunkLocation> conditional()
      Returns the value of the conditional record component.
      Returns:
      the value of the conditional record component
    • biomeCondition

      public @Nullable BiPredicate<Player, SnapshotChunkData> biomeCondition()
      Returns the value of the biomeCondition record component.
      Returns:
      the value of the biomeCondition record component
    • priority

      public PacketHandler.Priority priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component