浏览代码

重构:物品丢出检测

LTCatt 5 年之前
父节点
当前提交
f6406565cb
共有 29 个文件被更改,包括 202 次插入 和 73 次删除
  1. 17 0
      data/item/functions/tick2.mcfunction
  2. 1 0
      data/lib/functions/disable_throw.mcfunction
  3. 9 0
      data/lib/functions/pop_slot/pop_item.mcfunction
  4. 10 0
      data/lib/functions/pop_slot/return_item.mcfunction
  5. 87 0
      data/lib/functions/pop_slot/select_item.mcfunction
  6. 2 0
      data/ltw/functions/clock/tick1.mcfunction
  7. 11 10
      data/ltw/functions/clock/tick2.mcfunction
  8. 2 0
      data/ltw/functions/clock/tick20.mcfunction
  9. 1 0
      data/ltw/functions/clock/tick5.mcfunction
  10. 9 6
      data/ltw/functions/init/all.mcfunction
  11. 1 0
      data/ltw/functions/state/0/player_enter.mcfunction
  12. 8 5
      data/ltw/functions/state/0/sp/join_play.mcfunction
  13. 9 6
      data/ltw/functions/state/0/sp/join_watch.mcfunction
  14. 2 0
      data/ltw/functions/state/0/state_enter.mcfunction
  15. 13 0
      data/ltw/functions/state/0/tick2.mcfunction
  16. 2 0
      data/ltw/functions/state/0/tick5.mcfunction
  17. 0 6
      data/old/item/functions/init.mcfunction
  18. 1 1
      data/old/item/functions/pop_slot/return_item.mcfunction
  19. 0 14
      data/old/item/functions/tick2.mcfunction
  20. 9 9
      data/old/ltw/functions/main/player_enter.mcfunction
  21. 0 8
      data/old/ltw/functions/state/0/state/check_slot.mcfunction
  22. 1 1
      data/old/mini/functions/ass/game_init.mcfunction
  23. 1 1
      data/old/mini/functions/colormatch/game_init.mcfunction
  24. 1 1
      data/old/mini/functions/diamond/game_init.mcfunction
  25. 1 1
      data/old/mini/functions/hotpm/game_init.mcfunction
  26. 1 1
      data/old/mini/functions/parkour/game_init.mcfunction
  27. 1 1
      data/old/mini/functions/phantom/game_init.mcfunction
  28. 1 1
      data/old/mini/functions/tntrun/game_init.mcfunction
  29. 1 1
      data/old/mini/functions/trade/game_init.mcfunction

+ 17 - 0
data/item/functions/tick2.mcfunction

@@ -0,0 +1,17 @@
+# 防止玩家丢弃物品:如果物品存在 Thrower 则要求强制捡起(在生存小游戏中关闭)
+execute unless score $state mem matches 5 as @e[type=item] if data entity @s Thrower run function lib:force_pickup_item
+execute if score $state mem matches 5 if score $is_survival_minigame mem matches 0 as @e[type=item] if data entity @s Thrower run function lib:force_pickup_item
+
+# 清理锁定暂存物品
+kill @e[type=item,tag=LockTempItem]
+
+# TODO: 未完成的重构
+
+## 检测玩家格子锁定
+#execute if score $state mem matches 1.. as @a[team=!debugging] run function item:disable_slot/check_slot
+
+## 检查玩家拾取奖励物品
+#execute as @a if data entity @s Inventory[{"tag":{"bonus_new":1b}}] run function item:bonus_item/call
+
+## 检查购买物品
+#execute as @a run function item:shop/check

+ 1 - 0
data/old/item/functions/disable_throw.mcfunction → data/lib/functions/disable_throw.mcfunction

@@ -1,4 +1,5 @@
 # 强制玩家捡起自己丢弃的物品,以物品为执行者
+
 # 更改 NBT
 data modify entity @s PickupDelay set value 0
 data modify entity @s Owner set from entity @s Thrower

+ 9 - 0
data/lib/functions/pop_slot/pop_item.mcfunction

@@ -0,0 +1,9 @@
+summon item ~ ~ ~ {Item:{id:"minecraft:red_dye",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem","PopItem"]}
+function lib:pop_slot/select_item
+kill @e[type=item,nbt={Item:{id:"minecraft:red_dye"}},tag=LockTempItem]
+# 不返还奇怪的东西
+kill @e[type=item,nbt={Item:{tag:{game_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{lobby_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{LockItem:1b}}}]
+data modify entity @e[type=item,tag=LockTempItem,limit=1] Thrower set from entity @s UUID
+tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 10 - 0
data/lib/functions/pop_slot/return_item.mcfunction

@@ -0,0 +1,10 @@
+summon item ~ ~ ~ {Item:{id:"minecraft:red_dye",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem","ReturnItem"]}
+function lib:pop_slot/select_item
+kill @e[type=item,nbt={Item:{id:"minecraft:red_dye"}},tag=LockTempItem]
+# 不返还奇怪的东西
+kill @e[type=item,nbt={Item:{tag:{game_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{lobby_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{LockItem:1b}}}]
+data modify entity @e[type=item,tag=LockTempItem,limit=1] Thrower set from entity @s UUID
+execute as @e[type=item,tag=LockTempItem,limit=1] run function lib:force_pickup_item
+tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 87 - 0
data/lib/functions/pop_slot/select_item.mcfunction

@@ -0,0 +1,87 @@
+# TODO: [HIM] 二分分拆 select_item 函数,以优化性能(顺便补一点使用这套东西的注释)
+
+execute if score @s temp matches 0 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:0b}]
+execute if score @s temp matches 1 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:1b}]
+execute if score @s temp matches 2 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:2b}]
+execute if score @s temp matches 3 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:3b}]
+execute if score @s temp matches 4 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:4b}]
+execute if score @s temp matches 5 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:5b}]
+execute if score @s temp matches 6 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:6b}]
+execute if score @s temp matches 7 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:7b}]
+execute if score @s temp matches 8 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:8b}]
+execute if score @s temp matches 9 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:9b}]
+execute if score @s temp matches 10 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:10b}]
+execute if score @s temp matches 11 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:11b}]
+execute if score @s temp matches 12 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:12b}]
+execute if score @s temp matches 13 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:13b}]
+execute if score @s temp matches 14 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:14b}]
+execute if score @s temp matches 15 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:15b}]
+execute if score @s temp matches 16 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:16b}]
+execute if score @s temp matches 17 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:17b}]
+execute if score @s temp matches 18 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:18b}]
+execute if score @s temp matches 19 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:19b}]
+execute if score @s temp matches 20 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:20b}]
+execute if score @s temp matches 21 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:21b}]
+execute if score @s temp matches 22 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:22b}]
+execute if score @s temp matches 23 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:23b}]
+execute if score @s temp matches 24 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:24b}]
+execute if score @s temp matches 25 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:25b}]
+execute if score @s temp matches 26 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:26b}]
+execute if score @s temp matches 27 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:27b}]
+execute if score @s temp matches 28 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:28b}]
+execute if score @s temp matches 29 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:29b}]
+execute if score @s temp matches 30 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:30b}]
+execute if score @s temp matches 31 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:31b}]
+execute if score @s temp matches 32 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:32b}]
+execute if score @s temp matches 33 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:33b}]
+execute if score @s temp matches 34 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:34b}]
+execute if score @s temp matches 35 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:35b}]
+execute if score @s temp matches 100 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:100b}]
+execute if score @s temp matches 101 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:101b}]
+execute if score @s temp matches 102 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:102b}]
+execute if score @s temp matches 103 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:103b}]
+execute if score @s temp matches -106 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:-106b}]
+
+execute if score @s temp matches 0 run replaceitem entity @s hotbar.0 air
+execute if score @s temp matches 1 run replaceitem entity @s hotbar.1 air
+execute if score @s temp matches 2 run replaceitem entity @s hotbar.2 air
+execute if score @s temp matches 3 run replaceitem entity @s hotbar.3 air
+execute if score @s temp matches 4 run replaceitem entity @s hotbar.4 air
+execute if score @s temp matches 5 run replaceitem entity @s hotbar.5 air
+execute if score @s temp matches 6 run replaceitem entity @s hotbar.6 air
+execute if score @s temp matches 7 run replaceitem entity @s hotbar.7 air
+execute if score @s temp matches 8 run replaceitem entity @s hotbar.8 air
+execute if score @s temp matches 9 run replaceitem entity @s inventory.0 air
+execute if score @s temp matches 10 run replaceitem entity @s inventory.1 air
+execute if score @s temp matches 11 run replaceitem entity @s inventory.2 air
+execute if score @s temp matches 12 run replaceitem entity @s inventory.3 air
+execute if score @s temp matches 13 run replaceitem entity @s inventory.4 air
+execute if score @s temp matches 14 run replaceitem entity @s inventory.5 air
+execute if score @s temp matches 15 run replaceitem entity @s inventory.6 air
+execute if score @s temp matches 16 run replaceitem entity @s inventory.7 air
+execute if score @s temp matches 17 run replaceitem entity @s inventory.8 air
+execute if score @s temp matches 18 run replaceitem entity @s inventory.9 air
+execute if score @s temp matches 19 run replaceitem entity @s inventory.10 air
+execute if score @s temp matches 20 run replaceitem entity @s inventory.11 air
+execute if score @s temp matches 21 run replaceitem entity @s inventory.12 air
+execute if score @s temp matches 22 run replaceitem entity @s inventory.13 air
+execute if score @s temp matches 23 run replaceitem entity @s inventory.14 air
+execute if score @s temp matches 24 run replaceitem entity @s inventory.15 air
+execute if score @s temp matches 25 run replaceitem entity @s inventory.16 air
+execute if score @s temp matches 26 run replaceitem entity @s inventory.17 air
+execute if score @s temp matches 27 run replaceitem entity @s inventory.18 air
+execute if score @s temp matches 28 run replaceitem entity @s inventory.19 air
+execute if score @s temp matches 29 run replaceitem entity @s inventory.20 air
+execute if score @s temp matches 30 run replaceitem entity @s inventory.21 air
+execute if score @s temp matches 31 run replaceitem entity @s inventory.22 air
+execute if score @s temp matches 32 run replaceitem entity @s inventory.23 air
+execute if score @s temp matches 33 run replaceitem entity @s inventory.24 air
+execute if score @s temp matches 34 run replaceitem entity @s inventory.25 air
+execute if score @s temp matches 35 run replaceitem entity @s inventory.26 air
+execute if score @s temp matches 100 run replaceitem entity @s armor.feet air
+execute if score @s temp matches 101 run replaceitem entity @s armor.legs air
+execute if score @s temp matches 102 run replaceitem entity @s armor.chest air
+execute if score @s temp matches 103 run replaceitem entity @s armor.head air
+execute if score @s temp matches -106 run replaceitem entity @s weapon.offhand air
+
+# scoreboard players reset @s temp

+ 2 - 0
data/ltw/functions/clock/tick1.mcfunction

@@ -1,5 +1,7 @@
 # 每 1 Tick 执行一次
 schedule function ltw:clock/tick1 1t replace
 
+# TODO: 未完成的重构
+
 # # 调用其他模块
 # execute if score $state mem matches 5 run function ltw:state/5/tick1

+ 11 - 10
data/ltw/functions/clock/tick2.mcfunction

@@ -1,18 +1,22 @@
 # 每 2 Tick 执行一次
 schedule function ltw:clock/tick2 2t replace
 
-# # 死亡触发
-# execute as @a[x=-12,y=7,z=-102,distance=..5] at @s run function ltw:main/player_death
-# execute as @a[x=-12,y=7,z=-102,distance=..5] run tp @s -13 9 -42
-
-# # 调用其他模块
-# function lib:bossbar/tick2
-# execute if score $state mem matches 0 run function ltw:state/0/tick2
+# 调用其他模块
+execute if score $state mem matches 0 run function ltw:state/0/tick2
 # execute if score $state mem matches 3 run function ltw:state/3/tick2
 # execute if score $state mem matches 4 run function ltw:state/4/tick2
 # execute if score $state mem matches 5 run function ltw:state/5/tick2
 # execute if score $state mem matches 6 run function ltw:state/6/tick2
 # execute if score $state mem matches 7 run function ltw:state/7/tick2
+# function lib:bossbar/tick2
+# 物品模块必须最后调用,以清理弹出的临时物品
+function item:tick2
+
+# TODO: 未完成的重构
+
+# # 死亡触发
+# execute as @a[x=-12,y=7,z=-102,distance=..5] at @s run function ltw:main/player_death
+# execute as @a[x=-12,y=7,z=-102,distance=..5] run tp @s -13 9 -42
 
 # # 特殊方块给予效果
 # function lib:effect/floating
@@ -23,9 +27,6 @@ schedule function ltw:clock/tick2 2t replace
 # # 调用粒子模块
 # function item:particle/show_particle
 
-# # 调用物品模块(必须最后调用)
-# function item:tick2
-
 # # 全局倒计时
 # execute if score $countdown_fast mem matches 1.. run scoreboard players remove $countdown_fast mem 1
 # scoreboard players remove @e[scores={countdown_fast=1..}] countdown_fast 1

+ 2 - 0
data/ltw/functions/clock/tick20.mcfunction

@@ -1,6 +1,8 @@
 # 每秒执行一次
 schedule function ltw:clock/tick20 20t replace
 
+# TODO: 未完成的重构
+
 # # 调用其他模块
 # function item:tick20
 # function lib:bossbar/tick20

+ 1 - 0
data/ltw/functions/clock/tick5.mcfunction

@@ -4,6 +4,7 @@ schedule function ltw:clock/tick5 5t replace
 # 调用其他模块
 execute if score $state mem matches 0 run function ltw:state/0/tick5
 
+# TODO: 未完成的重构
 
 # execute if score $state mem matches 5 run function ltw:state/5/tick5
 # function ltw:main/tick5

+ 9 - 6
data/ltw/functions/init/all.mcfunction

@@ -19,6 +19,12 @@ schedule function ltw:clock/tick100 98t replace
 # ---------------------------------------------
 scoreboard objectives remove mem
 scoreboard objectives add mem dummy "全局变量"
+scoreboard objectives remove temp
+scoreboard objectives add temp dummy "缓存"
+scoreboard objectives remove temp2
+scoreboard objectives add temp2 dummy "缓存 2"
+scoreboard objectives remove UUID
+scoreboard objectives add UUID dummy "UUID"
 
 # ---------------------------------------------
 #  数字常量
@@ -97,7 +103,7 @@ gamerule logAdminCommands false
 gamerule maxEntityCramming 10
 gamerule naturalRegeneration false
 gamerule randomTickSpeed 0
-gamerule reducedDebugInfo true
+gamerule reducedDebugInfo false
 gamerule sendCommandFeedback true
 gamerule showDeathMessages false
 setworldspawn -12 7 -102
@@ -114,6 +120,8 @@ function ltw:init/entity
 function ltw:state/0/state_enter
 
 
+# TODO: 未完成的重构
+
 # # 主寄存区块:将所有需要不卸载的都放里面
 # #   已占用:(0,0,0) (0,0,1) (0,1,0) (0,1,1)
 # forceload remove all
@@ -124,10 +132,6 @@ function ltw:state/0/state_enter
 # setblock 0 1 1 stone
 
 # # 记分板
-# scoreboard objectives remove temp
-# scoreboard objectives add temp dummy
-# scoreboard objectives remove temp2
-# scoreboard objectives add temp2 dummy
 # scoreboard objectives remove countdown
 # scoreboard objectives add countdown dummy "倒计时"
 # scoreboard objectives remove countdown_fast
@@ -194,7 +198,6 @@ function ltw:state/0/state_enter
 
 # # 其他模块
 # function mini:main/init
-# function item:init
 # function lib:bossbar/init
 
 # # 重置随机数组

+ 1 - 0
data/ltw/functions/state/0/player_enter.mcfunction

@@ -24,6 +24,7 @@ function ltw:state/0/sp/join_watch
 
 
 
+# TODO: 未完成的重构
 
 ## 开启触发器
 #scoreboard players enable @s buy_trigger

+ 8 - 5
data/ltw/functions/state/0/sp/join_play.mcfunction

@@ -1,12 +1,15 @@
 
-# 物品
+# 清理现有选择物品
 clear @s lime_dye{lobby_item:1b}
 clear @s gray_dye{lobby_item:1b}
 kill @e[type=item,nbt={Item:{id:"minecraft:gray_dye",tag:{lobby_item:1b}}}]
-# execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s item_slot 0
-# execute if data entity @s Inventory[{Slot:0b}] at @s run function item:pop_slot/return_item
+# 弹出玩家放在第一格上的物品
+execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s temp 0
+execute if data entity @s Inventory[{Slot:0b}] at @s run function lib:pop_slot/return_item
+# 设置新的选择物品
 replaceitem entity @s hotbar.0 lime_dye{lobby_item:1b,display:{Name:'[{"text":"","color":"green","italic":false},"准备模式 (按 ",{"keybind":"key.drop"}," 旁观)"]',Lore:['[{"text":"","color":"gray","italic":false},"你将在下一局参与游戏"]']}}
-execute at @s run function lib:sounds/hit2
 
-# 队伍
+# 设置队伍
 team join hub_play @s
+# 播放音效
+execute at @s run function lib:sounds/hit

+ 9 - 6
data/ltw/functions/state/0/sp/join_watch.mcfunction

@@ -1,12 +1,15 @@
 
-# 物品
+# 清理现有选择物品
 clear @s lime_dye{lobby_item:1b}
 clear @s gray_dye{lobby_item:1b}
-kill @e[type=item,nbt={Item:{id:"minecraft:lime_dye",tag:{lobby_item:1b}}}]
-# execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s item_slot 0
-# execute if data entity @s Inventory[{Slot:0b}] at @s run function item:pop_slot/return_item
+kill @e[type=item,nbt={Item:{id:"minecraft:gray_dye",tag:{lobby_item:1b}}}]
+# 弹出玩家放在第一格上的物品
+execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s temp 0
+execute if data entity @s Inventory[{Slot:0b}] at @s run function lib:pop_slot/return_item
+# 设置新的选择物品
 replaceitem entity @s hotbar.0 gray_dye{lobby_item:1b,display:{Name:'[{"text":"","color":"white","italic":false},"旁观模式 (按 ",{"keybind":"key.drop"}," 准备)"]',Lore:['[{"text":"","color":"gray","italic":false},"你将在下一局旁观游戏"]']}}
-execute at @s run function lib:sounds/hit2
 
-# 队伍
+# 设置队伍
 team join hub_watch @s
+# 播放音效
+execute at @s run function lib:sounds/hit2

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

@@ -42,6 +42,8 @@ execute as @a[team=!debug] run function ltw:state/0/player_enter
 
 
 
+# TODO: 未完成的重构
+
 # 重置开始倒计时
 #scoreboard players set #start_countdown mem 9999999
 

+ 13 - 0
data/ltw/functions/state/0/tick2.mcfunction

@@ -0,0 +1,13 @@
+
+# 检查玩家是否移出了准备物品
+execute as @a[team=hub_watch] unless data entity @s Inventory[{Slot:0b,id:"minecraft:gray_dye",tag:{"lobby_item":1b}}] run function ltw:state/0/sp/join_play
+execute as @a[team=hub_play] unless data entity @s Inventory[{Slot:0b,id:"minecraft:lime_dye",tag:{"lobby_item":1b}}] run function ltw:state/0/sp/join_watch
+
+
+# TODO: 未完成的重构
+
+## 清除互斥的准备物品
+#execute as @a[team=hub_watch] if data entity @s Inventory[{tag:{lobby_item:1b,lobby_ready:1b}}] run clear @s lime_dye{lobby_item:1b} 
+#execute as @a[team=hub_play] if data entity @s Inventory[{tag:{lobby_item:1b,lobby_watch:1b}}] run clear @s gray_dye{lobby_item:1b}
+## 清除临时物品
+#clear @a red_dye{LockTempItem:1b}

+ 2 - 0
data/ltw/functions/state/0/tick5.mcfunction

@@ -7,6 +7,8 @@ execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] at @s unless enti
 # 游戏准备检查部分
 # ————————————————————————————————————————————————————————————————————————————
 
+# TODO: 未完成的重构
+
 # 检查已准备人数
 execute store result score $count mem if entity @a[team=hub_play]
 

+ 0 - 6
data/old/item/functions/init.mcfunction

@@ -1,6 +0,0 @@
-# 计分板初始化
-scoreboard objectives remove UUID
-scoreboard objectives add UUID dummy "UUID"
-
-scoreboard objectives remove item_slot
-scoreboard objectives add item_slot dummy "item_slot"

+ 1 - 1
data/old/item/functions/pop_slot/return_item.mcfunction

@@ -6,5 +6,5 @@ kill @e[type=item,nbt={Item:{tag:{game_item:1b}}}]
 kill @e[type=item,nbt={Item:{tag:{lobby_item:1b}}}]
 kill @e[type=item,nbt={Item:{tag:{LockItem:1b}}}]
 data modify entity @e[type=item,tag=LockTempItem,limit=1] Thrower set from entity @s UUID
-execute as @e[type=item,tag=LockTempItem,limit=1] run function item:disable_throw
+execute as @e[type=item,tag=LockTempItem,limit=1] run function item:force_pickup_item
 tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 0 - 14
data/old/item/functions/tick2.mcfunction

@@ -1,14 +0,0 @@
-# 防止玩家丢弃物品:如果物品存在 Thrower 则要求强制捡起
-execute unless score $survival mem matches 1.. as @e[type=item] if data entity @s Thrower run function item:disable_throw
-execute if score $survival mem matches 1.. unless score $state mem matches 5 as @e[type=item] if data entity @s Thrower run function item:disable_throw
-
-# 检查玩家拾取奖励物品
-execute as @a if data entity @s Inventory[{"tag":{"bonus_new":1b}}] run function item:bonus_item/call
-
-# 检测玩家格子锁定
-execute if score $state mem matches 1.. as @a[team=!debugging] run function item:disable_slot/check_slot
-execute if score $state mem matches 0 as @a run function ltw:state/0/state/check_slot
-execute if score $state mem matches 0.. run kill @e[type=item,tag=LockTempItem]
-
-# 检查购买物品
-execute as @a run function item:shop/check

+ 9 - 9
data/old/ltw/functions/main/player_enter.mcfunction

@@ -24,17 +24,17 @@ bossbar set ltw:notice players @a
 function lib:bossbar/show
 
 # 无指定人员
-# FIXME: 如果服务器异常关闭,玩家在再次加入的时候不会触发进入事件(由于没有离开游戏计数)
-# FIXME: 通过在每次进入阶段 3 时 kill 使用过不死图腾的玩家来解决不死图腾假死
-# FIXME: {贸易} 确认是否能进行三次交易?
-# FIXME: 如果玩家隐身,则不显示尾迹
+# FIXM: 如果服务器异常关闭,玩家在再次加入的时候不会触发进入事件(由于没有离开游戏计数)
+# FIXM: 通过在每次进入阶段 3 时 kill 使用过不死图腾的玩家来解决不死图腾假死
+# FIXM: {贸易} 确认是否能进行三次交易?
+# FIXM: 如果玩家隐身,则不显示尾迹
 
 # 龙猫
-# TODO: {钻石/贸易} 减少水;分别刷出不同的额外方块;增加一个池子
-# TODO: {土豆} 移除黄色指示器
-# TODO: 确认玩家看不到隐身玩家
-# FIXME: 再次确认音乐 Bug,是否不能在同 tick 执行?
-# FIXME: {钻石} 玩家会列入钻石的记分板(由于在 belowName 里显示)
+# TOD: {钻石/贸易} 减少水;分别刷出不同的额外方块;增加一个池子
+# TOD: {土豆} 移除黄色指示器
+# TOD: 确认玩家看不到隐身玩家
+# FIXM: 再次确认音乐 Bug,是否不能在同 tick 执行?
+# FIXM: {钻石} 玩家会列入钻石的记分板(由于在 belowName 里显示)
 
 # HIM
 

+ 0 - 8
data/old/ltw/functions/state/0/state/check_slot.mcfunction

@@ -1,8 +0,0 @@
-# 第八格
-execute unless data entity @s[team=watching] Inventory[{Slot:8b,tag:{lobby_item:1b,lobby_watch:1b}}] run function ltw:state/0/state/join_game
-execute if data entity @s[team=watching] Inventory[{tag:{lobby_item:1b,lobby_ready:1b}}] run clear @s lime_dye{lobby_item:1b,lobby_ready:1b} 
-execute unless data entity @s[team=playing] Inventory[{Slot:8b,tag:{lobby_item:1b,lobby_ready:1b}}] run function ltw:state/0/state/join_watch
-execute if data entity @s[team=playing] Inventory[{tag:{lobby_item:1b,lobby_watch:1b}}] run clear @s gray_dye{lobby_item:1b,lobby_watch:1b}
-
-# 清除临时物品
-clear @s red_dye{LockTempItem:1b}

+ 1 - 1
data/old/mini/functions/ass/game_init.mcfunction

@@ -3,7 +3,7 @@ forceload add 1000 7000 1032 7032
 
 scoreboard players set $finish_mode mem 0
 scoreboard players set $countdown_fast mem 0
-scoreboard players set $survival mem 0
+scoreboard players set $is_survival_minigame mem 0
 
 # 生成地图
 setblock 1000 4 7000 minecraft:structure_block[mode=load]{mode:"LOAD",posX:0,posY:1,posZ:0,name:"mini:ass"}

+ 1 - 1
data/old/mini/functions/colormatch/game_init.mcfunction

@@ -5,7 +5,7 @@ setblock 1049 11 3999 redstone_block
 
 # 初始化
 scoreboard players set $finish_mode mem 0
-scoreboard players set $survival mem 0
+scoreboard players set $is_survival_minigame mem 0
 scoreboard players set $color_match_time mem 60
 scoreboard players set $color_match_type mem 0
 

+ 1 - 1
data/old/mini/functions/diamond/game_init.mcfunction

@@ -3,7 +3,7 @@ forceload add 1000 5000 1064 5064
 
 scoreboard players reset * diamond
 scoreboard players set $finish_mode mem 0
-scoreboard players set $survival mem 1
+scoreboard players set $is_survival_minigame mem 1
 
 # 调整时间
 time set 8600t

+ 1 - 1
data/old/mini/functions/hotpm/game_init.mcfunction

@@ -2,7 +2,7 @@
 forceload add 1000 3000 1100 3100
 
 scoreboard players set $finish_mode mem 0
-scoreboard players set $survival mem 0
+scoreboard players set $is_survival_minigame mem 0
 scoreboard players reset * surviveRound
 
 # 伤害管理

+ 1 - 1
data/old/mini/functions/parkour/game_init.mcfunction

@@ -5,7 +5,7 @@ scoreboard players reset * treasure
 scoreboard players set $finish_mode mem 1
 scoreboard players set $tempo_enable mem 1
 scoreboard players set $countdown_fast mem 0
-scoreboard players set $survival mem 0
+scoreboard players set $is_survival_minigame mem 0
 
 # 生成地图
 setblock 1000 4 1000 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"00ll00",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:32,posZ:0,integrity:1.0f,showair:0b,name:"mini:parkour0",sizeY:32,sizeZ:32,showboundingbox:0b}

+ 1 - 1
data/old/mini/functions/phantom/game_init.mcfunction

@@ -2,7 +2,7 @@
 forceload add 1000 6000 1064 6064
 
 scoreboard players set $finish_mode mem 0
-scoreboard players set $survival mem 0
+scoreboard players set $is_survival_minigame mem 0
 scoreboard players reset * kill_phantom
 scoreboard players reset * kill_phantom2
 

+ 1 - 1
data/old/mini/functions/tntrun/game_init.mcfunction

@@ -4,7 +4,7 @@ forceload add 1000 2000 1050 2050
 scoreboard players reset * layer
 
 scoreboard players set $finish_mode mem 0
-scoreboard players set $survival mem 0
+scoreboard players set $is_survival_minigame mem 0
 
 # 生成地图
 ##000

+ 1 - 1
data/old/mini/functions/trade/game_init.mcfunction

@@ -4,7 +4,7 @@ forceload add 1000 5000 1064 5064
 scoreboard players reset * emerald
 scoreboard players reset * interactVillager
 scoreboard players set $finish_mode mem 0
-scoreboard players set $survival mem 1
+scoreboard players set $is_survival_minigame mem 1
 
 # 调整时间
 time set day