Skip to content

Commit

Permalink
Fix arrow name
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Feb 8, 2025
1 parent 67f8c7a commit e9fc529
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ public abstract class PotionContentsComponentMixin implements TransformingCompon
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
@Shadow @Final private Optional<RegistryEntry<Potion>> potion;

@Shadow @Final private Optional<String> customName;

@Shadow public abstract Optional<RegistryEntry<Potion>> potion();

@Override
public Object polymer$getTransformed(PacketContext context) {
if (!polymer$requireModification(context)) {
return this;
}

return new PotionContentsComponent(Optional.empty(), Optional.of(this.getColor()), List.of(), Optional.empty());
return new PotionContentsComponent(Optional.empty(), Optional.of(this.getColor()), List.of(),
this.customName.or(() -> this.potion().map(RegistryEntry::value).map(Potion::getBaseName)));
}

@Override
Expand Down

0 comments on commit e9fc529

Please sign in to comment.