Skip to content

Commit

Permalink
Use player's registry access for display name conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Jul 26, 2024
1 parent b939fde commit 430dabd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ protected PlayerMixin(final EntityType<? extends LivingEntity> entityType, final
final Pointers.Builder builder = Pointers.builder()
.withDynamic(Identity.NAME, () -> this.shadow$getGameProfile().getName())
.withDynamic(Identity.UUID, this::getUUID)
// Hope this isn't a registry-aware component :)
.withDynamic(Identity.DISPLAY_NAME, () -> NonWrappingComponentSerializer.INSTANCE.deserialize(this.getDisplayName()));
.withDynamic(Identity.DISPLAY_NAME, () -> new NonWrappingComponentSerializer(this.level()::registryAccess).deserialize(this.getDisplayName()));

// add any extra data
if (this instanceof Pointered p) {
Expand Down

0 comments on commit 430dabd

Please sign in to comment.