Bladeren bron

关闭测试;未开始游戏时新入玩家丢进主大厅

LTCatt 6 jaren geleden
bovenliggende
commit
a4700e93d9

+ 1 - 1
data/ltw/functions/init.mcfunction

@@ -36,4 +36,4 @@ function mini:main/init
 # 状态
 function ltw:state/0/state_enter
 
-# TODO 让玩家进入时触发 ltw:main/player_enter
+# TODO 让玩家离开时触发 ltw:main/player_leave

+ 8 - 1
data/ltw/functions/main/player_enter.mcfunction

@@ -1 +1,8 @@
-say Hello!
+# 当玩家加入游戏时触发
+
+# 如果未开始游戏,拖回等待大厅
+execute if score $state mem matches 0 run function ltw:state/0/player_enter
+
+# 如果已开始游戏
+#   如果玩家是旁观者
+#     如果

+ 1 - 1
data/ltw/functions/main/tick4.mcfunction

@@ -1,4 +1,4 @@
 # 离开次数为不存在,则为第一次加入游戏
-# 离开次数不为0,则离开过游戏
+# 离开次数不为 0,则离开过游戏
 execute as @a unless score @s leave_game matches 0 run function ltw:main/player_enter
 execute as @a unless score @s leave_game matches 0 run scoreboard players set @s leave_game 0

+ 2 - 2
data/ltw/functions/state/7/state_enter.mcfunction

@@ -13,5 +13,5 @@ setblock 0 10 2000 minecraft:structure_block{mode:"LOAD",name:"ltw:select"}
 setblock 0 11 2000 minecraft:redstone_block
 
 # 判断进入下一轮小游戏或结束
-# execute if score $game_type mem matches 1 if score $round mem matches ..3 run function ltw:state/7/continue_gameparty
-# execute if score $game_type mem matches 1 if score $round mem matches 4.. run function ltw:main/game_end
+execute if score $game_type mem matches 1 if score $round mem matches ..3 run function ltw:state/7/continue_gameparty
+execute if score $game_type mem matches 1 if score $round mem matches 4.. run function ltw:main/game_end