ソースを参照

简化了物品掉落/锁格子系统

HerobrineXia 5 年 前
親
コミット
a91b5cdaab

+ 2 - 1
data/item/functions/disable_throw.mcfunction

@@ -7,4 +7,5 @@ data modify entity @s Owner set from entity @s Thrower
 # 将物品传送给与丢弃者 UUID 相同的玩家
 execute store result score @s UUID run data get entity @s Thrower[0]
 tag @s add item_force_tp
-execute as @a if score @s UUID = @e[type=item,tag=item_force_tp,limit=1] UUID run tp @e[type=item,tag=item_force_tp] @s
+execute as @a if score @s UUID = @e[type=item,tag=item_force_tp,limit=1] UUID run tp @e[type=item,tag=item_force_tp] @s
+tag @s remove item_force_tp

+ 0 - 1
data/item/functions/return_slot/return_slot_7.mcfunction

@@ -1,6 +1,5 @@
 summon item ~ ~ ~ {Item:{id:"barrier",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem"]}
 data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:7b}]
-data modify entity @e[type=item,tag=LockTempItem,limit=1] PickupDelay set value 0
 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
 tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 0 - 1
data/item/functions/return_slot/return_slot_8.mcfunction

@@ -1,6 +1,5 @@
 summon item ~ ~ ~ {Item:{id:"barrier",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem"]}
 data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:8b}]
-data modify entity @e[type=item,tag=LockTempItem,limit=1] PickupDelay set value 0
 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
 tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 1 - 1
data/item/functions/tick2.mcfunction

@@ -5,7 +5,7 @@ execute as @e[type=item] if data entity @s Thrower run function item:disable_thr
 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 1.. unless score $survival 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]
 

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

@@ -1,9 +1,7 @@
 # 第八格
 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[{Slot:8b,tag:{lobby_item:1b,lobby_watch:1b}}] unless data entity @s[team=watching] Inventory[{Count:1b,Slot:8b,tag:{lobby_item:1b,lobby_watch:1b}}] run function ltw:state/0/state/join_watch
 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[{Slot:8b,tag:{lobby_item:1b,lobby_ready:1b}}] unless data entity @s[team=playing] Inventory[{Count:1b,Slot:8b,tag:{lobby_item:1b,lobby_ready:1b}}] run function ltw:state/0/state/join_game
 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}
 
 # 清除临时物品