-
Notifications
You must be signed in to change notification settings - Fork 242
Enchantment Name Support - EnchantCommand #2009
Conversation
* Enchantment Name Support 1/2 * Enchantment Name Support 2/2
Looks good, but some formatting issues. Please correct these. |
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 but has some formatting issues.
Okay I will fix those. |
return self::getEnchantment(constant(Enchantment::class . "::TYPE_FISHING_" . strtoupper($name))); | ||
} | ||
else{ | ||
return new Enchantment(self::TYPE_INVALID, "unknown", 0, 0, 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.
^^
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.
Yes I was just about to commit that, I'm squashing commits right now.
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.
👍
Please refrain from using the web editor in future, even if you're uploading files. I strongly recommend you learn to use git. |
Sorry I was eating, I'm learning Git now. |
@dktapps Is it OK if I close this pr and restart? I learned the git basics 😸 |
If you can't squash or had difficulties, I can squash-merge this time, but in future please learn to do it properly. |
Thank you, I'm learning how to squash via command line right now. |
Description
This PR adds support for Enchantment names when using the enchant command.
Previously when using the enchant command
/enchant ImagicalGamer smite 1
the command returned with a Unknown Enchantment message. Now when running the same command checks for enchantment names as well as enchantment ID's.Reason to modify
Yes this is a good way to fix things.
There is no real issue, this is to help users who don't know every enchantment ID.
I modified an existing function to make it work correctly.
Tests & Reviews
I have tested this code and it works.