Skip to content

Conversation

@MC-Samuel
Copy link
Contributor

Redo of #2758 using NMS rather than Spigot's method.

Comment on lines 519 to 521
public ElementTag getArmadilloState(Armadillo entity) {
throw new UnsupportedOperationException();
}
Copy link
Member

Choose a reason for hiding this comment

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

Should create an "API" enum of our own and take/return that (see for example BlockHelper#get/setPushReaction), that way we don't directly depend on Mojang's internal enum names and can easily notice once there's changes and/or avoid them entirely because we control the naming.


@Override
public void setPropertyValue(ElementTag param, Mechanism mechanism) {
NMSHandler.entityHelper.setArmadilloState(as(Armadillo.class), mechanism, param);
Copy link
Member

Choose a reason for hiding this comment

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

Once we have our own enum, can handle input checking here instead of in each NMS impl


@Override
public ElementTag getArmadilloState(org.bukkit.entity.Armadillo entity) {
net.minecraft.world.entity.animal.armadillo.Armadillo armadillo = (Armadillo) ((CraftEntity) entity).getHandle();
Copy link
Member

Choose a reason for hiding this comment

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

Why are you using the FQN here if you have it imported & use it normally in the cast?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants