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

@@ -204,7 +204,7 @@ class YinliaoService(BlueFoxServerSystem):
return False # 无水果记录(创造直接放置的完成态) → 不反应
juiceBlock, juiceName = juiceInfo
self.consumeItem(playerId, itemDict, 1) # 消耗玻璃杯(果汁成品自带杯)
self.dropItems(dim, pos, [{"name": juiceBlock, "count": 1}])
self.dropItems(dim, pos, [{"name": juiceBlock, "count": 1}], playerId)
self.replaceBlock(pos, dim, "rtdd:juicer", playerId) # 还原空, 记录随方块清除
return True
@@ -254,7 +254,7 @@ class YinliaoService(BlueFoxServerSystem):
if not self.checkCooldown(key, 0.5):
return True
_fruit, popsicle, flavor = info
self.dropItems(dim, pos, [{"name": popsicle, "count": 2}])
self.dropItems(dim, pos, [{"name": popsicle, "count": 2}], playerId)
self.replaceBlock(pos, dim, "rtdd:icelollybox_1", playerId) # 还原未定型
return True
@@ -296,7 +296,7 @@ class YinliaoService(BlueFoxServerSystem):
return False
if not self.checkCooldown(key, 0.5):
return True
self.dropItems(dim, pos, [{"name": icecream, "count": 1}])
self.dropItems(dim, pos, [{"name": icecream, "count": 1}], playerId)
self.replaceBlock(pos, dim, "rtdd:frytheicebox", playerId) # 还原空
return True
@@ -333,7 +333,7 @@ class YinliaoService(BlueFoxServerSystem):
if not itemName or itemName == "minecraft:air":
if not self.checkCooldown(key, 0.5):
return True
self.dropItems(dim, pos, [{"name": POPSICLE_SINGLE_MELON, "count": 1}])
self.dropItems(dim, pos, [{"name": POPSICLE_SINGLE_MELON, "count": 1}], playerId)
self.replaceBlock(pos, dim, POPSICLE_SINGLE_ORANGE, playerId)
return True
return False
@@ -344,7 +344,7 @@ class YinliaoService(BlueFoxServerSystem):
if not itemName or itemName == "minecraft:air":
if not self.checkCooldown(key, 0.5):
return True
self.dropItems(dim, pos, [{"name": POPSICLE_PILE_ADD, "count": 1}])
self.dropItems(dim, pos, [{"name": POPSICLE_PILE_ADD, "count": 1}], playerId)
self.replaceBlock(pos, dim, POPSICLE_PILE_2, playerId)
return True
return False
@@ -441,10 +441,10 @@ class YinliaoService(BlueFoxServerSystem):
# 十、工具方法:以掉落物形式生成物品(取果汁/冰棍/冰沙)
# ============================================================================
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 = {
@@ -452,7 +452,11 @@ class YinliaoService(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]))
# ============================================================================
# 十一、工具方法:冷却检查