-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feature(#13558): add copper golem state api #13561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feature(#13558): add copper golem state api #13561
Conversation
paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCopperGolem.java
Outdated
Show resolved
Hide resolved
6a066d1 to
8575594
Compare
paper-generator/src/main/java/io/papermc/generator/utils/SimpleEnumBridgeGenerator.java
Outdated
Show resolved
Hide resolved
8575594 to
b3fd552
Compare
| 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 |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
| @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())); | ||
| } | ||
| }) |
There was a problem hiding this comment.
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.
Addresses #13558