Ver Fonte

修复大厅物品

HerobrineXia há 5 anos atrás
pai
commit
dd2bd583e8

+ 1 - 1
data/item/functions/shop/summon_emerald.mcfunction

@@ -1,5 +1,5 @@
 # 给予绿宝石
 # 给予绿宝石
-summon item ~ ~ ~ {Item:{id:"emerald",Count:1b,tag:{stats_item:1b}},Tags:["score_item"],PickupDelay:0}
+summon item ~ ~ ~ {Item:{id:"emerald",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID

+ 1 - 1
data/item/functions/shop/summon_emerald_block.mcfunction

@@ -1,5 +1,5 @@
 # 给予绿宝石块
 # 给予绿宝石块
-summon item ~ ~ ~ {Item:{id:"emerald_block",Count:1b,tag:{stats_item:1b}},Tags:["score_item"],PickupDelay:0}
+summon item ~ ~ ~ {Item:{id:"emerald_block",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID

+ 1 - 1
data/item/functions/shop/summon_gold.mcfunction

@@ -1,5 +1,5 @@
 # 给予金锭
 # 给予金锭
-summon item ~ ~ ~ {Item:{id:"gold_ingot",Count:1b,tag:{stats_item:1b}},Tags:["score_item"],PickupDelay:0}
+summon item ~ ~ ~ {Item:{id:"gold_ingot",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID

+ 1 - 1
data/item/functions/shop/summon_gold_block.mcfunction

@@ -1,5 +1,5 @@
 # 给予金块
 # 给予金块
-summon item ~ ~ ~ {Item:{id:"gold_block",Count:1b,tag:{stats_item:1b}},Tags:["score_item"],PickupDelay:0}
+summon item ~ ~ ~ {Item:{id:"gold_block",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID

+ 1 - 1
data/item/functions/shop/summon_nugget.mcfunction

@@ -1,5 +1,5 @@
 # 给予金粒 
 # 给予金粒 
-summon item ~ ~ ~ {Item:{id:"gold_nugget",Count:1b,tag:{stats_item:1b}},Tags:["score_item"],PickupDelay:0}
+summon item ~ ~ ~ {Item:{id:"gold_nugget",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
 data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID

+ 5 - 3
data/ltw/functions/state/0/tick5.mcfunction

@@ -50,6 +50,8 @@ execute if score #start_countdown mem matches 1..199 run title @a actionbar [{"t
 execute if score #start_countdown mem matches 200.. run title @a actionbar [{"text":"","color":"red"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | 需要 3 人以开始游戏"]
 execute if score #start_countdown mem matches 200.. run title @a actionbar [{"text":"","color":"red"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | 需要 3 人以开始游戏"]
 
 
 # 处理乱扔物品的玩家
 # 处理乱扔物品的玩家
-execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}}] at @s as @a[distance=..2] at @s run function item:shop/refresh_gold
-execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}}] at @s as @a[distance=..2] at @s run function item:shop/refresh_green
-execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}}] run kill @s
+execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}},tag=!new_stats] at @s run tag @a[distance=..2] add refresh
+execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}},tag=!new_stats] run kill @s
+execute as @a[tag=refresh] run function item:shop/refresh_gold
+execute as @a[tag=refresh] run function item:shop/refresh_green
+tag @a[tag=refresh] remove refresh