diff options
author | Chris Xiong <chirs241097@gmail.com> | 2021-07-24 16:59:58 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2021-07-24 16:59:58 +0800 |
commit | 77f0e689f84a601f5da4aaf2308bccf74a531346 (patch) | |
tree | 8154832f6c4ac0d071a771657c4a67c6a024f398 /data/bktsb/functions/structgen/helpers/amethyst | |
download | bktmc-skyblock-77f0e689f84a601f5da4aaf2308bccf74a531346.tar.xz |
Initial public release (minecraft 1.17.1).
Diffstat (limited to 'data/bktsb/functions/structgen/helpers/amethyst')
4 files changed, 40 insertions, 0 deletions
diff --git a/data/bktsb/functions/structgen/helpers/amethyst/cast_ray.mcfunction b/data/bktsb/functions/structgen/helpers/amethyst/cast_ray.mcfunction new file mode 100644 index 0000000..74ec2b3 --- /dev/null +++ b/data/bktsb/functions/structgen/helpers/amethyst/cast_ray.mcfunction @@ -0,0 +1,13 @@ +summon armor_stand ~ ~ ~ {Glowing:1,NoGravity:1} + +scoreboard players set #a lim 360 +function bktsb:rng +execute store result entity @e[type=armor_stand,sort=nearest,nbt={Glowing:1b},tag=!ame_rays,limit=1] Rotation[0] float 1.0 run scoreboard players get #a randr + +scoreboard players set #a lim 181 +function bktsb:rng +scoreboard players set #a lim 90 +scoreboard players operation #a randr -= #a lim +execute store result entity @e[type=armor_stand,sort=nearest,nbt={Glowing:1b},tag=!ame_rays,limit=1] Rotation[1] float 1.0 run scoreboard players get #a randr + +tag @e[type=armor_stand,sort=nearest,nbt={Glowing:1b},tag=!ame_rays,limit=1] add ame_rays diff --git a/data/bktsb/functions/structgen/helpers/amethyst/generate.mcfunction b/data/bktsb/functions/structgen/helpers/amethyst/generate.mcfunction new file mode 100644 index 0000000..19719a4 --- /dev/null +++ b/data/bktsb/functions/structgen/helpers/amethyst/generate.mcfunction @@ -0,0 +1,20 @@ +scoreboard players set #a genvar 0 +execute if block ~ ~-1 ~ diamond_block run scoreboard players set #a genvar 1 + +fill ~-11 ~-12 ~-11 ~11 ~11 ~11 air +kill @e[type=item,distance=..20,nbt={Item:{id:"minecraft:redstone"}}] +fill ~-11 ~-11 ~-11 ~11 ~11 ~11 redstone_wire +execute as @e[type=item,distance=..10,nbt={Item:{id:"minecraft:redstone"}}] at @s run setblock ~ ~ ~ smooth_basalt +execute as @e[type=item,distance=..9,nbt={Item:{id:"minecraft:redstone"}}] at @s run setblock ~ ~ ~ calcite +execute as @e[type=item,distance=..8,nbt={Item:{id:"minecraft:redstone"}}] at @s run setblock ~ ~ ~ amethyst_block +execute as @e[type=item,distance=..7,nbt={Item:{id:"minecraft:redstone"}}] at @s run setblock ~ ~ ~ air +kill @e[type=item,distance=..20,nbt={Item:{id:"minecraft:redstone"}}] + +scoreboard players set #a lim 24 +function bktsb:rng +scoreboard players operation #a looper = #a randr +scoreboard players set #a lim 16 +scoreboard players operation #a looper += #a lim +scoreboard players set #a loopstep 1 + +execute if score #a genvar matches 1.. run setblock ~ ~-1 ~ repeating_command_block{auto:1,Command:"function bktsb:structgen/helpers/amethyst/loop",TrackOutput:0} diff --git a/data/bktsb/functions/structgen/helpers/amethyst/loop.mcfunction b/data/bktsb/functions/structgen/helpers/amethyst/loop.mcfunction new file mode 100644 index 0000000..dcd7362 --- /dev/null +++ b/data/bktsb/functions/structgen/helpers/amethyst/loop.mcfunction @@ -0,0 +1,3 @@ +execute if score #a looper matches ..0 run setblock ~ ~ ~ amethyst_block +execute positioned ~ ~1 ~ if score #a looper matches 1.. run function bktsb:structgen/helpers/amethyst/cast_ray +execute if score #a looper matches 1.. run scoreboard players operation #a looper -= #a loopstep diff --git a/data/bktsb/functions/structgen/helpers/amethyst/ray_tick.mcfunction b/data/bktsb/functions/structgen/helpers/amethyst/ray_tick.mcfunction new file mode 100644 index 0000000..9dca97b --- /dev/null +++ b/data/bktsb/functions/structgen/helpers/amethyst/ray_tick.mcfunction @@ -0,0 +1,4 @@ +execute as @e[type=armor_stand,tag=ame_rays] at @s run tp @s ^ ^ ^1 +execute as @e[type=armor_stand,tag=ame_rays] at @s if block ~ ~ ~ amethyst_block run setblock ~ ~ ~ budding_amethyst +execute as @e[type=armor_stand,tag=ame_rays] at @s if block ~ ~ ~ calcite run kill @s +execute as @e[type=armor_stand,tag=ame_rays] at @s if block ~ ~ ~ smooth_basalt run kill @s |