Skip to content

Conversation

@yannicklamprecht
Copy link
Contributor

Addresses #13558

@yannicklamprecht yannicklamprecht requested a review from a team as a code owner January 18, 2026 00:49
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Jan 18, 2026
@yannicklamprecht yannicklamprecht force-pushed the issues/13558/copper-state-api branch from 6a066d1 to 8575594 Compare January 18, 2026 14:11
@yannicklamprecht yannicklamprecht force-pushed the issues/13558/copper-state-api branch from 8575594 to b3fd552 Compare January 18, 2026 17:03
DROPPING_NO_ITEM("dropping_no_item", 4);

- public static final Codec<CopperGolemState> CODEC = StringRepresentable.fromEnum(CopperGolemState::values);
+ public static final StringRepresentable.EnumCodec<CopperGolemState> CODEC = StringRepresentable.fromEnum(CopperGolemState::values); // Paper - support copper golem state api mapping byName
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Doc94 Instead of modifying nms code should I just cast it to StringRepresentable.EnumCodec ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel better a cast

Comment on lines +147 to +152
@Override
protected EnumValue.Builder rewriteEnumValue(net.minecraft.world.entity.animal.golem.CopperGolemState state) {
final String name = Formatting.formatKeyAsField(state.getSerializedName());
return EnumValue.builder(name).argument(quoted(state.getSerializedName()));
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this part supposed to be exposed or is it only used for the conversion? can just do a.valueOf(b.name()) once it's generated. The javadocs of getId is at least a bit weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

3 participants