加挂钩 右键食物调整
This commit is contained in:
1 parent
140e179e2b
commit
7232a6e082
14 files changed
+116
-56
No files matched your search
+11
-9
@@ -229,18 +229,20 @@ class ClientFeatureDispatcher(BlueFoxClientSystem):
|
||||
itemName = itemDict.get("newItemName") or itemDict.get("itemName")
|
||||
except Exception:
|
||||
itemName = None
|
||||
_pId = args.get("playerId") or args.get("entityId")
|
||||
|
||||
# 优先: 玩家刚做过 BlockUse 转换(0.2s 内, 如炒锅/汤锅/油锅放料、鸡蛋放鸡窝、上杆),
|
||||
# 引擎重置右键会立即再触发一次"吃/投掷/倒水"。此窗口内若手持该转换涉及的可食用/可用
|
||||
# 物品(BLOCKUSE_CANCEL_ITEMS), 直接 cancel 掉默认吃/投掷, 避免"放料却吃了食物"。
|
||||
# 玩家级标记(pId)而非坐标——TryUse 事件无目标方块坐标, 只有玩家。0.2s 极短且仅在
|
||||
# 刚做完方块转换后生效, 不会影响玩家正常吃/对地面扔蛋。
|
||||
_pc = self._blockCdPlayer.get(_pId, 0)
|
||||
if _pc and (time.time() - _pc) < 0.2 and itemName in BLOCKUSE_CANCEL_ITEMS:
|
||||
args["cancel"] = True
|
||||
return
|
||||
# 饭团/水煮蛋/豆腐 在 ITEM_USE_ON_CANCEL_BY_ITEM 里(EAT_ITEMS)
|
||||
if itemName in ITEM_USE_ON_CANCEL_BY_ITEM:
|
||||
args["cancel"] = True
|
||||
# 投掷/使用抑制: 玩家刚做过 BlockUse 转换(0.2s 内, 如放蛋/放料), 引擎重置右键会立即
|
||||
# 再触发一次"投掷/使用"动画(鸡蛋右键鸡窝放蛋 -> 扔蛋)。此窗口内若手持 BlockUse 可投掷/
|
||||
# 可用物品, 直接 cancel 掉投掷; 窗口过后放行(对地扔蛋正常)。
|
||||
# 注意: 玩家级标记(pId)而非坐标——投掷事件无目标方块坐标, 只有玩家。0.2s 极短且仅在
|
||||
# 刚做完方块转换后生效, 不会影响玩家正常对地面/空中扔蛋。
|
||||
_pId = args.get("playerId") or args.get("entityId")
|
||||
_pc = self._blockCdPlayer.get(_pId, 0)
|
||||
if _pc and (time.time() - _pc) < 0.2 and itemName in BLOCKUSE_CANCEL_ITEMS:
|
||||
args["cancel"] = True
|
||||
|
||||
# 注: 客户端系统需在客户端进程被实例化。modMain 只能在服务端 import 服务端
|
||||
# 系统; 客户端系统由 BlueFox 框架自动注册其子类。为确保本类被加载, 需在
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
================================================================================
|
||||
"""
|
||||
import time
|
||||
import random
|
||||
|
||||
import mod.server.extraServerApi as serverApi
|
||||
|
||||
# ---- 网易API基础对象 ----
|
||||
|
||||
+6
-4
@@ -296,11 +296,13 @@ for _tbl in _BLOCK_USE_TABLES:
|
||||
if isinstance(_bk, basestring) and _bk:
|
||||
BLOCKUSE_CANCEL.add((_it, _bk))
|
||||
|
||||
# BlockUse 转换涉及的全部手持物品集合(客户端 OnItemTryUse 也需取消默认"使用/投掷/倒水",
|
||||
# 否则手持鸡蛋右键鸡窝会被当成投掷扔出去; 水桶倒水同理)。
|
||||
# 只取原版/可"使用"的物品(minecraft: 前缀)进入 TryUse 取消; rtdd 方块物品不触发 TryUse。
|
||||
# BlockUse 转换涉及的全部手持物品集合(客户端 OnItemTryUse 也需取消默认"吃/使用/投掷/倒水",
|
||||
# 否则手持 原版生肉/鱼/蛋 或 可食用的 rtdd 食材(brownrice/beancurd/crab/ham/beef_tenderloin
|
||||
# 等) 右键炒锅/汤锅/油锅放料时, 会被原版当"吃"前摇吞掉食材)。
|
||||
# 不限制前缀: 只要出现在放料/转换组合里都纳入, 取消仅在"放料后 0.2s 窗口"内生效,
|
||||
# 工具类(锅铲/盘子/支杆)不触发 TryUse 吃, 加宽无副作用, 能覆盖全部可食 rtdd 食材。
|
||||
BLOCKUSE_CANCEL_ITEMS = set(
|
||||
_it for (_it, _bk) in BLOCKUSE_CANCEL if _it.startswith("minecraft:")
|
||||
_it for (_it, _bk) in BLOCKUSE_CANCEL
|
||||
)
|
||||
|
||||
# ---- Chuju 锅铲/油罐 inline 转换(在 ChujuService.handleItemUseOn 内联, 不在数据表) ----
|
||||
|
||||
+5
@@ -76,6 +76,11 @@ class NaturalService(BlueFoxServerSystem):
|
||||
"""返回本功能管辖的所有右键方块名集合(右键路由用)"""
|
||||
return self.featureBlocks
|
||||
|
||||
def getItemUseOnRules(self):
|
||||
"""返回"手持物品右键方块表面"的规则。稻谷种植已改用物品 JSON 的
|
||||
minecraft:seed 组件原生处理, 故返回空(但接口必须实现, dispatch 器会调用)。"""
|
||||
return {}
|
||||
|
||||
def handleBlockUse(self, args):
|
||||
"""由 FeatureDispatcher 转发的右键方块入口(柴火/葡萄收获/水稻收获)"""
|
||||
blockName = args.get("blockName")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"format_version": "1.10",
|
||||
"minecraft:item": {
|
||||
"description": {
|
||||
"identifier": "rtdd:hooking",
|
||||
"category": "xy_kitchenware"
|
||||
},
|
||||
"components": {
|
||||
"minecraft:max_stack_size": 64
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"format_version": "1.12",
|
||||
"minecraft:recipe_shaped": {
|
||||
"key": {
|
||||
"A": {
|
||||
"item": "minecraft:iron_nugget",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
"description": {
|
||||
"identifier": "rtdd:xy_hooking"
|
||||
},
|
||||
"pattern": [
|
||||
"AA",
|
||||
"AA"
|
||||
],
|
||||
"result": {
|
||||
"data": 0,
|
||||
"item": "rtdd:hooking",
|
||||
"count": 1
|
||||
},
|
||||
"tags": [
|
||||
"crafting_table"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
"format_version": "1.12",
|
||||
"minecraft:recipe_shaped": {
|
||||
"key": {
|
||||
"1": {
|
||||
"A": {
|
||||
"item": "rtdd:support_rod",
|
||||
"data": 0
|
||||
},
|
||||
"0": {
|
||||
"item": "minecraft:iron_ingot",
|
||||
"B": {
|
||||
"item": "rtdd:hooking",
|
||||
"data": 0
|
||||
}
|
||||
},
|
||||
@@ -15,8 +15,8 @@
|
||||
"identifier": "rtdd:xy_meathook"
|
||||
},
|
||||
"pattern": [
|
||||
"1",
|
||||
"0"
|
||||
"AB",
|
||||
"AB"
|
||||
],
|
||||
"result": {
|
||||
"data": 0,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"format_version": "1.10",
|
||||
"minecraft:item": {
|
||||
"description": {
|
||||
"identifier": "rtdd:hooking"
|
||||
},
|
||||
"components": {
|
||||
"minecraft:icon": "hooking"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,7 @@ tile.rtdd:cookingrabbit.name=炒锅_49(辣炒兔肉_生)
|
||||
tile.rtdd:sushipile_5.name=寿司堆(鲑鱼寿司_三个)
|
||||
tile.rtdd:sushipile_2.name=寿司堆(鳕鱼_两个)
|
||||
item.rtdd:spatula.name=锅铲
|
||||
item.rtdd:hooking.name=挂钩
|
||||
tile.rtdd:sushipile_3.name=寿司堆(鳕鱼_三个)
|
||||
tile.rtdd:copperingotpile.name=铜锭堆_禁用
|
||||
tile.rtdd:beefkebabs_0.name=牛肉串(半熟)
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
"beancurd": {
|
||||
"textures": "textures/items/beancurd"
|
||||
},
|
||||
"hooking": {
|
||||
"textures": "textures/items/hacken"
|
||||
},
|
||||
"beef_tenderloin": {
|
||||
"textures": "textures/items/beef_tenderloin"
|
||||
},
|
||||
@@ -13,6 +16,9 @@
|
||||
"brownrice": {
|
||||
"textures": "textures/items/rice"
|
||||
},
|
||||
"chaoguo_book": {
|
||||
"textures": "textures/items/chaoguo_book"
|
||||
},
|
||||
"cleaver": {
|
||||
"textures": "textures/items/cleaver"
|
||||
},
|
||||
@@ -106,15 +112,6 @@
|
||||
"rtdd:recipe_book": {
|
||||
"textures": "textures/items/rtdd/rtdd_recipe_book"
|
||||
},
|
||||
"rice_balls": {
|
||||
"textures": "textures/items/rice_balls"
|
||||
},
|
||||
"rice_seeds": {
|
||||
"textures": "textures/items/rice_seeds"
|
||||
},
|
||||
"chaoguo_book": {
|
||||
"textures": "textures/items/chaoguo_book"
|
||||
},
|
||||
"rtdd:chaoguo_book": {
|
||||
"textures": "textures/items/chaoguo_book"
|
||||
},
|
||||
@@ -145,32 +142,8 @@
|
||||
"thedriedfish": {
|
||||
"textures": "textures/items/thedriedfish"
|
||||
},
|
||||
"boiled_egg": {
|
||||
"textures": "textures/items/boiled_egg"
|
||||
},
|
||||
"cream_0": {
|
||||
"textures": "textures/items/cream_0"
|
||||
},
|
||||
"crushed_carrots": {
|
||||
"textures": "textures/items/crushed_carrots"
|
||||
},
|
||||
"crushed_scallions": {
|
||||
"textures": "textures/items/crushed_scallions"
|
||||
},
|
||||
"potato_wedges": {
|
||||
"textures": "textures/items/potato_wedges"
|
||||
},
|
||||
"rice_balls": {
|
||||
"textures": "textures/items/rice_balls"
|
||||
},
|
||||
"rice_seeds": {
|
||||
"textures": "textures/items/rice_seeds"
|
||||
},
|
||||
"vegetable": {
|
||||
"textures": "textures/items/vegetable"
|
||||
},
|
||||
"qingcai": {
|
||||
"textures": "textures/items/meiqiedeqingcai"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 263 B |
@@ -5,7 +5,7 @@
|
||||
- 厨具分类方块: stove(炉灶)、beater(搅拌器)、meatballmaker(丸子机)、steamer(蒸笼)、
|
||||
stonemill(石磨)、oilcan(油罐)、medicinetank(玻璃罐)、oven(烤炉)、b_34(支杆)、
|
||||
bowlasoup(木碗)、plate_0(盘子)/plate_0a(脏盘子)/platepile(盘子堆)、rollingpin(擀面杖)
|
||||
- 厨具物品: spatula(锅铲)、spatula_oil(带油锅铲)、potandspoon(锅勺)、cleaver(菜刀)
|
||||
- 厨具物品: spatula(锅铲)、spatula_oil(带油锅铲)、potandspoon(锅勺)、cleaver(菜刀)、hooking(挂钩)
|
||||
- 厨具是全部烹饪的"工具层": 炒锅(翻炒/锅铲)、汤锅(翻煮/锅勺)、油锅(满油/油罐)、
|
||||
面食(擀面/擀面杖)、寿司(切/菜刀)、乡野饮料(榨汁/石磨黄豆)
|
||||
- 【待确认】表示该步骤所需的具体操作或食材尚未最终确定
|
||||
@@ -173,6 +173,10 @@
|
||||
机制: 擀面过程中擀面杖会被消耗, 干完最后一步掉落返还
|
||||
(具体见 面食.甜食转化关系.txt 一、面粉·面团组; 面食原 rollingpin_1/2/3 已移入禁用)
|
||||
|
||||
25. hooking(挂钩) 无右键交互
|
||||
机制: 仅作合成中间物品, 用于合成挂肉钩(meathook):
|
||||
挂钩 = 4个铁粒(2×2); 挂肉钩 = 2支杆 + 2挂钩(2×2), 见 配方整理汇总.txt 死亡生物段
|
||||
|
||||
========================================
|
||||
八、其他静态工具
|
||||
========================================
|
||||
|
||||
@@ -1080,6 +1080,24 @@ FurnitureData+FurnitureService 实现, 注册到 FeatureDispatcher)
|
||||
cancel 掉投掷动画; 窗口过后放行, 对地扔蛋正常。不设全局取消(会破坏对地投掷, 已弃)。
|
||||
时长 0.2s, 不卡翻炒(0.3s 间隔)。 [已修]
|
||||
|
||||
【可食食材放料拦截补充】2026-09-28
|
||||
- 症状: 手持可食用食材右键 炒锅/汤锅/油锅 放料时, 会被原版当"吃"前摇吞掉(吃了一口).
|
||||
- 根因: 此前 _blockCdPlayer(0.2s 窗口) + BLOCKUSE_CANCEL_ITEMS 只取消原版(minecraft: 前缀)物品
|
||||
的"投掷"; 但放料食材里大量是【可食用的 rtdd 自定义食材】(brownrice 大米/beancurd 豆腐/
|
||||
crab 螃蟹/ham 猪蹄/beef_tenderloin 牛里脊/costillavacaes 牛肋/crushedmeat 碎肉/grape 葡萄等,
|
||||
均带 minecraft:food + eat 动画)。这些食材放料组合已进 BLOCKUSE_CANCEL(放料成功会话 _blockCdPlayer
|
||||
标记), 但 OnItemTryUse 里 itemName 匹配不上 BLOCKUSE_CANCEL_ITEMS(因被 minecraft: 前缀过滤掉),
|
||||
→ 放料后那 0.2s 遗留的"吃"没被吞掉 → 吃掉了食材.
|
||||
- 修复: InterceptData.BLOCKUSE_CANCEL_ITEMS 去掉 minecraft: 前缀限制, 改为收集放料/转换组合里的
|
||||
【全部手持物品】(含 rtdd 食材). OnItemTryUse 的 cancel 仍只在 _blockCdPlayer(0.2s 内, 仅放料
|
||||
成功时设置) + 手持物品在集合里 时发生. [已修]
|
||||
- 影响边界(不误伤): ①BLOCKUSE_CANCEL(放置预览拦截白名单)未动, 仍是一一精确组合;
|
||||
②cancel 只在"真正放料成功后的 0.2s 窗口"内生效; 玩家平时右键空地/无转换方块吃食物, 无该标记,
|
||||
OnItemTryUse 正常放行, 吃不受影响; ③工具类(锅铲/盘子/支杆)不触发 TryUse, 加宽无副作用.
|
||||
- 覆盖功能: 炒锅(CHAOGUO)/汤锅(TANGGUO)/油锅(YOUGUO) 放料, 烧烤上杆(BBQ), 死亡生物挂肉钩
|
||||
(DEADMOB), 榨汁机放水果, 动物养殖放蛋, 家具放料 等所有已登记 _BLOCK_USE_TABLES 的转换 ——
|
||||
手持可食食材右键这些功能方块放料不再误吃. [已修]
|
||||
|
||||
########################################
|
||||
【死亡生物·生成引擎】(2026-09-24)
|
||||
########################################
|
||||
|
||||
+9
-3
@@ -59,9 +59,15 @@
|
||||
【空】 【空】 【空】
|
||||
【空】 【空】 【空】
|
||||
|
||||
● 挂肉钩(meathook)【有序】todo 修改 这里的支杆是没有禁用的支杆!后面所有的支杆都是没禁用的支杆!
|
||||
支杆支杆支杆
|
||||
铁锭[空]铁锭
|
||||
● 挂肉钩(meathook)【有序】这里的支杆是没有禁用的支杆!后面所有的支杆都是没禁用的支杆!
|
||||
支杆 挂钩
|
||||
支杆 挂钩
|
||||
(2×2: 左列2支杆 + 右列2挂钩(hooking))
|
||||
|
||||
● 挂钩(hooking)【有序】用于合成挂肉钩的中间物品
|
||||
铁粒 铁粒
|
||||
铁粒 铁粒
|
||||
(2×2: 4个铁粒合成1个挂钩)
|
||||
|
||||
|
||||
########################################################################
|
||||
|
||||
Reference in new issue
Block a user