-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Replace ItemStack with ItemType #2510
Conversation
This needs extensive testing. A syntax test for each changed class would be best, but that is a lot of work. I'll try to help with this one, because IMO it is very important to get rid of ItemStacks. |
if (e instanceof CraftItemEvent) | ||
return ((CraftItemEvent) e).getRecipe().getResult(); | ||
return e.getCurrentItem(); | ||
return new ItemType(((CraftItemEvent) e).getRecipe().getResult()); |
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.
This is a rather confusing behaviour now that I see it, it might make sense for the pre-craft and craft events but not for the inventory click event itself.
@bensku may I ask why didn't you just create an event value for the ItemCraftEvent?
This isn't related to the PR itself anyways, I am just stating it here so we don't forget it in the future.
Ok, here is the comprehensive list of changes made: CondIsBlockAssertions
CondIsEdibleAssertions
CondIsFlammableAssertions
CondIsSolidAssertions
CondIsTransparentAssertions
Special Note
EffEnchantAssertions
EffHealthAssertions (Items)
Special Notes
Assertions (Mobs)
EffReplaceAssertions
Special Note
ExprBookAuthorAssertions
ExprBookPagesAssertions
Special Note
ExprBookTitleAssertions
Special Note
ExprItemAmountAssertions
ExprMaxStackAssertions
|
Looks good to me. I reorganized tests a bit, plus removed check for air blockiness (it is NOT a block on some MC versions). |
Closing since this issue is merged :D |
Description
This PR replaces ItemStacks with ItemTypes in conditions, effects, and expressions where possible.
The search criteria I used was:
Please help me review my changes :)
Target Minecraft Versions: Any
Requirements: None
Related Issues: #2151, #2162, #2175, potentially more issues