-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
EnchantmentType - prepare for MC 1.21 custom enchantments #6687
base: dev/feature
Are you sure you want to change the base?
EnchantmentType - prepare for MC 1.21 custom enchantments #6687
Conversation
I might prefer to keep support for custom names for Minecraft-provided enchantments. That is, one could write |
thats probably a good idea, for a little backwards compatibility too |
Seconding pickle |
Co-authored-by: Patrick Miller <apickledwalrus@gmail.com>
Co-authored-by: Patrick Miller <apickledwalrus@gmail.com>
- skip adding names if not in lang file - toString should return full namespaced key if no name found
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.
Looks good. May be wise to wait on #6695 if that implementation can be used here instead.
final String[] names = Language.getList("enchantments." + key.getKey()); | ||
|
||
if (!names[0].startsWith("enchantments.")) { | ||
NAMES.put(enchantment, names[0]); |
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.
We could also choose to store names for undefined enchantments in this map (e.g. the full namespaced key as done in toString)
Description
This PR aims to prepare Skript for future changes with Enchantments.
Minecraft has moved enchantments to be data driven in 1.21.
This also means the ability to create custom enchantments.
This PR helps prepare Skript for that change by using the Bukkit registry rather than hard coding and using the specific fields.
Mojang is planning a 1.21 release for sometime this summer. I figured it would be best to prepare ourselves now.
NOTES:
Target Minecraft Versions: 1.21+
Requirements: none
Related Issues: none