Przeglądaj źródła

花地板迁移计划

HerobrineXia 6 lat temu
rodzic
commit
5aab25ea98

+ 6 - 1
data/mini/functions/colormatch/generate_floor.mcfunction

@@ -1,2 +1,7 @@
+# 设置初始分数
 scoreboard players set $floor_generate_part mem 0
-function mini:colormatch/generate_parts
+
+# 调用地板生成
+function mini:colormatch/generate_parts
+
+#

+ 1 - 2
data/mini/functions/colormatch/generate_parts.mcfunction

@@ -1,5 +1,3 @@
-# TODO 将场地设为固定位置
-# TODO 解决奇怪的极端生成情况
 # 分数更改 
 scoreboard players add $floor_generate_part mem 1
 # 随机生成地板
@@ -30,4 +28,5 @@ execute if score $floor_generate_part mem matches 24 positioned 1000 10 4000 run
 execute if score $floor_generate_part mem matches 25 positioned 1000 10 4000 run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_25",integrity:0.04f}
 setblock 1000 9 4000 redstone_block
 setblock 1000 9 4000 air
+setblock 1000 10 4000 air
 execute if score $floor_generate_part mem matches 1..24 run schedule function mini:colormatch/generate_parts 1t

+ 25 - 27
data/mini/functions/colormatch/get_random_floor.mcfunction

@@ -1,33 +1,31 @@
-# TODO 将随机地板设为固定位置
 scoreboard players set $random_min mem 1
 scoreboard players set $random_max mem 25
 function lib:random
 
 # TODO 更换地板方块-增强对比+辨识度
 # 随机选择不消失的方块
-execute at @e[tag=color_match_floor] run fill ~1 ~1 ~ ~26 ~1 ~25 air replace
-execute at @e[tag=color_match_floor] if score $random mem matches 1 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered iron_block
-execute at @e[tag=color_match_floor] if score $random mem matches 2 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered white_concrete
-execute at @e[tag=color_match_floor] if score $random mem matches 3 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered quartz_block
-execute at @e[tag=color_match_floor] if score $random mem matches 4 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered snow_block
-execute at @e[tag=color_match_floor] if score $random mem matches 5 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered white_wool
-execute at @e[tag=color_match_floor] if score $random mem matches 6 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered gold_block
-execute at @e[tag=color_match_floor] if score $random mem matches 7 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered sponge
-execute at @e[tag=color_match_floor] if score $random mem matches 8 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered sandstone
-execute at @e[tag=color_match_floor] if score $random mem matches 9 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered yellow_concrete
-execute at @e[tag=color_match_floor] if score $random mem matches 10 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered end_stone
-execute at @e[tag=color_match_floor] if score $random mem matches 11 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered emerald_block
-execute at @e[tag=color_match_floor] if score $random mem matches 12 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered lime_concrete
-execute at @e[tag=color_match_floor] if score $random mem matches 13 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered melon
-execute at @e[tag=color_match_floor] if score $random mem matches 14 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered dark_prismarine
-execute at @e[tag=color_match_floor] if score $random mem matches 15 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered green_wool
-execute at @e[tag=color_match_floor] if score $random mem matches 16 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered diamond_block
-execute at @e[tag=color_match_floor] if score $random mem matches 17 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered prismarine
-execute at @e[tag=color_match_floor] if score $random mem matches 18 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered blue_ice
-execute at @e[tag=color_match_floor] if score $random mem matches 19 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered warped_wart_block
-execute at @e[tag=color_match_floor] if score $random mem matches 20 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered prismarine_bricks
-execute at @e[tag=color_match_floor] if score $random mem matches 21 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_wool
-execute at @e[tag=color_match_floor] if score $random mem matches 22 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_concrete
-execute at @e[tag=color_match_floor] if score $random mem matches 23 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered netherrack
-execute at @e[tag=color_match_floor] if score $random mem matches 24 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_nether_bricks
-execute at @e[tag=color_match_floor] if score $random mem matches 25 run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered bricks
+execute positioned 1000 10 4000 if score $random mem matches 1 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered iron_block
+execute positioned 1000 10 4000 if score $random mem matches 2 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_concrete
+execute positioned 1000 10 4000 if score $random mem matches 3 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered quartz_block
+execute positioned 1000 10 4000 if score $random mem matches 4 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered snow_block
+execute positioned 1000 10 4000 if score $random mem matches 5 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_wool
+execute positioned 1000 10 4000 if score $random mem matches 6 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered gold_block
+execute positioned 1000 10 4000 if score $random mem matches 7 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sponge
+execute positioned 1000 10 4000 if score $random mem matches 8 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sandstone
+execute positioned 1000 10 4000 if score $random mem matches 9 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered yellow_concrete
+execute positioned 1000 10 4000 if score $random mem matches 10 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered end_stone
+execute positioned 1000 10 4000 if score $random mem matches 11 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered emerald_block
+execute positioned 1000 10 4000 if score $random mem matches 12 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered lime_concrete
+execute positioned 1000 10 4000 if score $random mem matches 13 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered melon
+execute positioned 1000 10 4000 if score $random mem matches 14 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered dark_prismarine
+execute positioned 1000 10 4000 if score $random mem matches 15 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered green_wool
+execute positioned 1000 10 4000 if score $random mem matches 16 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered diamond_block
+execute positioned 1000 10 4000 if score $random mem matches 17 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine
+execute positioned 1000 10 4000 if score $random mem matches 18 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered blue_ice
+execute positioned 1000 10 4000 if score $random mem matches 19 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered warped_wart_block
+execute positioned 1000 10 4000 if score $random mem matches 20 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine_bricks
+execute positioned 1000 10 4000 if score $random mem matches 21 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_wool
+execute positioned 1000 10 4000 if score $random mem matches 22 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_concrete
+execute positioned 1000 10 4000 if score $random mem matches 23 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered netherrack
+execute positioned 1000 10 4000 if score $random mem matches 24 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_nether_bricks
+execute positioned 1000 10 4000 if score $random mem matches 25 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered bricks

+ 26 - 26
data/mini/functions/colormatch/show_block_amount.mcfunction

@@ -3,59 +3,59 @@ scoreboard objectives add block_count dummy
 
 # 获取分数
 tellraw @a [{"text":"本轮方块列表:","color":"gold"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered iron_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered iron_block
 tellraw @a [{"text":"iron_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered white_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_concrete
 tellraw @a [{"text":"white_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered quartz_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered quartz_block
 tellraw @a [{"text":"quartz_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered snow_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered snow_block
 tellraw @a [{"text":"snow_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered white_wool
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_wool
 tellraw @a [{"text":"white_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered gold_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered gold_block
 tellraw @a [{"text":"gold_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered sponge
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sponge
 tellraw @a [{"text":"sponge数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered sandstone
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sandstone
 tellraw @a [{"text":"sandstone数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered yellow_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered yellow_concrete
 tellraw @a [{"text":"yellow_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered end_stone
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered end_stone
 tellraw @a [{"text":"end_stone数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered emerald_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered emerald_block
 tellraw @a [{"text":"emerald_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered lime_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered lime_concrete
 tellraw @a [{"text":"lime_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered melon
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered melon
 tellraw @a [{"text":"melon数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered dark_prismarine
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered dark_prismarine
 tellraw @a [{"text":"dark_prismarine数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered green_wool
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered green_wool
 tellraw @a [{"text":"green_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered diamond_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered diamond_block
 tellraw @a [{"text":"diamond_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered prismarine
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine
 tellraw @a [{"text":"prismarine数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered blue_ice
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered blue_ice
 tellraw @a [{"text":"blue_ice数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered warped_wart_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered warped_wart_block
 tellraw @a [{"text":"warped_wart_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered prismarine_bricks
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine_bricks
 tellraw @a [{"text":"prismarine_bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_wool
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_wool
 tellraw @a [{"text":"red_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_concrete
 tellraw @a [{"text":"red_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered netherrack
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered netherrack
 tellraw @a [{"text":"netherrack数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_nether_bricks
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_nether_bricks
 tellraw @a [{"text":"red_nether_bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered bricks
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered bricks
 tellraw @a [{"text":"bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
 
 # 删除方块
-execute at @e[tag=color_match_floor] run fill ~1 ~1 ~ ~26 ~1 ~25 air replace
+execute positioned 1000 10 4000 run fill ~ ~1 ~ ~25 ~1 ~25 air replace
 
 # 删除计分板
 scoreboard objectives remove block_count