-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add DamageType RegistryEvent #11783
Add DamageType RegistryEvent #11783
Conversation
paper-api/src/main/java/io/papermc/paper/registry/data/DamageTypeRegistryEntry.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/registry/data/DamageTypeRegistryEntry.java
Outdated
Show resolved
Hide resolved
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.
As for the StaticUnsafeValues, I have a slightly different idea on how to solve it, but it can just be left in for now, not a big deal.
There should be a standardized way to interact with the "pseudo-registries" types of which DamageEffect is part of. All the types on the server that implement StringRepresentable are a different sort of registry where there is a defined mapping between a string and an instance. There will be/already are other cases where a way to convert between them would be useful if we don't want to use an enum on the API side.
But this isn't something you have to figure out, that'll be for us to decide on.
paper-server/src/main/java/io/papermc/paper/registry/data/PaperDamageTypeRegistryEntry.java
Outdated
Show resolved
Hide resolved
paper-server/src/main/java/io/papermc/paper/registry/data/PaperDamageTypeRegistryEntry.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/registry/data/DamageTypeRegistryEntry.java
Show resolved
Hide resolved
…mageTypeRegistryEntry
…fects and deathMessageType no longer nullable
76c8611
to
5917a72
Compare
Totally missed it on my first review, but welcome to paper 🥳 |
Tyvm! Although you might missed this one. |
Well get congratulated twice then xD |
Add RegistryEvent for DamageType
Changes:
But I ran into the problem, that DamageEffect uses Bukkit.getUnsafe() for initialization and that seems to be not available at bootstrap. I fixed that with the following changes, but I am not sure if that's the correct way to do is as it may break plugins:
The only breaking change I see is when someone tries to cast DamageType to CraftDamageType which is no longer possible with my approach.