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

@@ -26,6 +26,9 @@ comp = serverApi.GetEngineCompFactory() # 组件工厂
from ....BlueFoxTools.SpecialFunciton.BlueFoxSystem import BlueFoxServerSystem
from ..ShiyongfoodData import EAT_RULE_MAP, TRY_USE_RULES
# ---- 吃的声音 random.eat(任务三) ----
from ....ModUtil.ServerUtil import PlaySoundToAllClient
class ShiyongfoodService(BlueFoxServerSystem):
"""总食用服务: 所有成品右键吃(方块吃 + 手持物品直接吃)"""
@@ -85,11 +88,14 @@ class ShiyongfoodService(BlueFoxServerSystem):
# 方块转换成下一级(半份/下一份)
self._replaceBlock(playerId, pos, dim, target)
else:
# 完全消耗消失 + 掉落容器
self._clearBlock(playerId, pos, dim)
# 任务三: 不再掉落容器, 而是把容器(脏盘子/木碗/玻璃杯/支杆)原地留在方块位置
drop = rule.get("drop")
if drop:
self.dropItem(dim, pos, drop)
self._replaceBlock(playerId, pos, dim, drop)
else:
self._clearBlock(playerId, pos, dim)
# 吃的声音(任务三)
PlaySoundToAllClient((pos[0], pos[1], pos[2], dim), "random.eat", 1.0)
return True
# ====================================================================
@@ -133,6 +139,13 @@ class ShiyongfoodService(BlueFoxServerSystem):
"auxValue": itemDict.get("newAuxValue", 0),
"userData": itemDict.get("userData", {})})
self._applyFood(playerId, rule.get("hunger", 0), rule.get("effects", []))
# 吃的声音(任务三, 手持吃)
try:
_fp = comp.CreatePos(playerId).GetFootPos()
_fd = comp.CreateDimension(playerId).GetEntityDimensionId()
PlaySoundToAllClient((_fp[0], _fp[1], _fp[2], _fd), "random.eat", 1.0)
except Exception:
pass
return True
# ============================================================================