-
-
Notifications
You must be signed in to change notification settings - Fork 67
Sweethearts code cleanup #1267
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
Merged
Merged
Sweethearts code cleanup #1267
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
68a82d2
Update donor damage to use `/damage`
runcows 04c56ad
Remove recipient non-sneaking requirement
runcows 7dbcc52
Little bit of recipient logic refactoring
runcows c39b247
Update function headers
runcows 892a613
Update predicate to support offhand
runcows 70ab7c6
Update guidebook to reflect wither roses do actually work
runcows dcb7e2e
fix: 2 players being valid donors
runcows 303fccd
Rename attributes
runcows 9a48199
change damage to magic
runcows 68c08dc
Merge branch 'update-26.1' of https://github.com/Gamemode4Dev/GM4_Dat…
runcows 5a38981
change predicate to use slots
runcows b38fa4a
Merge branch 'update-26.1' of https://github.com/Gamemode4Dev/GM4_Dat…
runcows 5ab2389
remove any of
runcows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
gm4_sweethearts/data/gm4_sweethearts/function/check_transfer.mcfunction
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
gm4_sweethearts/data/gm4_sweethearts/function/delayed_revert.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # @s = none | ||
| # at undefined | ||
| # scheduled from transfer_recipient | ||
|
|
||
| execute as @a[tag=gm4_sh_revert_health] run function gm4_sweethearts:revert_health |
3 changes: 2 additions & 1 deletion
3
gm4_sweethearts/data/gm4_sweethearts/function/get_health.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
gm4_sweethearts/data/gm4_sweethearts/function/kill_donor.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,6 @@ | ||
| # @s = sneaking player donating health | ||
| # at @s | ||
| # run from transfer_donor | ||
|
|
||
| execute store result score $deathmessage gm4_sh_data run gamerule show_death_messages | ||
| gamerule show_death_messages false | ||
| advancement grant @s only gm4:sweethearts | ||
| execute if score $deathmessage gm4_sh_data matches 1 run tellraw @a [{"text":"","color":"white"},{"selector":"@s"},{"text":" was shot through the heart and "},{"selector":"@p[tag=gm4_sh_recipient]"},{"text":" was to blame"}] | ||
| kill @s | ||
| execute if score $deathmessage gm4_sh_data matches 1 run gamerule show_death_messages true | ||
| scoreboard players reset $deathmessage gm4_sh_data |
7 changes: 5 additions & 2 deletions
7
gm4_sweethearts/data/gm4_sweethearts/function/main.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| execute as @a[gamemode=!creative,gamemode=!spectator,predicate=gm4_sweethearts:valid_transfer] at @s run function gm4_sweethearts:transferring | ||
| # @s = none | ||
| # at undefined | ||
| # scheduled from init and self | ||
|
|
||
| execute as @a[gamemode=!creative,gamemode=!spectator,predicate=gm4_sweethearts:valid_donor] at @s run function gm4_sweethearts:transferring | ||
|
|
||
| schedule function gm4_sweethearts:check_transfer 1t | ||
| schedule function gm4_sweethearts:main 16t |
31 changes: 15 additions & 16 deletions
31
gm4_sweethearts/data/gm4_sweethearts/function/revert_health.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,19 @@ | ||
| # @s = player that received or donated health | ||
| # run from check_transfer | ||
| # @s = player that received health, tagged with gm4_sh_revert_health | ||
| # at undefined | ||
| # run from delayed_revert | ||
|
|
||
| # revert max health | ||
| attribute @s minecraft:max_health modifier remove minecraft:2a0687d4-f85c-4b07-9310-beaa76ef6f7d | ||
| attribute @s minecraft:max_health modifier remove minecraft:3749747b-8bab-4f91-a63c-518268ca4856 | ||
| attribute @s minecraft:max_health modifier remove minecraft:fc665a2d-71e8-4fe4-8d6d-91283f14e536 | ||
| attribute @s minecraft:max_health modifier remove minecraft:9dd58507-2a53-4ab6-8688-b0fa0be102dd | ||
| attribute @s minecraft:max_health modifier remove minecraft:226acf45-e0df-4164-92ed-cbf02a65eee2 | ||
| attribute @s minecraft:max_health modifier remove minecraft:04f2b196-ca85-4ac8-b8e0-a7d569b415c8 | ||
| attribute @s minecraft:max_health modifier remove minecraft:8c5c4e5e-1823-45c0-9e96-5992e75ae463 | ||
| attribute @s minecraft:max_health modifier remove minecraft:4cb0a7c9-22f2-4a73-86c6-745d2f59331f | ||
| attribute @s minecraft:max_health modifier remove minecraft:e565e188-bfb5-47c4-83bd-7e0babf62ccb | ||
| attribute @s minecraft:max_health modifier remove minecraft:52ff177d-8222-4810-924f-f8bd44b43cfd | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_512 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_256 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_128 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_64 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_32 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_16 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_8 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_4 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_2 | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_remove_1 | ||
|
|
||
| attribute @s minecraft:max_health modifier remove minecraft:381e44f6-ebee-4f7c-9aff-8471a843c4b2 | ||
| attribute @s minecraft:max_health modifier remove minecraft:17d25a01-e9ba-4c08-8a79-ee8f72fb033d | ||
| attribute @s minecraft:max_health modifier remove gm4_sweethearts:health_add_1 | ||
|
|
||
|
|
||
| tag @s remove gm4_sh_transfered | ||
| tag @s remove gm4_sh_revert_health | ||
46 changes: 10 additions & 36 deletions
46
gm4_sweethearts/data/gm4_sweethearts/function/transfer_donor.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
gm4_sweethearts/data/gm4_sweethearts/predicate/not_sneaking.json
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.