Skip to content

Commit

Permalink
1.21.2 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiome committed Oct 23, 2024
1 parent b8eea28 commit bf6ea3b
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .env.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mc_version: "1.21"
mc_version: "1.21.2"

documentation_url: "https://bookshelf.docs.gunivers.net/"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

$execute store result score #h bs.ctx run data get storage bs:const health.point $(points)

execute store success score #s bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result score #p bs.ctx run attribute @s minecraft:generic.max_health get 100000
execute store success score #s bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result score #p bs.ctx run attribute @s minecraft:max_health get 100000
execute if score #s bs.ctx matches 0 store result score #p bs.ctx run data get entity @s Health 100000
scoreboard players operation #h bs.ctx += #p bs.ctx

execute store result score #m bs.ctx run attribute @s minecraft:generic.max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit 100000
execute store result score #m bs.ctx run attribute @s minecraft:max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit 100000
scoreboard players operation #a bs.ctx -= #m bs.ctx
execute store result storage bs:ctx x double 0.00001 run scoreboard players operation #a bs.ctx += #h bs.ctx
execute if score #a bs.ctx matches 1.. run data modify storage bs:ctx x set value 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

$execute store result score #h bs.ctx run data get storage bs:const health.point $(points)

execute store result score #m bs.ctx run attribute @s minecraft:generic.max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit
execute store result score #m bs.ctx run attribute @s minecraft:max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit
scoreboard players operation #m bs.ctx -= #a bs.ctx
execute store result storage bs:ctx y double 0.00001 run scoreboard players operation #m bs.ctx += #h bs.ctx

execute store success score #s bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit
execute store success score #s bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result storage bs:ctx x double 0.00001 run scoreboard players operation #a bs.ctx -= #h bs.ctx
execute if score #s bs.ctx matches 1 if score #a bs.ctx matches ..0 run function bs.health:apply/increase_health with storage bs:ctx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# ------------------------------------------------------------------------------------------------------------

advancement grant @s only bs.health:restore_health
attribute @s minecraft:generic.max_health modifier remove bs.health:limit
$attribute @s minecraft:generic.max_health modifier add bs.health:limit $(x) add_value
attribute @s minecraft:max_health modifier remove bs.health:limit
$attribute @s minecraft:max_health modifier add bs.health:limit $(x) add_value
effect give @s minecraft:health_boost 1 0 true
effect clear @s minecraft:health_boost
effect clear @s minecraft:instant_health
attribute @s minecraft:generic.max_health modifier remove bs.health:limit
attribute @s minecraft:max_health modifier remove bs.health:limit
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# For more details, refer to the MPL v2.0.
# ------------------------------------------------------------------------------------------------------------

attribute @s minecraft:generic.max_health modifier remove bs.health:limit
$attribute @s minecraft:generic.max_health modifier add bs.health:limit $(x) add_value
attribute @s minecraft:max_health modifier remove bs.health:limit
$attribute @s minecraft:max_health modifier add bs.health:limit $(x) add_value
effect give @s minecraft:instant_health 1 28 true
advancement revoke @s only bs.health:restore_health
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# For more details, refer to the MPL v2.0.
# ------------------------------------------------------------------------------------------------------------

attribute @s minecraft:generic.max_health modifier remove bs.health:limit
attribute @s minecraft:max_health modifier remove bs.health:limit
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# For more details, refer to the MPL v2.0.
# ------------------------------------------------------------------------------------------------------------

$attribute @s minecraft:generic.max_health base set $(y)
$attribute @s minecraft:max_health base set $(y)
effect give @s minecraft:health_boost 1 0 true
effect clear @s minecraft:health_boost
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Documentation of the feature: https://bookshelf.docs.gunivers.net/en/latest/modules/health.html#get
# ------------------------------------------------------------------------------------------------------------

execute store success score #s bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result storage bs:out health.get_health double 0.00001 run attribute @s minecraft:generic.max_health get 100000
execute store success score #s bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result storage bs:out health.get_health double 0.00001 run attribute @s minecraft:max_health get 100000
execute if score #s bs.ctx matches 0 run data modify storage bs:out health.get_health set from entity @s Health
$return run data get storage bs:out health.get_health $(scale)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Documentation of the feature: https://bookshelf.docs.gunivers.net/en/latest/modules/health.html#get
# ------------------------------------------------------------------------------------------------------------

execute store result score #m bs.ctx run attribute @s minecraft:generic.max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit 100000
execute store result score #m bs.ctx run attribute @s minecraft:max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit 100000
execute store result storage bs:out health.get_max_health double 0.00001 run scoreboard players operation #m bs.ctx -= #a bs.ctx
$return run data get storage bs:out health.get_max_health $(scale)
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

$execute store result score #h bs.ctx run data get storage bs:const health.point $(points)

execute store result score #m bs.ctx run attribute @s minecraft:generic.max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit 100000
execute store result score #m bs.ctx run attribute @s minecraft:max_health get 100000
execute store result score #a bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit 100000
scoreboard players operation #m bs.ctx -= #a bs.ctx

execute store result score #p bs.ctx run data get entity @s Health 100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

$execute store result storage bs:ctx y double 0.00001 store result score #h bs.ctx run data get storage bs:const health.point $(points)

execute store success score #s bs.ctx run attribute @s minecraft:generic.max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result score #m bs.ctx run attribute @s minecraft:generic.max_health get 100000
execute store success score #s bs.ctx run attribute @s minecraft:max_health modifier value get bs.health:limit
execute if score #s bs.ctx matches 1 store result score #m bs.ctx run attribute @s minecraft:max_health get 100000
execute if score #s bs.ctx matches 1 store result storage bs:ctx x double 0.00001 run scoreboard players operation #m bs.ctx -= #h bs.ctx
execute if score #s bs.ctx matches 1 if score #m bs.ctx matches ..0 run function bs.health:apply/increase_health with storage bs:ctx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# @dummy

function #bs.health:add_max_health {points:10}
execute store result score #r bs.ctx run attribute @s minecraft:generic.max_health get
execute store result score #r bs.ctx run attribute @s minecraft:max_health get
assert score #r bs.ctx matches 30

function #bs.health:add_max_health {points:-5}
execute store result score #r bs.ctx run attribute @s minecraft:generic.max_health get
execute store result score #r bs.ctx run attribute @s minecraft:max_health get
assert score #r bs.ctx matches 25
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
execute store result score #r bs.ctx run function #bs.health:get_health {scale:1}
assert score #r bs.ctx matches 20

attribute @s minecraft:generic.max_health modifier add bs.health:limit -5 add_value
attribute @s minecraft:max_health modifier add bs.health:limit -5 add_value
execute store result score #r bs.ctx run function #bs.health:get_health {scale:1}
assert score #r bs.ctx matches 15
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
execute store result score #r bs.ctx run function #bs.health:get_max_health {scale:1}
assert score #r bs.ctx matches 20

attribute @s minecraft:generic.max_health modifier add bs.health:limit -10 add_value
attribute @s minecraft:max_health modifier add bs.health:limit -10 add_value
execute store result score #r bs.ctx run function #bs.health:get_max_health {scale:1}
assert score #r bs.ctx matches 20
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# @dummy

function #bs.health:set_max_health {points:10}
execute store result score #r bs.ctx run attribute @s minecraft:generic.max_health get
execute store result score #r bs.ctx run attribute @s minecraft:max_health get
assert score #r bs.ctx matches 10

function #bs.health:set_max_health {points:20}
execute store result score #r bs.ctx run attribute @s minecraft:generic.max_health get
execute store result score #r bs.ctx run attribute @s minecraft:max_health get
assert score #r bs.ctx matches 20
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ execute if entity @s[type=#bs.hitbox:size/group_64] run scoreboard players add #
execute store result storage bs:ctx y short 1 run scoreboard players get #i bs.ctx
function bs.hitbox:get_entity/dispatch with storage bs:ctx

execute store result storage bs:out hitbox.scale double .000001 store success score #s bs.ctx run attribute @s minecraft:generic.scale get 1000000
execute store result storage bs:out hitbox.scale double .000001 store success score #s bs.ctx run attribute @s minecraft:scale get 1000000
execute if score #s bs.ctx matches 0 run data modify storage bs:out hitbox.scale set value 1.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ function #bs.hitbox:get_entity
assert data storage bs:out hitbox{ scale: 1.0 }

## |TEST CASE|: Custom entity scale
attribute @s minecraft:generic.scale base set 0.42
attribute @s minecraft:scale base set 0.42
function #bs.hitbox:get_entity
assert data storage bs:out hitbox{ scale: 0.42 }
3 changes: 2 additions & 1 deletion scripts/src/packtest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ def run(self, datapacks: Path, target: Path, logger: BaseLogger = new_logger())

logger.step("🧪 Running test server…")
process = subprocess.Popen(
"java -Xmx2G -Dpacktest.auto -Dpacktest.auto.annotations -jar server.jar nogui",
"java -Dpacktest.auto -Dpacktest.auto.annotations -Xms4096M -Xmx4096M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar nogui",
encoding='utf-8',
errors="replace",
stdout=subprocess.PIPE,
universal_newlines=True,
shell=True,
Expand Down

0 comments on commit bf6ea3b

Please sign in to comment.