-
-
Notifications
You must be signed in to change notification settings - Fork 393
ExprArmorSlot With EquipmentSlots #7906
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
base: dev/feature
Are you sure you want to change the base?
ExprArmorSlot With EquipmentSlots #7906
Conversation
|
||
static { | ||
if (Material.getMaterial("WOLF_ARMOR") != null) | ||
bodyEntities.add(Wolf.class); | ||
|
||
register(ExprArmorSlot.class, Slot.class, "((boots:(boots|shoes)|leggings:leg[ging]s|chestplate:chestplate[s]|helmet:helmet[s]) [(item|:slot)]|armour:armo[u]r[s]|bodyarmor:body armo[u]r)", "livingentities"); | ||
register(ExprArmorSlot.class, Slot.class, "(%-*equipmentslots%|[the] armo[u]r[s]) [item:item[s]]", "livingentities"); |
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 a little tenative to allow so few keywords here
%livingentities%'[s] %-*equipmentslots%
and %-*equipmentslots% of %livingentities%
are slightly scary but probably ok? @APickledWalrus any thoughts?
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.
It would conflict with ExprXOf if not for the literal requirement, so that's probably ok, but I worry there may be parsing slowdowns in there? Are the test parse/run times any noticeably different before/after?
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.
These are the build timings I got:
dev/feature
- quickTest: 55s
- skriptTestJava17: 1m 5s
- skriptTestJava21: 2m 29s
- JUnitQuick: 25s
- JUnitJava17: 30s
- JUnitJava21: 1m 12s
ExprArmorSlot
- quickTest: 46s
- skriptTestJava17: 56s
- skriptTestJava21: 2m 13s
- JUnitQuick: 24s
- JUnitJava17: 31s
- JUnitJava21: 1m 11s
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
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.
patterns should be ok, but we can consider bumping up the priority if necessary
Problem
The pattern for
ExprArmorSlot
was getting clunky and would become hard to follow for any other slots that would be added.Solution
This PR revamps the pattern to allow
EquipmentSlot
to be used and multiple.To reduce breaking changes, extra patterns were added to the
types.equipment slots
to reflect what was available in the prior pattern ofExprArmorSlot
Also adds support for the new
saddle
equipment slot.Testing Completed
ExprArmorSlot.sk
Manual spawning of select entities to ensure the new
saddle
equipment slot would be visible on these entities for the restriction of getting saddle slots of entities that don't.Supporting Information
N/A
Completes: none
Related: none