加入榨汁机 冰棍盒,炒冰盒 厨具架小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

@@ -340,7 +340,7 @@ class ChujuService(BlueFoxServerSystem):
# 掉落物
if recipe.get("dropItem"):
self.dropItems(dim, pos, recipe["dropItem"])
self.dropItems(dim, pos, recipe["dropItem"], playerId)
# 给背包物品
if recipe.get("giveItem"):
@@ -399,7 +399,7 @@ class ChujuService(BlueFoxServerSystem):
meat = self._readMeat(pos, dim)
meatball = MEAT_ITEMS.get(meat) if meat else None
if meatball:
self.dropItems(dim, pos, [{"name": meatball, "count": 1}])
self.dropItems(dim, pos, [{"name": meatball, "count": 1}], playerId)
self.replaceBlock(pos, dim, "rtdd:beater", playerId)
return True
return False
@@ -442,7 +442,7 @@ class ChujuService(BlueFoxServerSystem):
if not self.checkCooldown(key, 0.5):
return True
self.consumeItem(playerId, itemDict, 1)
self.dropItems(dim, pos, [{"name": CREAM_ITEM, "count": 1}])
self.dropItems(dim, pos, [{"name": CREAM_ITEM, "count": 1}], playerId)
self.replaceBlock(pos, dim, "rtdd:beater", playerId)
return True
if itemName == MILK_ITEM:
@@ -471,7 +471,7 @@ class ChujuService(BlueFoxServerSystem):
if not self.checkCooldown(key, 0.5):
return True
self.consumeItem(playerId, itemDict, 1)
self.dropItems(dim, pos, [{"name": EGG_CUSTARD_ITEM, "count": 1}])
self.dropItems(dim, pos, [{"name": EGG_CUSTARD_ITEM, "count": 1}], playerId)
self.replaceBlock(pos, dim, "rtdd:beater", playerId)
return True
return False
@@ -569,7 +569,7 @@ class ChujuService(BlueFoxServerSystem):
return False
if not self.checkCooldown(key, 0.5):
return True
self.dropItems(dim, pos, [{"name": FLOUR_ITEM, "count": 1}])
self.dropItems(dim, pos, [{"name": FLOUR_ITEM, "count": 1}], playerId)
self._clearMill(dim, pos)
return True
# 黄豆: + 玻璃罐 -> 油罐
@@ -577,7 +577,7 @@ class ChujuService(BlueFoxServerSystem):
if not self.checkCooldown(key, 0.5):
return True
self.consumeItem(playerId, itemDict, 1)
self.dropItems(dim, pos, [{"name": OIL_CAN_ITEM, "count": 1}])
self.dropItems(dim, pos, [{"name": OIL_CAN_ITEM, "count": 1}], playerId)
self._clearMill(dim, pos)
return True
return False
@@ -708,11 +708,8 @@ class ChujuService(BlueFoxServerSystem):
# ============================================================================
def giveItem(self, playerId, itemName, count=1, aux=0):
try:
itemDict = {"itemName": itemName, "count": count, "auxValue": aux}
comp.CreateItem(playerId).SpawnItemToPlayerInv(itemDict, playerId)
except Exception:
pass
""""给玩家物品": 统一走优先级(同类合并->主手->背包->掉落)"""
self.giveItemToPlayer(playerId, itemName, count)
# ============================================================================
# 十、工具方法,消耗物品
@@ -755,14 +752,19 @@ class ChujuService(BlueFoxServerSystem):
# 十二、工具方法,以掉落物形式生成物品
# ============================================================================
def dropItems(self, dim, pos, dropList):
def dropItems(self, dim, pos, dropList, playerId=None):
for d in dropList:
itemDict = {
"itemName": d["name"],
"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]))
# ============================================================================
# 十三、工具方法,冷却检查