Skip to content

Client NBT Since BlockEntityClientSerializable Removal #1779

Discussion options

You must be logged in to vote

I assume you mean this? #1734
As I understand it the BlockEntityClientSerializable (BECS) is no longer necessary.

The changes made by Mojang in 1.18 (so far) are:

  • the changed signature for read/writeNBT() which are now also used to handle the network packet - you get passed the NBT as a parameter
  • you trigger block entity saves and updates to the client using
if (this.hasWorld() && !this.getWorld().isClient()) 
    ((ServerWorld) world).getChunkManager().markForUpdate(getPos());

There is talk of putting this logic in a helper method.

Here is an example from the testsuite:
https://github.com/FabricMC/fabric/blob/5553aff8884eca3caa823632e616873ead33324f/fabric-renderer-api-v1/src/testmod/…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Anemony22
Comment options

@warjort
Comment options

warjort Oct 19, 2021
Collaborator

@Anemony22
Comment options

Answer selected by Anemony22
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants