Răsfoiți Sursa

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt 5 ani în urmă
părinte
comite
f1f7d9a992

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

@@ -1,5 +1,5 @@
 # 给予绿宝石
-summon item ~ ~ ~ {Item:{id:"emerald",Count: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 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

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

@@ -1,5 +1,5 @@
 # 给予绿宝石块
-summon item ~ ~ ~ {Item:{id:"emerald_block",Count: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 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

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

@@ -1,5 +1,5 @@
 # 给予金锭
-summon item ~ ~ ~ {Item:{id:"gold_ingot",Count: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 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

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

@@ -1,5 +1,5 @@
 # 给予金块
-summon item ~ ~ ~ {Item:{id:"gold_block",Count: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 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

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

@@ -1,5 +1,5 @@
 # 给予金粒 
-summon item ~ ~ ~ {Item:{id:"gold_nugget",Count: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 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

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

@@ -7,6 +7,7 @@ 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 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

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

@@ -0,0 +1,6 @@
+# 处理乱扔物品的玩家
+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