-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
Pollidisiac feeds flowers to brown mooshrooms #4521
Pollidisiac feeds flowers to brown mooshrooms #4521
Conversation
break; | ||
// Note: Empty item stacks are implicitly excluded in Animal::isFood and ItemStack::is(TagKey) | ||
if (!animal.isInLove()) { | ||
for (ItemEntity item : items) { |
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.
I'm not quite sure this works as intended. Won't this consume multiple items on one animal? There's nothing that breaks out of the loop once a food item has been consumed from what i can see.
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.
Good point, that item loop was definitely missing a break
.
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.
Left a comment inline, as i don't think the code is quite sound.
Also includes smaller optimizations to the finding and feeding logic: * don't look for anything if out of mana * exclude items from the search that can't be interacted with * don't look for animals when no items are around * exclude animals from the search that would not be fed anyway because they are a baby, or already in the mood and not a brown mooshroom
8112d39
to
b80a5b1
Compare
I didn't test this, but i assume you did, and the code looks fine now. Thanks! |
I did, only missing the multiple item entities case earlier. |
Wonderful! |
Also includes smaller optimizations to the finding and feeding logic: