Browse Source

优化奖励物品位置与背景生成

LTCatt 6 years ago
parent
commit
ea279cfd77

+ 2 - 4
data/ltw/functions/state/6/generate_background.mcfunction

@@ -1,11 +1,9 @@
+# 生成单个奖励位置的背景
 
 execute if entity @e[type=item,tag=item_white,dx=0,dy=0,dz=0] run setblock ~ ~-2 ~ white_stained_glass
-execute if entity @e[type=item,tag=item_white,dx=0,dy=0,dz=0] run setblock ~ ~-3 ~ sea_lantern
 execute if entity @e[type=item,tag=item_green,dx=0,dy=0,dz=0] run setblock ~ ~-2 ~ lime_stained_glass
-execute if entity @e[type=item,tag=item_green,dx=0,dy=0,dz=0] run setblock ~ ~-3 ~ sea_lantern
 execute if entity @e[type=item,tag=item_blue,dx=0,dy=0,dz=0] run setblock ~ ~-2 ~ light_blue_stained_glass
-execute if entity @e[type=item,tag=item_blue,dx=0,dy=0,dz=0] run setblock ~ ~-3 ~ sea_lantern
 execute if entity @e[type=item,tag=item_purple,dx=0,dy=0,dz=0] run setblock ~ ~-2 ~ magenta_stained_glass
-execute if entity @e[type=item,tag=item_purple,dx=0,dy=0,dz=0] run setblock ~ ~-3 ~ sea_lantern
+execute if entity @e[type=item,dx=0,dy=0,dz=0] run setblock ~ ~-3 ~ sea_lantern
 execute unless entity @e[type=item,dx=0,dy=0,dz=0] run setblock ~ ~-2 ~ black_stained_glass
 execute unless entity @e[type=item,dx=0,dy=0,dz=0] run setblock ~ ~-3 ~ black_concrete

+ 17 - 14
data/ltw/functions/state/6/generate_bonus.mcfunction

@@ -3,18 +3,21 @@ kill @e[type=item]
 
 execute store result score $t_bonus_count mem if entity @a[tag=!watcher]
 # scoreboard players add $t_bonus_count mem 1
-execute if score $t_bonus_count mem matches 1.. positioned 17.50 10.30 1967.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 2.. positioned 19.50 10.30 1962.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 3.. positioned 24.50 10.30 1960.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 4.. positioned 29.50 10.30 1962.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 5.. positioned 31.50 10.30 1967.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 6.. positioned 29.50 10.30 1972.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 7.. positioned 24.50 10.30 1974.50 run function item:bonus_item/rank/random
-execute if score $t_bonus_count mem matches 8.. positioned 19.50 10.30 1972.50 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 1.. positioned 17.5 10.2 1967.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 2.. positioned 19.5 10.2 1962.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 3.. positioned 24.5 10.2 1960.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 4.. positioned 29.5 10.2 1962.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 5.. positioned 31.5 10.2 1967.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 6.. positioned 29.5 10.2 1972.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 7.. positioned 24.5 10.2 1974.5 run function item:bonus_item/rank/random
+execute if score $t_bonus_count mem matches 8.. positioned 19.5 10.2 1972.5 run function item:bonus_item/rank/random
 
-# 生成拾取窗口
-#execute as @e[type=item] at @s run fill ~-0.2 ~ ~-0.2 ~0.2 ~ ~0.2 air
-#execute as @e[type=item] at @s run fill ~-0.2 ~1 ~-0.2 ~0.2 ~1 ~0.2 barrier
-
-# 防止幽灵实体,分 tick 执行
-schedule function ltw:state/6/generate_bonus2 1t
+# 生成拾取背景
+execute positioned 17.0 10.0 1967.0 run function ltw:state/6/generate_background
+execute positioned 19.0 10.0 1962.0 run function ltw:state/6/generate_background
+execute positioned 24.0 10.0 1960.0 run function ltw:state/6/generate_background
+execute positioned 29.0 10.0 1962.0 run function ltw:state/6/generate_background
+execute positioned 31.0 10.0 1967.0 run function ltw:state/6/generate_background
+execute positioned 29.0 10.0 1972.0 run function ltw:state/6/generate_background
+execute positioned 24.0 10.0 1974.0 run function ltw:state/6/generate_background
+execute positioned 19.0 10.0 1972.0 run function ltw:state/6/generate_background

+ 0 - 27
data/ltw/functions/state/6/generate_bonus2.mcfunction

@@ -1,27 +0,0 @@
-
-# 传送回背景生成点
-#execute as @e[type=item,x=-1,y=12,z=1999,dx=3,dy=2,dz=50] at @s run tp @s ~-1.5 ~0.5 ~
-#execute as @e[type=item,x=12,y=12,z=1999,dx=3,dy=2,dz=50] at @s run tp @s ~1.5 ~0.5 ~
-#execute as @e[type=item,x=-1,y=12,z=1999,dx=50,dy=2,dz=3] at @s run tp @s ~ ~0.5 ~-1.5
-#execute as @e[type=item,x=-1,y=12,z=2012,dx=50,dy=2,dz=3] at @s run tp @s ~ ~0.5 ~1.5
-
-# 生成奖励物品背景
-#execute as @e[type=item,tag=item_white] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 white_concrete_powder
-#execute as @e[type=item,tag=item_green] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 lime_concrete_powder
-#execute as @e[type=item,tag=item_blue] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 light_blue_concrete_powder
-#execute as @e[type=item,tag=item_purple] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 purple_concrete_powder
-
-execute positioned 17.0 10.0 1967.0 run function ltw:state/6/generate_background
-execute positioned 19.0 10.0 1962.0 run function ltw:state/6/generate_background
-execute positioned 24.0 10.0 1960.0 run function ltw:state/6/generate_background
-execute positioned 29.0 10.0 1962.0 run function ltw:state/6/generate_background
-execute positioned 31.0 10.0 1967.0 run function ltw:state/6/generate_background
-execute positioned 29.0 10.0 1972.0 run function ltw:state/6/generate_background
-execute positioned 24.0 10.0 1974.0 run function ltw:state/6/generate_background
-execute positioned 19.0 10.0 1972.0 run function ltw:state/6/generate_background
-
-# 传送回原位
-#execute as @e[type=item,x=-1,y=12,z=1999,dx=2,dy=2,dz=50] at @s run tp @s ~1.5 ~-0.5 ~
-#execute as @e[type=item,x=13,y=12,z=1999,dx=2,dy=2,dz=50] at @s run tp @s ~-1.5 ~-0.5 ~
-#execute as @e[type=item,x=-1,y=12,z=1999,dx=50,dy=2,dz=2] at @s run tp @s ~ ~-0.5 ~1.5
-#execute as @e[type=item,x=-1,y=12,z=2013,dx=50,dy=2,dz=2] at @s run tp @s ~ ~-0.5 ~-1.5