Class VirtualBiomeCollector
java.lang.Object
dev.wyck.renderer.packet.VirtualBiomeCollector
A collector for managing PhonyCustomBiome instances.
- Since:
- 0.0.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendBiome(VirtualBiome biome) Appends a phony custom biome to the collector.bestBiomeFor(Player player, ChunkLocation chunkLocation) Picks the 'best' phony custom biome for the given player and chunk location.bestCustomBiomeFor(Player player, ChunkLocation chunkLocation) Picks the 'best' custom biome for the given player and chunk location (spatial only).voidClears all phony custom biomes from the collector.booleanhasBiome(ResourceKey biomeKey) Checks if the collector has a phony custom biome with the given ResourceKey.booleanhasBiome(VirtualBiome biome) Checks if the collector has the given phony custom biome.booleanremoveBiome(ResourceKey biomeKey) Removes a phony custom biome with the given ResourceKey from the collector.booleanremoveBiome(VirtualBiome biome) Removes a phony custom biome from the collector.resolverFor(Player player, ChunkLocation chunkLocation) Cheap pre-decode gate.
-
Constructor Details
-
VirtualBiomeCollector
public VirtualBiomeCollector()
-
-
Method Details
-
appendBiome
Appends a phony custom biome to the collector.- Parameters:
biome- the phony custom biome to append
-
hasBiome
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
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
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
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
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; useresolverFor(Player, ChunkLocation)for the full biome-aware path used by the chunk packet listener.- Parameters:
player- the playerchunkLocation- 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 playerchunkLocation- 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, otherwisenull.Returning
nullis 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 tochunkLocation- the chunk being sent- Returns:
- a resolver, or
nullif nothing could apply
-