Quellcode durchsuchen

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt vor 6 Jahren
Ursprung
Commit
c3bfac695c

+ 49 - 48
data/mini/functions/colormatch/generate_floor.mcfunction

@@ -1,4 +1,5 @@
 # TODO 将场地设为固定位置
+# 随机生成地板
 execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_1",integrity:1.0f}
 execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
 execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
@@ -27,51 +28,51 @@ execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_bloc
 execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
 execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
 execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_10",integrity:0.1f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_11",integrity:0.09090909090909091f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_12",integrity:0.08333333333333333f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_13",integrity:0.07692307692307693f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_14",integrity:0.07142857142857142f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_15",integrity:0.06666666666666667f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_16",integrity:0.0625f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_17",integrity:0.058823529411764705f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_18",integrity:0.05555555555555555f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_19",integrity:0.05263157894736842f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_20",integrity:0.05f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_21",integrity:0.047619047619047616f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_22",integrity:0.045454545454545456f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_23",integrity:0.043478260869565216f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_24",integrity:0.041666666666666664f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_25",integrity:0.04f}
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
-execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
-execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_11",integrity:0.09090909090909091f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_12",integrity:0.08333333333333333f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_13",integrity:0.07692307692307693f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_14",integrity:0.07142857142857142f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_15",integrity:0.06666666666666667f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_16",integrity:0.0625f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_17",integrity:0.058823529411764705f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_18",integrity:0.05555555555555555f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_19",integrity:0.05263157894736842f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_20",integrity:0.05f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_21",integrity:0.047619047619047616f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_22",integrity:0.045454545454545456f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_23",integrity:0.043478260869565216f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_24",integrity:0.041666666666666664f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:structure_block{posX:1,mode:"LOAD",name:"mini:color_match/color_25",integrity:0.04f}
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:redstone_block
+# execute at @e[tag=color_match_floor] run setblock ~-1 ~ ~ minecraft:air
+# execute at @e[tag=color_match_floor] run setblock ~ ~ ~ minecraft:air

+ 2 - 0
data/mini/functions/colormatch/get_random_floor.mcfunction

@@ -4,6 +4,8 @@ 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

+ 60 - 0
data/mini/functions/colormatch/show_block_amount.mcfunction

@@ -0,0 +1,60 @@
+# 创建计分板
+scoreboard objectives add block_count dummy
+
+# 获取分数
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered iron_block
+tellraw @a [{"text":"iron_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered white_concrete
+tellraw @a [{"text":"white_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered quartz_block
+tellraw @a [{"text":"quartz_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered snow_block
+tellraw @a [{"text":"snow_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered white_wool
+tellraw @a [{"text":"white_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered gold_block
+tellraw @a [{"text":"gold_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered sponge
+tellraw @a [{"text":"sponge数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered sandstone
+tellraw @a [{"text":"sandstone数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered yellow_concrete
+tellraw @a [{"text":"yellow_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered end_stone
+tellraw @a [{"text":"end_stone数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered emerald_block
+tellraw @a [{"text":"emerald_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered lime_concrete
+tellraw @a [{"text":"lime_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered melon
+tellraw @a [{"text":"melon数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered dark_prismarine
+tellraw @a [{"text":"dark_prismarine数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered green_wool
+tellraw @a [{"text":"green_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered diamond_block
+tellraw @a [{"text":"diamond_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered prismarine
+tellraw @a [{"text":"prismarine数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered blue_ice
+tellraw @a [{"text":"blue_ice数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+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
+tellraw @a [{"text":"warped_wart_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered prismarine_bricks
+tellraw @a [{"text":"prismarine_bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_wool
+tellraw @a [{"text":"red_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered red_concrete
+tellraw @a [{"text":"red_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered netherrack
+tellraw @a [{"text":"netherrack数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+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
+tellraw @a [{"text":"red_nether_bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+execute store result score block_count block_count at @e[tag=color_match_floor] run clone ~1 ~ ~ ~26 ~ ~25 ~1 ~1 ~ filtered bricks
+tellraw @a [{"text":"bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"}}]
+
+# 删除方块
+execute at @e[tag=color_match_floor] run fill ~1 ~1 ~ ~26 ~1 ~25 air replace
+
+# 删除计分板
+scoreboard objectives remove block_count