Interface VirtualBlockManager
Unlike standard fake blocks, blocks managed here are "persistent" at the network layer. Pulse tracks these blocks and will automatically re-send them to the client if the server performs a full chunk refresh (e.g., during explosions or lighting updates).
-
Method Summary
Modifier and TypeMethodDescriptionvoidEnables manual virtual context mode.voidclearAll()Clears all virtual blocks tracked for this player.voidDisables manual virtual context mode and returns to normal network behavior.Retrieves the data of a virtual block if it is currently tracked.voidremoveBlock(@NotNull Location location) Removes a virtual block and restores the actual server-side state.voidSets a persistent virtual block at the specified location.
-
Method Details
-
setBlock
Sets a persistent virtual block at the specified location.This block is stored in the Pulse session and will be restored automatically if the underlying chunk is re-sent to the player.
- Parameters:
location- the coordinates where the block should appeardata- the block state data to be displayed
-
removeBlock
Removes a virtual block and restores the actual server-side state.Pulse will stop tracking this location and send a packet to the client with the real block data currently existing on the server.
- Parameters:
location- the coordinates to restore
-
getBlock
Retrieves the data of a virtual block if it is currently tracked.- Parameters:
location- the coordinates to check- Returns:
- the
BlockDataof the virtual block, or null if the player sees the real world state
-
clearAll
void clearAll()Clears all virtual blocks tracked for this player.Note: This does not automatically refresh the client's view. The player will see real blocks only after a chunk reload or manual update.
-
beginContext
void beginContext()Enables manual virtual context mode.While active, all block update packets sent to the player (via any plugin or NMS) are automatically intercepted and registered as persistent virtual blocks. Use this for sending large schematics or client-side only structures.
-
endContext
void endContext()Disables manual virtual context mode and returns to normal network behavior.
-