ceshi 1
This commit is contained in:
1 parent
9eb9edbb8a
commit
b768ff1555
10 files changed
+618
-15
No files matched your search
+77
-3
@@ -377,9 +377,83 @@ SWITCH_RULES = [
|
||||
"tip": "§a倒入豆浆, 开始熬制; 等计时结束变成 煮豆腐(熟), 拿菜刀右键切成 豆腐x16"},
|
||||
|
||||
# ---------------- 六、出锅(熟汤羹+木碗 -> 碗装成品, 锅变回汤锅(空)) ----------------
|
||||
# 【已迁移 2026-09-23】手持 木碗/盘子 右键 熟汤方块 的 take_out 全部搬到了
|
||||
# ITEM_USE_ON_RULES(source=surface), 走 itemUseOn 路径: 转换+取消放置同一事件,
|
||||
# 进客户端白名单提前拦, 消除"盛出闪一下"。此处不再定义(避免 blockUse 先拦截)。
|
||||
{"block": CARROT_BEEF_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_CARROT_BEEF, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜牛肉汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": LAMB_SOUP_WITH_TURNIPS_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_LAMB_TURNIP, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜羊肉汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": CARROT_RIBS_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_CARROT_RIBS, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜排骨汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": VEGETABLE_BEEF_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_VEGETABLE_BEEF, "consume": 1,
|
||||
"tip": "§a盛出 清汤羊肉, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": VEGETABLE_LAMB_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_VEGETABLE_LAMB, "consume": 1,
|
||||
"tip": "§a盛出 蔬菜牛肉汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": VEGETABLE_LEAN_BROTH_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_VEGETABLE_LEAN, "consume": 1,
|
||||
"tip": "§a盛出 蔬菜瘦肉汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": VEGETABLE_SSTEW_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_VEGETABLE_SSTEW, "consume": 1,
|
||||
"tip": "§a盛出 蔬菜乱炖, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": BEEF_BONE_BROTH_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_BEEF_BONE, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜土豆牛骨汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": LAMB_STEW_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_LAMB_STEW, "consume": 1,
|
||||
"tip": "§a盛出 土豆胡萝卜炖羊肉, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": LAMB_CHOP_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_LAMB_CHOP, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜土豆羊排汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": CARROT_COD_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_CARROT_COD, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜鳕鱼汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": CARROT_FISH_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_CARROT_FISH, "consume": 1,
|
||||
"tip": "§a盛出 胡萝卜鲑鱼汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": EGG_COD_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_EGG_COD, "consume": 1,
|
||||
"tip": "§a盛出 蛋花鳕鱼汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": NORI_EGG_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_NORI_EGG, "consume": 1,
|
||||
"tip": "§a盛出 瘦肉蛋花汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": TOFU_FISH_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_TOFU_FISH, "consume": 1,
|
||||
"tip": "§a盛出 豆腐鲑鱼汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": CHICKEN_STEW_MUSHROOMS_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_MUSHROOM_CHICKEN, "consume": 1,
|
||||
"tip": "§a盛出 蘑菇炖鸡, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": RAW_PIG_FOOD_SOUP_5, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_PIG_FOOT, "consume": 1,
|
||||
"tip": "§a盛出 猪蹄汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": ROUJIAMO_SOUP_1, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_ROUJIAMO, "consume": 1,
|
||||
"tip": "§a盛出 羊肉泡馍汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": COOKED_NOODLE_SOUP, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_NOODLE, "consume": 1,
|
||||
"tip": "§a盛出 熟面条, 锅变回 汤锅(空); 熟面条可做汤面"},
|
||||
{"block": DUMPLINGS_SOUP_2, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_DUMPLINGS, "consume": 1,
|
||||
"tip": "§a盛出 饺子_碗装, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
# 菜谱32 todo: 饺子汤_熟 + 盘子 -> 美味饺子(全份)盘装
|
||||
{"block": DUMPLINGS_SOUP_2, "item": PLATE, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": PLATE_30A, "consume": 1,
|
||||
"tip": "§a捞出 美味饺子(全份)盘装, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
{"block": VEGETABLE_FISH_SOUP_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_VEGETABLE_FISH, "consume": 1,
|
||||
"tip": "§a盛出 蔬菜鱼片汤, 锅变回 汤锅(空); 成品【吃】右键食用"},
|
||||
# 菜谱38 碗装米饭(木碗盛出)
|
||||
{"block": RICE_POT_1, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_RICE_1, "consume": 1,
|
||||
"tip": "§a盛出 米饭_1(熟米饭_形态1), 锅变回 汤锅(空); 碗装米饭供炒锅蛋炒饭"},
|
||||
{"block": RICE_POT_2, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_RICE_2, "consume": 1,
|
||||
"tip": "§a盛出 米饭_2(熟米饭_形态2), 锅变回 汤锅(空); 碗装米饭供炒锅蛋炒饭"},
|
||||
{"block": RICE_POT_3, "item": BOWL, "action": "take_out",
|
||||
"target": POT_EMPTY, "dropItem": BOWL_RICE_3, "consume": 1,
|
||||
"tip": "§a盛出 米饭_3(熟米饭_形态3), 锅变回 汤锅(空); 碗装米饭供炒锅蛋炒饭"},
|
||||
|
||||
# ---------------- 七、取出(空手/菜刀, 锅变回汤锅(空)) ----------------
|
||||
# 菜谱37 饭团
|
||||
|
||||
+29
@@ -257,6 +257,35 @@ class TangguoService(BlueFoxServerSystem):
|
||||
# 二、通用转换执行
|
||||
# ============================================================================
|
||||
|
||||
def handleTakeoutRequest(self, playerId, blockName, itemName, dim, pos):
|
||||
"""客户端显式触发的盛出请求(消闪方案)。
|
||||
客户端已把 (碗/盘, 成品汤方块) 的放置预览拦掉(见 ClientFeatureDispatcher),
|
||||
本方法在服务端补齐盛出逻辑, 与右键 take_out 等效:
|
||||
- 校验落点仍是该成品方块(防客户端事件与服务端 ServerBlockUseEvent 双份)
|
||||
- 用 (block, item) 精确定位盛出规则并执行 switch
|
||||
"""
|
||||
# 守卫1: 防空手/非碗盘(客户端已过滤, 这里再兜底)
|
||||
if not itemName or itemName in ("minecraft:air",):
|
||||
return
|
||||
try:
|
||||
b = comp.CreateBlockInfo(LevelId).GetBlockNew(pos, dim)
|
||||
cur = b.get("name") if b else None
|
||||
except Exception:
|
||||
cur = None
|
||||
# 守卫2: 落点方块已不是该成品(可能已被旧路径/上一次盛出处理掉) -> 跳过, 防重复
|
||||
if cur != blockName:
|
||||
print "[TakeoutRequest-SKIP-ALREADY]", "want:", blockName, "cur:", cur, "pos:", pos
|
||||
return
|
||||
recipe = self.recipes.get((blockName, itemName))
|
||||
if not recipe or recipe.get("action") != "take_out":
|
||||
return
|
||||
# 守卫3: 冷却, 防连点双发
|
||||
if not self.checkCooldown((dim, pos[0], pos[1], pos[2]), 0.4):
|
||||
return
|
||||
itemDict = self.getCarriedItem(playerId)
|
||||
self.handleSwitch(recipe, playerId, pos, dim, itemDict)
|
||||
print "[TakeoutRequest-DONE]", "player:", playerId, "item:", itemName, "block:", blockName
|
||||
|
||||
def handleSwitch(self, recipe, playerId, pos, dim, itemDict):
|
||||
# 消耗物品(数量不足则拦截, 不转换)
|
||||
consume = recipe.get("consume", 0)
|
||||
|
||||
Reference in new issue
Block a user