-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
Workaround Axe Enchantments on Paxel by Checking an Axe #7903
Workaround Axe Enchantments on Paxel by Checking an Axe #7903
Conversation
The one issue with this solution is I believe sharpness is allowed on axes but only via enchanted books and not via the enchantment table. Or at least there was something like that when I looked into it some. Now I don’t know how much that actually matters but definitely needs some more thought. Cc: @thiakil |
Can we use Re sharpness: on a quick glance look like the methods an anvil uses will pass through here by default so should be fine |
My point is it works for anvil here but it adds enchantments as possible to the enchantment table that are normally anvil only. |
how so? |
Ah, I see what you're talking about. So, this would probably need to be addressed in NeoForge as a way to disambiguate the two. Otherwise, the only solution I could think of to maintain the logic is to mixin in a check somehow, which wouldn't be very mod-compatible since you revolve. Another solution would just be to say paxels are cool like that and can have the enchantments at the enchanting table. This is assuming we are still using this method. The safest way would probably just be to extend I'll wait for further opinions before going forward here. |
Which category are axe enchants? (or do they specifically check for axe?) |
There is none, it's essentially a hardcoded check in |
Hmm I see. Ideally a forge fix for being hardcoded would be the way. Though if you wanna see how it looks with paxels extending axe I'd take a look |
@thiakil here you are. It simply just extends |
src/tools/java/mekanism/tools/common/item/ItemMekanismPaxel.java
Outdated
Show resolved
Hide resolved
src/tools/java/mekanism/tools/common/item/ItemMekanismPaxel.java
Outdated
Show resolved
Hide resolved
- Remove override of Forge added method - Remove inlined tag
If we are doing it by making it extend the axe we may want to make:
InteractionResult axeResult = super.useOn(context);
if (result != InteractionResult.PASS) {
return result;
} And then remove the Also in regards to overriding one vs both |
Ok, I'll get around to it after the 5th since I won't have a computer that can run Java until then. |
- Use suprt method to grab axe action tags in `#canPerformAction` - Remove `#useAsAxe` in favor of the super `#useOn` - Readd stack sensitive version of `#isCorrectToolForDrops` to deal with DiggerItem behaviors
Okay, I've addressed the comments and added back in the second method for |
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.
One more minor nitpick but other than that it looks pretty good (assuming when I test it things work as expected)
Closes #7860
Changes proposed in this pull request:
Allows the paxel to have axe enchantments by checking whether the enchantment can be applied to an axe. I opted for this solution compared extending
AxeItem
since that class assumes the tag isMINEABLE_WITH_AXE
while paxels have their own tags. This would mean that all of the logic associated with the tag would need to be replaced and swapped out. In favor of avoiding redundancy, it is simpler to just check whether the item is an axe item.Modded enchantments should check whether the action can perform
AXE_DIG
, so it should remain compatible.As this is a workaround, this should work until the mod loader API switches out the enchantment logic for checking tool actions instead.