Package devs.beer.nativepackets.api
Interface ChunkWithLightPacketView
- All Superinterfaces:
PacketView
Lazy zero-copy view of clientbound chunk and light data.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanblockState(int x, int y, int z, NativeValue state) Changes one block using payload-local coordinates.intchunkX()intchunkZ()booleanreplaceBlockState(NativeValue from, NativeValue to) Replaces every occurrence of one block state in the serialized chunk sections.Methods inherited from interface devs.beer.nativepackets.api.PacketView
isModified, nativeHandle, type
-
Method Details
-
chunkX
int chunkX() -
chunkZ
int chunkZ() -
chunkData
NativeValue chunkData() -
lightData
NativeValue lightData() -
replaceBlockState
Replaces every occurrence of one block state in the serialized chunk sections. Palette data is parsed lazily and copied only when at least one state matches. Air transitions update the native non-empty section counter in the same pass.- Parameters:
from- state to replaceto- replacement state- Returns:
- whether the payload changed
-
blockState
Changes one block using payload-local coordinates. X and Z are in [0, 15]; Y starts at zero in the first serialized section so custom-dimension minimum heights remain unambiguous.- Parameters:
x- local Xy- local Y across all serialized sectionsz- local Zstate- replacement state- Returns:
- whether the block changed
-