Mappings for new BlockEntity update packet logic (#2692)

* Mappings for new BlockEntity update packet logic

* Apply suggestions from code review

Co-authored-by: liach <7806504+liach@users.noreply.github.com>

Co-authored-by: liach <7806504+liach@users.noreply.github.com>
This commit is contained in:
shartte 2021-09-20 17:51:29 +02:00 committed by GitHub
parent 8abe3202a8
commit ed314d96f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -34,6 +34,8 @@ CLASS net/minecraft/class_2586 net/minecraft/block/entity/BlockEntity
METHOD method_11016 getPos ()Lnet/minecraft/class_2338;
METHOD method_11017 getType ()Lnet/minecraft/class_2591;
METHOD method_16887 toInitialChunkDataNbt ()Lnet/minecraft/class_2487;
COMMENT Serializes the state of this block entity that is observable by clients. It is sent alongside the initial chunk data,
COMMENT as well as when the block entity implements {@link #toUpdatePacket} and decides to use the default {@link BlockEntityUpdateS2CPacket}.
METHOD method_31662 setWorld (Lnet/minecraft/class_1937;)V
ARG 1 world
METHOD method_31663 markDirty (Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
@ -42,6 +44,14 @@ CLASS net/minecraft/class_2586 net/minecraft/block/entity/BlockEntity
ARG 2 state
METHOD method_31664 setCachedState (Lnet/minecraft/class_2680;)V
ARG 1 state
METHOD method_38235 toUpdatePacket ()Lnet/minecraft/class_2596;
COMMENT Implement and return a packet that should be sent to players nearby when the observable state of
COMMENT this block entity changes. Return null to not send an update packet.
COMMENT <p>
COMMENT If the data returned by {@link #toInitialChunkDataNbt initial chunk data} is suitable for updates,
COMMENT the following shortcut can be used to create an update packet: {@code BlockEntityUpdateS2CPacket.create(this)}.
COMMENT <p>
COMMENT The NBT will be passed to {@link #readNbt} on the client.
METHOD method_38238 writeIdToNbt (Lnet/minecraft/class_2487;Lnet/minecraft/class_2591;)V
ARG 0 nbt
ARG 1 type

View File

@ -4,9 +4,12 @@ CLASS net/minecraft/class_2622 net/minecraft/network/packet/s2c/play/BlockEntity
FIELD field_12040 pos Lnet/minecraft/class_2338;
METHOD <init> (Lnet/minecraft/class_2338;Lnet/minecraft/class_2591;Lnet/minecraft/class_2487;)V
ARG 1 pos
ARG 2 blockEntityType
ARG 3 nbt
METHOD <init> (Lnet/minecraft/class_2540;)V
ARG 1 buf
METHOD method_11290 getNbt ()Lnet/minecraft/class_2487;
METHOD method_11291 getBlockEntityType ()Lnet/minecraft/class_2591;
METHOD method_11293 getPos ()Lnet/minecraft/class_2338;
METHOD method_38585 create (Lnet/minecraft/class_2586;)Lnet/minecraft/class_2622;
ARG 0 blockEntity