Class VirtualBiome

java.lang.Object
dev.wyck.renderer.packet.data.VirtualBiome

@NullMarked @AsOf("2.2.0") public final class VirtualBiome extends Object
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 be null, 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
  • Constructor Details

  • Method Details

    • biomeResourceKey

      @AsOf("0.0.6") public ResourceKey biomeResourceKey()
      Gets the resource key of the biome this virtual biome renders.
      Returns:
      the biome resource key
      Since:
      0.0.6
    • blockReplacements

      @AsOf("0.0.6") public List<BlockReplacement> blockReplacements()
      Gets the client-side block replacements applied alongside this biome.
      Returns:
      the block replacements
      Since:
      0.0.6
    • conditional

      @AsOf("0.0.6") public BiPredicate<Player, ChunkLocation> conditional()
      Gets the inexpensive, biome-independent spatial gate.
      Returns:
      the chunk-level condition
      Since:
      0.0.6
    • biomeCondition

      @AsOf("2.2.0") public @Nullable BiPredicate<Player, SnapshotChunkData> 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

      @AsOf("3.3.0") public @Nullable BiPredicate<Player, BiomePosition> 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

      @AsOf("0.0.6") public PacketHandler.Priority priority()
      Gets the priority used when multiple virtual biomes match.
      Returns:
      the priority
      Since:
      0.0.6
    • 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)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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