-
Notifications
You must be signed in to change notification settings - Fork 6
๐ ใกใคใณใใณใใจใชใใใณใใฎ็ฅๅจใๅๆใซไฝฟ็จใใใๅ้กใไฟฎๆญฃ #2219
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
Conversation
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.
Pull request overview
This PR fixes issue #2215 where mainhand and offhand artifacts were being triggered simultaneously when only one should activate. The solution prevents the offhand artifact from firing when a mainhand artifact is used.
Key changes:
- Added logic to detect mainhand usage and set a flag in storage
- When mainhand is used, the offhand artifact ID is set to -2 (disabled)
- Added cleanup logic to reset the UseMainhand flag after processing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/shot.mcfunction |
Added mainhand/offhand conflict prevention for bow-based artifacts |
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click.carrot.mcfunction |
Added mainhand/offhand conflict prevention for carrot-on-a-stick artifacts |
๐ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # ใกใคใณใใณใ็ฅๅจใไฝฟ็จใใฆใใใชใในใใฌใผใธใซใใงใใฏใๅ ฅใใ | ||
| execute if data storage asset:artifact Argument{AutoSlot:"mainhand"} run data modify storage asset:context UseMainhand set value 1b | ||
|
|
||
| # ใคใใณใ็บ็ซๅใซๅฎ่กใใใใค | ||
| function asset_manager:artifact/data/new/set_to_current | ||
|
|
||
| # ใกใคใณใใณใ็ฅๅจใไฝฟ็จใใฆใใใชใใชใใใณใใฎIDใๅ้ค | ||
| execute if data storage asset:context UseMainhand run data modify storage asset:context id.offhand set value -2 |
Copilot
AI
Jan 6, 2026
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.
The mainhand/offhand checking logic (lines 11-18) is duplicated across multiple trigger files. Consider extracting this into a shared function to improve maintainability and reduce code duplication. This would make future updates easier and reduce the risk of inconsistencies.
|
|
||
| # ใคใใณใ็บ็ซๅใซๅฎ่กใใใใค | ||
| function asset_manager:artifact/data/new/set_to_current | ||
|
|
Copilot
AI
Jan 6, 2026
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 line contains trailing whitespace. Remove the spaces at the end of the line.
|
|
||
| # ใคใใณใ็บ็ซๅใซๅฎ่กใใใใค | ||
| function asset_manager:artifact/data/new/set_to_current | ||
|
|
Copilot
AI
Jan 6, 2026
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 line contains trailing whitespace. Remove the spaces at the end of the line.
| # ใกใคใณใใณใ็ฅๅจใไฝฟ็จใใฆใใใชใในใใฌใผใธใซใใงใใฏใๅ ฅใใ | ||
| execute if data storage asset:artifact Argument{AutoSlot:"mainhand"} run data modify storage asset:context UseMainhand set value 1b | ||
|
|
||
| # ใคใใณใ็บ็ซๅใซๅฎ่กใใใใค | ||
| function asset_manager:artifact/data/new/set_to_current | ||
|
|
||
| # ใกใคใณใใณใ็ฅๅจใไฝฟ็จใใฆใใใชใใชใใใณใใฎIDใๅ้ค | ||
| execute if data storage asset:context UseMainhand run data modify storage asset:context id.offhand set value -2 |
Copilot
AI
Jan 6, 2026
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.
The mainhand/offhand checking logic (lines 11-18) is duplicated across multiple trigger files. Consider extracting this into a shared function to improve maintainability and reduce code duplication. This would make future updates easier and reduce the risk of inconsistencies.
8902f37 to
c5f4226
Compare
Fix #2215
ใกใใฃใจใใชใ้ฉๅฝใช็ดใๆนใง็ณใ่จณใชใใใใจใใใใๅใใใใซใฏใใฆใฟใใ
ใใฃใจ้ใใใๆนใใใฆๆฌฒใใใจใใใใใฐใๆฏ้ๆ่ฆใใ