Просмотр исходного кода

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

LTCatt 5 лет назад
Родитель
Сommit
494dc60c98

+ 4 - 0
data/item/functions/pop_slot/pop_item.mcfunction

@@ -1,5 +1,9 @@
 summon item ~ ~ ~ {Item:{id:"minecraft:barrier",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem","PopItem"]}
 function item:pop_slot/select_item
 kill @e[type=item,nbt={Item:{id:"minecraft:barrier"}},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

+ 4 - 0
data/item/functions/pop_slot/return_item.mcfunction

@@ -1,6 +1,10 @@
 summon item ~ ~ ~ {Item:{id:"minecraft:barrier",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem","ReturnItem"]}
 function item:pop_slot/select_item
 kill @e[type=item,nbt={Item:{id:"minecraft:barrier"}},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 item:disable_throw
 tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 1 - 1
data/mini/functions/colormatch/tick2.mcfunction

@@ -4,7 +4,7 @@ execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ magma_block run function
 execute as @a[tag=mini_running] at @s if block ~ ~-2 ~ magma_block run function mini:colormatch/player_lose_heart
 
 # 检测玩家背包
-execute as @a[tag=mini_running] unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b}}] run function mini:colormatch/game/show_floor_block
+execute as @a[tag=mini_running] unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b},Count:1b}] run function mini:colormatch/game/show_floor_block
 
 # 开始新的一轮
 execute if score $countdown_fast mem matches 0 if score $color_match_type mem matches 0 run function mini:colormatch/game/remove_ground

+ 6 - 0
data/mini/functions/hotpm/game/pm_show.mcfunction

@@ -0,0 +1,6 @@
+# 返还物品
+execute if data entity @s Inventory[{Slot:8b}] run scoreboard players set @s item_slot 8
+execute if data entity @s Inventory[{Slot:8b}] at @s run function item:pop_slot/return_item
+
+# 给予tnt显示
+replaceitem entity @s hotbar.8 tnt{game_item:1b,display:{Name:'[{"text":"你是TNT的持有者","color":"white","italic":false}]'}} 1

+ 4 - 0
data/mini/functions/hotpm/tick2.mcfunction

@@ -12,6 +12,10 @@ execute if score $countdown_fast mem matches 0 if entity @a[tag=pm_holding] run
 # 检测土豆
 function mini:hotpm/game/pm_check
 
+# 往手上塞tnt
+execute as @a[tag=pm_holding] unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b},Count:1b}] run function mini:hotpm/game/pm_show
+execute as @a[tag=!pm_holding] if data entity @s Inventory[{tag:{game_item:1b}}] run clear @s tnt{game_item:1b}
+
 # HUD
 scoreboard players set $bossbar_color mem 0
 scoreboard players set @a[tag=pm_holding] bossbar_color 1

+ 2 - 1
data/mini/tags/items/game_item.json

@@ -11,6 +11,7 @@
         "minecraft:bricks",
         "minecraft:mossy_cobblestone",
         "minecraft:purpur_block",
-        "minecraft:prismarine"
+        "minecraft:prismarine",
+        "minecraft:tnt"
     ]
 }