Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void registerPackets() {
final TrackedEntity trackedEntity = tracker(wrapper.user()).entity(entityId);

trackedEntity.data().put(mannequinData);
sendInitialPlayerInfoUpdate(wrapper.user(), mannequinData, null, new GameProfile.Property[0]);
sendInitialPlayerInfoUpdate(wrapper.user(), mannequinData, new GameProfile.Property[0]);

mannequinData.setPosition(x, y, z);
mannequinData.setRotation(yaw, pitch);
Expand Down Expand Up @@ -260,7 +260,7 @@ private void storeMovementMannequinData(final PacketWrapper wrapper, final boole
}
}

private void sendInitialPlayerInfoUpdate(final UserConnection connection, final MannequinData mannequinData, final @Nullable String nameOverride, final GameProfile.Property[] properties) {
private void sendInitialPlayerInfoUpdate(final UserConnection connection, final MannequinData mannequinData, final GameProfile.Property[] properties) {
final PacketWrapper playerInfo = PacketWrapper.create(ClientboundPackets1_21_6.PLAYER_INFO_UPDATE, connection);

final BitSet actions = new BitSet(8);
Expand All @@ -270,7 +270,7 @@ private void sendInitialPlayerInfoUpdate(final UserConnection connection, final
playerInfo.write(Types.PROFILE_ACTIONS_ENUM1_21_4, actions);
playerInfo.write(Types.VAR_INT, 1); // One entry
playerInfo.write(Types.UUID, mannequinData.uuid());
playerInfo.write(Types.STRING, nameOverride != null ? nameOverride : mannequinData.name());
playerInfo.write(Types.STRING, mannequinData.name());
playerInfo.write(Types.PROFILE_PROPERTY_ARRAY, properties);
playerInfo.write(Types.BOOLEAN, false); // Session info
playerInfo.write(Types.VAR_INT, 0); // Gamemode
Expand Down Expand Up @@ -312,6 +312,7 @@ private void sendPlayerTeamDisplayName(final UserConnection connection, final Ma
addTeam.write(Types.TAG, new StringTag("")); // Suffix
if (!mannequinData.hasTeam()) {
addTeam.write(Types.STRING_ARRAY, new String[]{mannequinData.name()});
mannequinData.setHasTeam(true);
}
addTeam.send(Protocol1_21_9To1_21_7.class);
}
Expand Down Expand Up @@ -423,7 +424,7 @@ protected void registerRewrites() {
playerInfoRemove.send(Protocol1_21_9To1_21_7.class);

// Spawn new entity
sendInitialPlayerInfoUpdate(event.user(), mannequinData, profile.profile().name(), profile.profile().properties());
sendInitialPlayerInfoUpdate(event.user(), mannequinData, profile.profile().properties());

final PacketWrapper spawnEntityPacket = PacketWrapper.create(ClientboundPackets1_21_6.ADD_ENTITY, event.user());
spawnEntityPacket.write(Types.VAR_INT, event.entityId());
Expand Down Expand Up @@ -469,6 +470,11 @@ protected void registerRewrites() {
equipment.send(Protocol1_21_9To1_21_7.class);
}

final PacketWrapper setHeadRotation = PacketWrapper.create(ClientboundPackets1_21_6.ROTATE_HEAD, event.user());
setHeadRotation.write(Types.VAR_INT, event.entityId());
setHeadRotation.write(Types.BYTE, mannequinData.headYaw());
setHeadRotation.send(Protocol1_21_9To1_21_7.class);

if (!isBundling) {
final PacketWrapper bundleStart = PacketWrapper.create(ClientboundPackets1_21_6.BUNDLE_DELIMITER, event.user());
bundleStart.send(Protocol1_21_9To1_21_7.class);
Expand Down