Просмотр исходного кода

观察者范围限制修复;游戏结束清理玩家 tag

LTCatt 6 лет назад
Родитель
Сommit
918d178608

+ 3 - 1
data/ltw/functions/clock/tick4.mcfunction

@@ -2,4 +2,6 @@
 schedule function ltw:clock/tick4 4t replace
 
 # 调用其他模块
-execute if score $state mem matches 5 run function ltw:state/5/tick4
+execute if score $state mem matches 4 run function ltw:state/4/tick4
+execute if score $state mem matches 5 run function ltw:state/5/tick4
+execute if score $state mem matches 6 run function ltw:state/6/tick4

+ 1 - 0
data/ltw/functions/state/4/tick4.mcfunction

@@ -0,0 +1 @@
+function mini:main/spectator_range

+ 2 - 1
data/ltw/functions/state/5/tick4.mcfunction

@@ -1 +1,2 @@
-function mini:main/tick4
+function mini:main/tick4
+function mini:main/spectator_range

+ 1 - 0
data/ltw/functions/state/6/tick4.mcfunction

@@ -0,0 +1 @@
+function mini:main/spectator_range

+ 2 - 0
data/mini/functions/main/spectator_range.mcfunction

@@ -0,0 +1,2 @@
+# 限制观察者范围
+execute if score $mini_type mem matches 2 run function mini:tntrun/spectator_range

+ 3 - 0
data/mini/functions/tntrun/game_end.mcfunction

@@ -7,3 +7,6 @@ kill @e[tag=tntrun_block]
 # 开启伤害
 gamerule fallDamage true
 gamerule fireDamage true
+
+# 清理玩家标签
+tag @a remove tntrun_pc

+ 2 - 0
data/mini/functions/tntrun/spectator_range.mcfunction

@@ -0,0 +1,2 @@
+# 观察者限制飞行范围
+execute as @a[gamemode=spectator] unless entity @s[x=1000,y=10,z=2000,dx=22,dz=22,dy=22] run tp @s 1011.5 27.5 2011.5

+ 0 - 3
data/mini/functions/tntrun/tick4.mcfunction

@@ -1,5 +1,2 @@
 # 玩家死亡判断
 execute as @a[tag=tntrun_pc] at @s if block ~ ~ ~ lava run function mini:tntrun/player_failed
-
-# 观察者限制飞行范围
-execute as @a[gamemode=spectator] unless entity @s[x=1000,y=10,z=2000,dx=22,dz=22,dy=22] run spectate @r[tag=tntrun_pc]