diff --git a/gm4_desire_lines/data/gm4_desire_lines/function/init.mcfunction b/gm4_desire_lines/data/gm4_desire_lines/function/init.mcfunction index 1cfbfa707d..aafae3023a 100644 --- a/gm4_desire_lines/data/gm4_desire_lines/function/init.mcfunction +++ b/gm4_desire_lines/data/gm4_desire_lines/function/init.mcfunction @@ -4,8 +4,14 @@ scoreboard objectives add gm4_dl_affcoarse dummy # constants scoreboard players set #base_probability gm4_desire_lines 1 scoreboard players set #sneak_penality gm4_desire_lines -5 -scoreboard players set #sprint_penalty gm4_desire_lines 3 -scoreboard players set #impact_penalty gm4_desire_lines 8 +scoreboard players set #sprint_penalty gm4_desire_lines 1 +scoreboard players set #impact_penalty gm4_desire_lines 31 + +# considerations +# walking speed = 4.317 blocks/s ~ 4.63 ticks / block +# sprinting speed = 5.612 blocks/s ~ 3.56 ticks / block +# walking ~ 1 - (0.99)^4.63 = 0.045 ~ 5% chance to convert each block +# sprinting ~ 1 - (0.98)^3.56 = 0.069 ~ 7% chance to convert each block execute unless score desire_lines gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Desire Lines"} execute unless score desire_lines gm4_earliest_version < desire_lines gm4_modules run scoreboard players operation desire_lines gm4_earliest_version = desire_lines gm4_modules diff --git a/gm4_desire_lines/data/gm4_desire_lines/function/path.mcfunction b/gm4_desire_lines/data/gm4_desire_lines/function/path.mcfunction index d68cd3852a..20ed6d8ef4 100644 --- a/gm4_desire_lines/data/gm4_desire_lines/function/path.mcfunction +++ b/gm4_desire_lines/data/gm4_desire_lines/function/path.mcfunction @@ -4,7 +4,7 @@ # run from player # check blocks -fill ~ ~-0.06 ~ ~ ~-0.06 ~ coarse_dirt replace dirt +execute positioned ~ ~-0.06 ~ if predicate gm4_desire_lines:can_coarse_dirt run fill ~ ~ ~ ~ ~ ~ coarse_dirt replace dirt fill ~ ~-0.06 ~ ~ ~-0.06 ~ dirt replace grass_block fill ~ ~ ~ ~ ~ ~ air replace snow[layers=1] fill ~ ~ ~ ~ ~ ~ snow[layers=1] replace snow[layers=2] @@ -13,8 +13,8 @@ fill ~ ~-0.06 ~ ~ ~-0.06 ~ frosted_ice[age=3] replace frosted_ice[age=2] fill ~ ~-0.06 ~ ~ ~-0.06 ~ frosted_ice[age=2] replace frosted_ice[age=1] fill ~ ~-0.06 ~ ~ ~-0.06 ~ frosted_ice[age=1] replace frosted_ice[age=0] -# remove foliage -execute if block ~ ~ ~ #gm4:foliage unless block ~ ~ ~ moss_carpet run setblock ~ ~ ~ air destroy +# remove foliage if coarse dirt +execute if block ~ ~-0.07 ~ coarse_dirt if block ~ ~ ~ #gm4:foliage unless block ~ ~ ~ moss_carpet run setblock ~ ~ ~ air destroy # advancement check execute if block ~ ~-0.07 ~ coarse_dirt run scoreboard players add @s gm4_dl_affcoarse 1 diff --git a/gm4_desire_lines/data/gm4_desire_lines/predicate/can_coarse_dirt.json b/gm4_desire_lines/data/gm4_desire_lines/predicate/can_coarse_dirt.json new file mode 100644 index 0000000000..a9a1718c7e --- /dev/null +++ b/gm4_desire_lines/data/gm4_desire_lines/predicate/can_coarse_dirt.json @@ -0,0 +1,41 @@ +{ + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:location_check", + "offsetX": 1, + "predicate": { + "block": { + "blocks": "#dirt" + } + } + }, + { + "condition": "minecraft:location_check", + "offsetX": -1, + "predicate": { + "block": { + "blocks": "#dirt" + } + } + }, + { + "condition": "minecraft:location_check", + "offsetZ": 1, + "predicate": { + "block": { + "blocks": "#dirt" + } + } + }, + { + "condition": "minecraft:location_check", + "offsetZ": -1, + "predicate": { + "block": { + "blocks": "#dirt" + } + } + } + ] +}