Class VirtualBiomeCollector

java.lang.Object
dev.wyck.renderer.packet.VirtualBiomeCollector

@NullMarked @AsOf("0.0.6") public class VirtualBiomeCollector extends Object
A collector for managing PhonyCustomBiome instances.
Since:
0.0.6
  • Constructor Details

    • VirtualBiomeCollector

      public VirtualBiomeCollector()
  • Method Details

    • appendBiome

      @AsOf("0.0.6") public void appendBiome(VirtualBiome biome)
      Appends a phony custom biome to the collector.
      Parameters:
      biome - the phony custom biome to append
    • hasBiome

      @AsOf("0.0.6") public boolean hasBiome(VirtualBiome biome)
      Checks if the collector has the given phony custom biome.
      Parameters:
      biome - the phony custom biome to check
      Returns:
      true if the collector has the biome, false otherwise
    • hasBiome

      @AsOf("0.0.6") public boolean hasBiome(ResourceKey biomeKey)
      Checks if the collector has a phony custom biome with the given ResourceKey.
      Parameters:
      biomeKey - the ResourceKey of the biome to check
      Returns:
      true if the collector has the biome, false otherwise
      Since:
      0.0.8
    • removeBiome

      @AsOf("0.0.6") public boolean removeBiome(VirtualBiome biome)
      Removes a phony custom biome from the collector.
      Parameters:
      biome - the phony custom biome to remove
      Returns:
      true if the biome was removed, false if it was not found
    • removeBiome

      @AsOf("0.0.6") public boolean removeBiome(ResourceKey biomeKey)
      Removes a phony custom biome with the given ResourceKey from the collector.
      Parameters:
      biomeKey - the ResourceKey of the biome to remove
      Returns:
      true if the biome was removed, false if it was not found
      Since:
      0.0.8
    • clearBiomes

      @AsOf("0.0.6") public void clearBiomes()
      Clears all phony custom biomes from the collector.
    • bestBiomeFor

      @AsOf("0.0.6") public @Nullable VirtualBiome bestBiomeFor(Player player, ChunkLocation chunkLocation)
      Picks the 'best' phony custom biome for the given player and chunk location.

      Note: this only evaluates the cheap spatial VirtualBiome.conditional(). Biome-aware conditions are ignored here; use resolverFor(Player, ChunkLocation) for the full biome-aware path used by the chunk packet listener.

      Parameters:
      player - the player
      chunkLocation - the chunk location
      Returns:
      the best phony custom biome, or null if none match
    • bestCustomBiomeFor

      @AsOf("0.0.8") public @Nullable Biome bestCustomBiomeFor(Player player, ChunkLocation chunkLocation)
      Picks the 'best' custom biome for the given player and chunk location (spatial only).
      Parameters:
      player - the player
      chunkLocation - the chunk location
      Returns:
      the best custom biome, or null if none match
    • resolverFor

      @AsOf("2.2.0") public @Nullable VirtualBiomeResolver resolverFor(Player player, ChunkLocation chunkLocation)
      Cheap pre-decode gate. Returns a biome-aware resolver only when at least one phony biome spatially applies to this chunk for this player, otherwise null.

      Returning null is the hot path: the caller skips chunk decoding entirely. The returned resolver is invoked by the NMS handler after it has decoded the chunk once, and evaluates the biome-aware conditions against the decoded data.

      Parameters:
      player - the player the packet is being sent to
      chunkLocation - the chunk being sent
      Returns:
      a resolver, or null if nothing could apply