稻谷bug修复 提示删除

This commit is contained in:
wenhe committed 2026-09-29 16:25:50 +08:00
1 parent 344fad19ac
commit bd2ebfb154
43 files changed
+700 -846

No files matched your search

@@ -74,51 +74,51 @@ SWITCH_RULES = [
# ---- 一、油锅基础 ----
{"block": OILPOT_0, "item": OILCAN, "target": OILPOT_1,
"consume": 1, "give": MEDICINE_TANK,
"tip": "§a油罐倒入油锅, 油罐变回玻璃罐"},
"tip": None},
{"block": OILPOT_1, "item": MEDICINE_TANK, "target": OILPOT_0,
"consume": 1, "give": OILCAN,
"tip": "§a从油锅取油, 装回油罐"},
"tip": None},
# ---- 二、放料(满油锅 + 裹粉半成品 -> 炸物(生), 开始计时炸制) ----
# 油锅下须是 点燃的炉灶(stove_2) 才允许放料(否则不炸制)
{"block": OILPOT_1, "item": BREADED_CHICKEN, "target": CHICKEN_0,
"consume": 1, "startTimer": CHICKEN_0,
"needBelow": LIT_STOVE, "belowTip": "§c油锅需要放在点燃的炉灶上",
"tip": "§a放入裹粉鸡块, 开始炸制, 计时结束取出"},
"tip": None},
{"block": OILPOT_1, "item": BREADED_PORK, "target": PORK_0,
"consume": 1, "startTimer": PORK_0,
"needBelow": LIT_STOVE, "belowTip": "§c油锅需要放在点燃的炉灶上",
"tip": "§a放入裹粉猪肉, 开始炸制, 计时结束取出"},
"tip": None},
{"block": OILPOT_1, "item": BREADED_FRIES, "target": FRIES_0,
"consume": 3, "startTimer": FRIES_0,
"needBelow": LIT_STOVE, "belowTip": "§c油锅需要放在点燃的炉灶上",
"tip": "§a放入裹粉薯条x3, 开始炸制, 计时结束取出"},
"tip": None},
{"block": OILPOT_1, "item": BREADED_FISH, "target": FISH_0,
"consume": 1, "startTimer": FISH_0,
"needBelow": LIT_STOVE, "belowTip": "§c油锅需要放在点燃的炉灶上",
"tip": "§a放入裹粉鱼, 开始炸制, 计时结束取出"},
"tip": None},
{"block": OILPOT_1, "item": BREADED_TEMPURA, "target": TEMPURA_1,
"consume": 4, "startTimer": TEMPURA_1,
"needBelow": LIT_STOVE, "belowTip": "§c油锅需要放在点燃的炉灶上",
"tip": "§a放入裹粉天妇罗x4, 开始炸制, 计时结束取出"},
"tip": None},
{"block": OILPOT_1, "item": DUMPLINGS, "target": DUMPLING_1,
"consume": 3, "startTimer": DUMPLING_1,
"needBelow": LIT_STOVE, "belowTip": "§c油锅需要放在点燃的炉灶上",
"tip": "§a放入生饺子x3, 开始炸制, 计时结束取出"},
"tip": None},
# ---- 三、出锅(熟炸物 + 盘子 -> 掉落盘装成品) ----
{"block": CHICKEN_2, "item": PLATE, "action": "take_out",
"dropItem": PLATE_CHICKEN, "consume": 1, "tip": "§a取出盘装鸡块, 油锅恢复满油, 可继续放料"},
"dropItem": PLATE_CHICKEN, "consume": 1, "tip": None},
{"block": PORK_2, "item": PLATE, "action": "take_out",
"dropItem": PLATE_PORK, "consume": 1, "tip": "§a取出炸猪排(盘装), 油锅恢复满油, 可继续放料"},
"dropItem": PLATE_PORK, "consume": 1, "tip": None},
{"block": FRIES_2, "item": PLATE, "action": "take_out",
"dropItem": PLATE_FRIES, "consume": 1, "tip": "§a取出炸薯条(盘装), 油锅恢复满油, 可继续放料"},
"dropItem": PLATE_FRIES, "consume": 1, "tip": None},
{"block": FISH_2, "item": PLATE, "action": "take_out",
"dropItem": PLATE_FISH, "consume": 1, "tip": "§a取出盘装炸鱼, 油锅恢复满油, 可继续放料"},
"dropItem": PLATE_FISH, "consume": 1, "tip": None},
{"block": TEMPURA_2, "item": PLATE, "action": "take_out",
"dropItem": PLATE_TEMPURA, "consume": 1, "tip": "§a取出天妇罗炸虾, 油锅恢复满油, 可继续放料"},
"dropItem": PLATE_TEMPURA, "consume": 1, "tip": None},
{"block": DUMPLING_2, "item": PLATE, "action": "take_out",
"dropItem": PLATE_DUMPLINGS, "consume": 1, "tip": "§a取出炸饺子(盘装), 油锅恢复满油, 可继续放料"},
"dropItem": PLATE_DUMPLINGS, "consume": 1, "tip": None},
]
# ============================================================================
@@ -117,31 +117,9 @@ class YouguoService(BlueFoxServerSystem):
self._finalInfo[r["block"]] = "手持盘子出锅"
self.timerSources = set()
self.startTimerTips = {} # 空手右键启动计时 -> 提示(含总共多少秒)
self.timingTips = {} # 空手右键"已在计时中" -> 提示(同样含总共多少秒)
for src, r in self._timerBySrc.items():
self.timerSources.add(src)
self.featureBlocks.add(src)
total, stages = self._timerTotal[src] # total = 从当前级到终点剩余秒数
curLv, totLv = self._timerStages.get(src, (1, 1))
lvTip = "(第%d级/共%d级)" % (curLv, totLv) if totLv > 1 else ""
if len(stages) <= 1:
perTip = ""
elif len(set(stages)) == 1:
perTip = "每级%d秒" % stages[0]
else:
perTip = "先%d秒,再%s" % (stages[0], ",".join("%d秒" % s for s in stages[1:]))
perStr = (", " + perTip) if perTip else ""
endBlock = self._oilTerminal(src)
endName = self._finalNames.get(endBlock, "") if endBlock else ""
act = self._finalInfo.get(endBlock) if endBlock else None
actStr = (", " + act) if act else ""
base = "还需%d秒%s" % (total, perStr)
base += actStr
tip = "§a开始炸制%s: %s" % (lvTip, base)
t2 = "§e正在炸制中%s: %s" % (lvTip, base)
self.startTimerTips[src] = tip
self.timingTips[src] = t2
# ---- 右键冷却表 ----
self.cooldown = {}
@@ -193,16 +171,11 @@ class YouguoService(BlueFoxServerSystem):
try:
data = blockEntityDataComp.GetBlockEntityData(dim, pos)
if data and data["rtdd_tid"] == blockName:
comp.CreateMsg(playerId).NotifyOneMessage(
playerId, self.timingTips.get(blockName, "§e已经在计时中"))
return
except Exception:
pass
started = FeatureDispatcher.startTimerFor(blockName, dim, pos, playerId)
if started:
comp.CreateMsg(playerId).NotifyOneMessage(
playerId, self.startTimerTips.get(blockName, "§a已启动计时"))
else:
if not started:
comp.CreateMsg(playerId).NotifyOneMessage(
playerId, "§c油锅需要放在点燃的炉灶上才能开始计时")
@@ -279,10 +252,6 @@ class YouguoService(BlueFoxServerSystem):
if recipe.get("give"):
self.giveItem(playerId, recipe["give"])
# 提示
if recipe.get("tip"):
comp.CreateMsg(playerId).NotifyOneMessage(playerId, recipe["tip"])
# ============================================================================
# 三、工具方法,判断正下方是否指定方块(点燃炉灶)
# ============================================================================
@@ -207,6 +207,7 @@ class YouguoTimerService(BlueFoxServerSystem):
ids = comp.CreateGame(LevelId).GetAllPlayerIds()
if playerId in ids:
comp.CreateMsg(playerId).NotifyOneMessage(playerId, tip)
except Exception:
pass