加入榨汁机 冰棍盒,炒冰盒 厨具架小bug

This commit is contained in:
wenhe committed 2026-09-29 17:14:43 +08:00
1 parent a7b56aec7d
commit 9d12baf1b2
25 files changed
+354 -227

No files matched your search

@@ -225,7 +225,7 @@ class BarbecueService(BlueFoxServerSystem):
# ---- 逆向操作 ----
# 掉落物形式生成(取下整只成品等),优先于 giveItem
if recipe.get("dropItem"):
self.dropItems(dim, pos, recipe["dropItem"])
self.dropItems(dim, pos, recipe["dropItem"], playerId)
elif recipe.get("giveItem"):
self.giveItem(playerId, recipe["giveItem"], recipe.get("giveCount", 1))
@@ -310,17 +310,17 @@ class BarbecueService(BlueFoxServerSystem):
# ============================================================================
def giveItem(self, playerId, itemName, count=1, auxValue=0):
comp.CreateItem(playerId).SpawnItemToPlayerInv(
{"itemName": itemName, "count": count, "auxValue": auxValue}, playerId)
""""给玩家物品": 统一走优先级(同类合并->主手->背包->掉落)"""
self.giveItemToPlayer(playerId, itemName, count, aux=auxValue)
# ============================================================================
# 十、工具方法:以掉落物形式生成物品(取下烤鸡/烤乳猪等)
# ============================================================================
def dropItems(self, dim, pos, dropList):
def dropItems(self, dim, pos, dropList, playerId=None):
"""
dropList 格式:[{"name": "xxx", "count": N}, ...]
在方块上方生成掉落物实体,让它自然掉到地上。
playerId 给出时走统一优先级(任务一: 同类合并->主手->背包->掉落)。
"""
for d in dropList:
itemDict = {
@@ -328,7 +328,11 @@ class BarbecueService(BlueFoxServerSystem):
"count": d.get("count", 1),
"auxValue": d.get("aux", 0),
}
self.CreateEngineItemEntity(itemDict, dim, (pos[0], pos[1] + 0.5, pos[2]))
if playerId is not None:
self.giveItemToPlayer(playerId, d["name"], d.get("count", 1), pos, dim,
aux=d.get("aux", 0))
else:
self.CreateEngineItemEntity(itemDict, dim, (pos[0], pos[1] + 0.5, pos[2]))
# ============================================================================
# 十一、工具方法:冷却检查