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

@@ -196,7 +196,7 @@ class MianshiService(BlueFoxServerSystem):
if not self.checkCooldown(key, 0.4):
return True
self.clearBlock(pos, dim)
self.dropItem(dim, pos, blockName)
self.dropItem(dim, pos, blockName, playerId=playerId)
return True
# ---- 空手右键"蒸笼计时源"(蒸X_生): 计时已改自动(tick 判定下方点燃炉灶),
@@ -339,7 +339,7 @@ class MianshiService(BlueFoxServerSystem):
action = recipe.get("action")
# 掉落物(切分/递减/取出) —— 无特殊动作时才走通用掉落
if recipe.get("dropItem") and not action:
self.dropItem(dim, pos, recipe["dropItem"])
self.dropItem(dim, pos, recipe["dropItem"], playerId=playerId)
# 给背包物品(水桶变空桶/擀面杖返还)
if recipe.get("give"):
self.giveItem(playerId, recipe["give"])
@@ -347,33 +347,33 @@ class MianshiService(BlueFoxServerSystem):
if action == "chop_smalldough":
self.clearBlock(pos, dim)
for _ in range(8):
self.dropItem(dim, pos, "rtdd:smalldough_0")
self.dropItem(dim, pos, "rtdd:smalldough_0", playerId=playerId)
elif action == "chop_noodles":
self.clearBlock(pos, dim)
self.dropItem(dim, pos, "rtdd:noodles")
self.dropItem(dim, pos, "rtdd:noodles", playerId=playerId)
elif action == "drop_dumpling_skin":
# 擀好的小面团压成饺子皮: 面团消失, 掉落1个饺子皮物品(地上不留方块)
self.clearBlock(pos, dim)
self.dropItem(dim, pos, recipe["dropItem"])
self.dropItem(dim, pos, recipe["dropItem"], playerId=playerId)
elif action == "drop_result":
# 捏合/塑形完成(生饺子/生肉包子): 方块消失, 成品以掉落物形式出现
self.clearBlock(pos, dim)
self.dropItem(dim, pos, recipe["dropItem"])
self.dropItem(dim, pos, recipe["dropItem"], playerId=playerId)
elif action == "unmold_cake":
# 蛋糕面糊(烤熟) 脱模 -> 蛋糕胚(方块) + 掉落 1 木碗
self.replaceBlock(pos, dim, "rtdd:cakebase", playerId)
self.dropItem(dim, pos, BOWL)
self.dropItem(dim, pos, BOWL, playerId=playerId)
elif action == "split_cake":
# 半块蛋糕 菜刀拆分: 半块消失 -> 掉落两个对应小块
self.clearBlock(pos, dim)
for _ in range(2):
self.dropItem(dim, pos, recipe["dropItem"])
self.dropItem(dim, pos, recipe["dropItem"], playerId=playerId)
elif action == "take_steamer":
# 蒸笼取出: 蒸食物块 -> 变回空蒸笼 + 掉落成品(数量按 dropCount, 默认1)
self.replaceBlock(pos, dim, "rtdd:steamer", playerId)
if recipe.get("dropItem"):
for _ in range(recipe.get("dropCount", 1)):
self.dropItem(dim, pos, recipe["dropItem"])
self.dropItem(dim, pos, recipe["dropItem"], playerId=playerId)
# 转换后启动计时(发酵等, 记录玩家以便完成提示送达)
if recipe.get("startTimer"):
FeatureDispatcher.startTimerFor(recipe["startTimer"], dim, pos, playerId)
@@ -432,11 +432,8 @@ class MianshiService(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)
# ============================================================================
# 八、工具方法,消耗物品
@@ -463,7 +460,11 @@ class MianshiService(BlueFoxServerSystem):
# 九、工具方法,以掉落物形式生成物品
# ============================================================================
def dropItem(self, dim, pos, itemName, count=1, aux=0):
def dropItem(self, dim, pos, itemName, count=1, aux=0, playerId=None):
if playerId is not None:
# 任务一: 玩家主动获得 -> 统一优先级(同类合并->主手->背包->掉落)
self.giveItemToPlayer(playerId, itemName, count, pos, dim, aux=aux)
return
try:
itemDict = {"itemName": itemName, "count": count, "auxValue": aux}
self.CreateEngineItemEntity(itemDict, dim, (pos[0], pos[1] + 0.5, pos[2]))