Skip to content
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

Condition Slot has Space for Item #6677

Open
wants to merge 9 commits into
base: dev/feature
Choose a base branch
from

Conversation

NotSoDelayed
Copy link
Contributor

Description

This PR adds a condition to check for whether a slot has space for an item.

Tests dedicated to CondCanHold.java is also added.


Target Minecraft Versions: any
Requirements: none
Related Issues: #6256

@sovdeeth sovdeeth added the feature Pull request adding a new feature. label May 9, 2024
Comment on lines 52 to +55
"%inventories% (can hold|ha(s|ve) [enough] space (for|to hold)) %itemtypes%",
"%inventories% (can(no|')t hold|(ha(s|ve) not|ha(s|ve)n't|do[es]n't have) [enough] space (for|to hold)) %itemtypes%");
"%inventories% (can(no|')t hold|(ha(s|ve) not|ha(s|ve)n't|do[es]n't have) [enough] space (for|to hold)) %itemtypes%",
"%slots% (can hold|ha(s|ve) [enough] space (for|to hold)) %itemtype%",
"%slots% (can(no|')t hold|(ha(s|ve) not|ha(s|ve)n't|do[es]n't have) [enough] space (for|to hold)) %itemtype%");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the patterns duplicated? just use %slots/inventories%

return true;
}

@Override
public boolean check(Event e) {
return invis.check(e,
public boolean check(Event event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the slot and inventory logic could be separated into helper methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants