Interface WorldFluidNms
@Internal
public interface WorldFluidNms
What world fluids (D46) need from the server's own classes: client-only key biomes in the registry
data, biome-only chunk updates, and the attribute modifiers of viscosity. MachineEngine's own; addons
use
WorldFluids.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA biome sent only to clients: a copy of the base biome with these colors (0xRRGGBB). -
Method Summary
Modifier and TypeMethodDescription@NotNull StringcheckBiomeWriter(int clientSize) Writes random biome sections assendBiomes(Collection, World, int, int, LongToIntFunction, int)does and reads them back with the server's own reader, as the client does.voidinstall(@NotNull net.kyori.adventure.key.Key baseBiome, @NotNull List<WorldFluidNms.KeyBiome> keyBiomes, @Nullable Integer uniformWater, @NotNull IntConsumer onBaseCount, @NotNull Consumer<String> log) Rewrites the biome registry data sent to each joining player:keyBiomesare appended after the server's biomes (key biomeigets client idbase + i), and withuniformWaterevery server biome's water color becomes that color.booleansendBiomes(@NotNull Collection<? extends org.bukkit.entity.Player> viewers, @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull LongToIntFunction cellIds, int clientSize) Sends only a chunk's biomes (no blocks, no light) toviewers.voidvoidApplies a fluid's viscosity to a player as attribute modifiers, or removes them (null).
-
Method Details
-
install
void install(@NotNull @NotNull net.kyori.adventure.key.Key baseBiome, @NotNull @NotNull List<WorldFluidNms.KeyBiome> keyBiomes, @Nullable @Nullable Integer uniformWater, @NotNull @NotNull IntConsumer onBaseCount, @NotNull @NotNull Consumer<String> log) Rewrites the biome registry data sent to each joining player:keyBiomesare appended after the server's biomes (key biomeigets client idbase + i), and withuniformWaterevery server biome's water color becomes that color.- Parameters:
onBaseCount- receives the number of server biomes (base) at each join
-
uninstall
void uninstall() -
sendBiomes
boolean sendBiomes(@NotNull @NotNull Collection<? extends org.bukkit.entity.Player> viewers, @NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ, @NotNull @NotNull LongToIntFunction cellIds, int clientSize) Sends only a chunk's biomes (no blocks, no light) toviewers. Runs on the chunk's thread.- Parameters:
cellIds- the client biome id of a cell (packed likeBlockPos.asLong, in cell coordinates), or -1 to keep the chunk's own biome thereclientSize- the number of biomes the client knows (server biomes and key biomes)- Returns:
- false when the chunk is not loaded
-
checkBiomeWriter
Writes random biome sections assendBiomes(Collection, World, int, int, LongToIntFunction, int)does and reads them back with the server's own reader, as the client does.- Returns:
- how many of how many sections read back the same (
"200/200"when the format is right)
-
viscosity
void viscosity(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable Viscosity viscosity) Applies a fluid's viscosity to a player as attribute modifiers, or removes them (null).
-