油锅 4
This commit is contained in:
1 parent
fd4f65e19e
commit
b69e487b10
2 files changed
+35
-7
No files matched your search
+20
-4
@@ -163,13 +163,23 @@ class MianshiTimerService(BlueFoxServerSystem):
|
|||||||
break
|
break
|
||||||
if rule is None:
|
if rule is None:
|
||||||
# 蒸笼等: 暂停计时(数据保留, 炉灶回来继续) + 提示发起玩家
|
# 蒸笼等: 暂停计时(数据保留, 炉灶回来继续) + 提示发起玩家
|
||||||
self._notifyIfOnline(data.get("rtdd_tp"), "§c蒸笼下的炉灶移走了, 暂停蒸制")
|
tp = ""
|
||||||
|
try:
|
||||||
|
tp = data["rtdd_tp"] or ""
|
||||||
|
except Exception:
|
||||||
|
tp = ""
|
||||||
|
self._notifyIfOnline(tp, "§c蒸笼下的炉灶移走了, 暂停蒸制")
|
||||||
return
|
return
|
||||||
# 烤炉被打碎: 方块掉落 + 变空气 + 终止计时 + 提示
|
# 烤炉被打碎: 方块掉落 + 变空气 + 终止计时 + 提示
|
||||||
|
tp = ""
|
||||||
|
try:
|
||||||
|
tp = data["rtdd_tp"] or ""
|
||||||
|
except Exception:
|
||||||
|
tp = ""
|
||||||
self._clearTimerData(dim, pos)
|
self._clearTimerData(dim, pos)
|
||||||
self._dropBlockItem(dim, pos, blockName)
|
self._dropBlockItem(dim, pos, blockName)
|
||||||
self._setAir(dim, pos)
|
self._setAir(dim, pos)
|
||||||
self._notifyIfOnline(data.get("rtdd_tp"), BREAK_TIP)
|
self._notifyIfOnline(tp, BREAK_TIP)
|
||||||
|
|
||||||
# 蒸制/烤制/发酵 完成后的"下一步"指引(按目标方块)
|
# 蒸制/烤制/发酵 完成后的"下一步"指引(按目标方块)
|
||||||
_STEAM_DONE = {"rtdd:steamerdumplings_1", "rtdd:baozilong_2",
|
_STEAM_DONE = {"rtdd:steamerdumplings_1", "rtdd:baozilong_2",
|
||||||
@@ -179,6 +189,12 @@ class MianshiTimerService(BlueFoxServerSystem):
|
|||||||
|
|
||||||
def _finishTimer(self, dim, pos, rule, data):
|
def _finishTimer(self, dim, pos, rule, data):
|
||||||
try:
|
try:
|
||||||
|
# 先取出发起玩家(下方 replaceBlock/_clearTimerData 会把实体数据清掉, 必须提前读)
|
||||||
|
tp = ""
|
||||||
|
try:
|
||||||
|
tp = data["rtdd_tp"] or ""
|
||||||
|
except Exception:
|
||||||
|
tp = ""
|
||||||
cur = comp.CreateBlockInfo(LevelId).GetBlockNew(pos, dim)
|
cur = comp.CreateBlockInfo(LevelId).GetBlockNew(pos, dim)
|
||||||
if cur and cur.get("name") != rule["source"]:
|
if cur and cur.get("name") != rule["source"]:
|
||||||
self._clearTimerData(dim, pos)
|
self._clearTimerData(dim, pos)
|
||||||
@@ -189,8 +205,8 @@ class MianshiTimerService(BlueFoxServerSystem):
|
|||||||
tip = rule.get("doneTip", "")
|
tip = rule.get("doneTip", "")
|
||||||
if tip:
|
if tip:
|
||||||
tip += self._nextStepTip(rule)
|
tip += self._nextStepTip(rule)
|
||||||
self._notifyIfOnline(data.get("rtdd_tp"), tip)
|
self._notifyIfOnline(tp, tip)
|
||||||
if not data.get("rtdd_tp"):
|
if not tp:
|
||||||
self._notifyNearby(dim, pos, tip)
|
self._notifyNearby(dim, pos, tip)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|||||||
+15
-3
@@ -147,10 +147,21 @@ class YouguoTimerService(BlueFoxServerSystem):
|
|||||||
|
|
||||||
def _handleBelowBroken(self, dim, pos, blockName, data, rules):
|
def _handleBelowBroken(self, dim, pos, blockName, data, rules):
|
||||||
"""下方点燃炉灶被移走/熄灭: 暂停计时(数据保留, 炉灶回来继续) + 提示发起玩家"""
|
"""下方点燃炉灶被移走/熄灭: 暂停计时(数据保留, 炉灶回来继续) + 提示发起玩家"""
|
||||||
self._notifyIfOnline(data.get("rtdd_tp"), "§c油锅下的炉灶移走了, 暂停炸制")
|
tp = ""
|
||||||
|
try:
|
||||||
|
tp = data["rtdd_tp"] or ""
|
||||||
|
except Exception:
|
||||||
|
tp = ""
|
||||||
|
self._notifyIfOnline(tp, "§c油锅下的炉灶移走了, 暂停炸制")
|
||||||
|
|
||||||
def _finishTimer(self, dim, pos, rule, data):
|
def _finishTimer(self, dim, pos, rule, data):
|
||||||
try:
|
try:
|
||||||
|
# 先取出发起玩家(下方 replaceBlock/_clearTimerData 会把实体数据清掉, 必须提前读)
|
||||||
|
tp = ""
|
||||||
|
try:
|
||||||
|
tp = data["rtdd_tp"] or ""
|
||||||
|
except Exception:
|
||||||
|
tp = ""
|
||||||
cur = comp.CreateBlockInfo(LevelId).GetBlockNew(pos, dim)
|
cur = comp.CreateBlockInfo(LevelId).GetBlockNew(pos, dim)
|
||||||
if cur and cur.get("name") != rule["source"]:
|
if cur and cur.get("name") != rule["source"]:
|
||||||
self._clearTimerData(dim, pos)
|
self._clearTimerData(dim, pos)
|
||||||
@@ -158,10 +169,11 @@ class YouguoTimerService(BlueFoxServerSystem):
|
|||||||
# 到点转换
|
# 到点转换
|
||||||
self.replaceBlock(pos, dim, rule["target"], None)
|
self.replaceBlock(pos, dim, rule["target"], None)
|
||||||
self._clearTimerData(dim, pos)
|
self._clearTimerData(dim, pos)
|
||||||
|
# 计时结束提示: 发给发起玩家; 发起者不在/未知则提示附近
|
||||||
tip = rule.get("doneTip", "")
|
tip = rule.get("doneTip", "")
|
||||||
if tip:
|
if tip:
|
||||||
self._notifyIfOnline(data.get("rtdd_tp"), tip)
|
self._notifyIfOnline(tp, tip)
|
||||||
if not data.get("rtdd_tp"):
|
if not tp:
|
||||||
self._notifyNearby(dim, pos, tip)
|
self._notifyNearby(dim, pos, tip)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in new issue
Block a user