-
-
Notifications
You must be signed in to change notification settings - Fork 61
Environment Checks #1093
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: master
Are you sure you want to change the base?
Environment Checks #1093
Changes from 1 commit
fa4d298
c5d1627
94b38a6
da96da3
7cb5406
747eeaa
9087712
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Tests if non-player entities can hold scores. Default-config Spigot fails this test. | ||
# @s = unspecified | ||
# at unspecified | ||
# run from modules which require this environment check | ||
|
||
# if there is no recent echeck result, re-run echeck | ||
execute unless score $score_on_non_player_entity gm4.environment_check_results matches 0.. summon marker run function gm4:environment_check/score_on_non_player_entity/assign_score | ||
|
||
# return result | ||
return run scoreboard players get $score_on_non_player_entity gm4.environment_check_results |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Assigns a score to this marker and reads it back. Kills the marker afterwards | ||
# @s = test marker, just summoned | ||
# at @s | ||
# run from gm4:environment_check/score_on_non_player_entity | ||
|
||
# set up marker | ||
scoreboard players set @s gm4.environment_check_results 1 | ||
scoreboard players operation $score_on_non_player_entity gm4.environment_check_results = @s gm4.environment_check_results | ||
|
||
# clean up marker | ||
scoreboard players reset @s gm4.environment_check_results | ||
kill @s |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ meta: | |
required: | ||
gm4_metallurgy: 1.4.0 | ||
lib_player_death: 1.2.0 | ||
environment_checks: [gm4:score_on_non_player_entity] | ||
|
||
schedule_loops: [main] | ||
model_data: | ||
- reference: shamir/animi | ||
|
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 almost think we should only run environment checks on first install, instead of every reload? Also, we only need to perform each check once. Putting them into load makes each module run the same check again. Maybe we can finally utilize pre_load for this kind of setup check?
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.
That would miss the edge case of importing an existing world to a new server.
Uh oh!
There was an error while loading. Please reload this page.
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.
That's why these checks leave a score behind which is only reset post load. If the check was already done this reload, it won't need to check again and just uses the last result. That result is invalidated in post load, making sure the check is run again once next reload.