菜谱全部导入 水稻tick 2

This commit is contained in:
wenhe committed 2026-09-28 14:12:09 +08:00
1 parent c41a6d3665
commit 199821911b
4 files changed
+39 -47

No files matched your search

@@ -7,7 +7,7 @@ from ...Function import GetBaseBlock
class MainServer(BlueFoxServerSystem):
systemTools = SystemTools.GetTools('MainServer')
mcListener = systemTools.ListenForEvent()
blockUse = systemTools.FilterListener('ServerBlockUseEvent')
blockUse = systemTools.FilterListener(eventName='ServerBlockUseEvent')
def __init__(self, *args):
super(MainServer, self).__init__(*args)
@@ -208,9 +208,9 @@ allCookRecipe = [
{
'publicResult': 'rtdd:stewedsoupwater', # 锅底 = 汤锅(加水)
'publicStep': [
{'itemName': 'rtdd:stewedsoup', 'count': 1}, # 汤锅(空)
{'itemName': 'minecraft:water_bucket', 'count': 1}, # 水桶
{},
{},
], # 锅底步骤: 汤锅(空) + 水桶 -> 汤锅(加水)
'splitStep': [
{'result': 'rtdd:carrotsoup', 'items': [{'itemName': 'rtdd:crushed_carrots', 'count': 4}, {}, {}]}, # 胡萝卜汤: 胡萝卜碎
@@ -228,9 +228,9 @@ allCookRecipe = [
{
'publicResult': 'rtdd:carrotsoup', # 锅底 = 胡萝卜汤
'publicStep': [
{'itemName': 'rtdd:stewedsoupwater', 'count': 1}, # 汤锅(加水)
{'itemName': 'rtdd:crushed_carrots', 'count': 4}, # 胡萝卜碎
{},
{},
], # 锅底步骤: 汤锅(加水)+胡萝卜碎x4 -> 胡萝卜汤
'splitStep': [
{'result': 'rtdd:bowlacarrotbeefsoup', 'items': [{'itemName': 'minecraft:beef', 'count': 2}, {}, {}]}, # 胡萝卜牛肉汤
@@ -246,9 +246,9 @@ allCookRecipe = [
{
'publicResult': 'rtdd:vegetablesoup', # 锅底 = 蔬菜汤
'publicStep': [
{'itemName': 'rtdd:stewedsoupwater', 'count': 1}, # 汤锅(加水)
{'itemName': 'rtdd:vegetable', 'count': 4}, # 青菜碎
{},
{},
], # 锅底步骤: 汤锅(加水)+青菜碎x4 -> 蔬菜汤
'splitStep': [
{'result': 'rtdd:bowlavegetablebeefsoup', 'items': [{'itemName': 'minecraft:mutton', 'count': 2}, {}, {}]}, # 清汤羊肉
@@ -264,10 +264,10 @@ allCookRecipe = [
{
'publicResult': 'rtdd:carrotandpotatosoup', # 锅底 = 胡萝卜土豆汤
'publicStep': [
{'itemName': 'rtdd:stewedsoupwater', 'count': 1}, # 汤锅(加水)
{'itemName': 'rtdd:potato_wedges', 'count': 4}, # 土豆块
{'itemName': 'rtdd:crushed_carrots', 'count': 4}, # 胡萝卜碎
{},
], # 锅底步骤: 土豆汤+胡萝卜碎 或 胡萝卜汤+土豆块 -> 胡萝卜土豆汤
], # 锅底步骤: 汤锅(加水)+土豆/胡萝卜 -> 胡萝卜土豆汤
'splitStep': [
{'result': 'rtdd:bowlabeefbonebroth', 'items': [{'itemName': 'rtdd:costillavacaes', 'count': 2}, {}, {}]}, # 胡萝卜土豆牛骨汤(牛肋)
{'result': 'rtdd:bowlalambstew', 'items': [{'itemName': 'minecraft:mutton', 'count': 2}, {}, {}]}, # 土豆胡萝卜炖羊肉
@@ -280,10 +280,10 @@ allCookRecipe = [
{
'publicResult': 'rtdd:mushroomsoup', # 锅底 = 蘑菇汤
'publicStep': [
{'itemName': 'rtdd:stewedsoupwater', 'count': 1}, # 汤锅(加水)
{'itemName': 'minecraft:brown_mushroom', 'count': 5}, # 棕蘑菇
{'itemName': 'minecraft:red_mushroom', 'count': 5}, # 红蘑菇
{},
], # 锅底步骤: 红蘑菇汤+棕蘑菇 或 棕蘑菇汤+红蘑菇 -> 蘑菇汤
], # 锅底步骤: 汤锅(加水)+红/棕蘑菇x5 -> 蘑菇汤
'splitStep': [
{'result': 'rtdd:bowlofmushroomsoup', 'items': [{'itemName': 'minecraft:chicken', 'count': 1}, {}, {}]}, # 蘑菇炖鸡
],
@@ -294,8 +294,8 @@ allCookRecipe = [
{
'publicResult': 'rtdd:eggsoup', # 锅底 = 蛋花汤
'publicStep': [
{'itemName': 'minecraft:egg', 'count': 3}, # 鸡蛋
{},
{'itemName': 'rtdd:stewedsoupwater', 'count': 1}, # 汤锅(加水)
{'itemName': 'minecraft:egg', 'count': 3}, # 鸡蛋
{},
], # 锅底步骤: 汤锅(加水)+鸡蛋x3 -> 蛋花汤
'splitStep': [
@@ -309,9 +309,9 @@ allCookRecipe = [
{
'publicResult': 'rtdd:potatosoup', # 锅底 = 土豆汤
'publicStep': [
{'itemName': 'rtdd:stewedsoupwater', 'count': 1}, # 汤锅(加水)
{'itemName': 'rtdd:potato_wedges', 'count': 4}, # 土豆块
{},
{},
], # 锅底步骤: 汤锅(加水)+土豆块x4 -> 土豆汤
'splitStep': [
{'result': 'rtdd:carrotandpotatosoup', 'items': [{'itemName': 'rtdd:crushed_carrots', 'count': 4}, {}, {}]}, # 胡萝卜土豆汤
@@ -323,10 +323,10 @@ allCookRecipe = [
{
'publicResult': 'rtdd:rawricepot', # 锅底(首产物) = 生米锅
'publicStep': [
{'itemName': 'rtdd:brownrice', 'count': 64}, # 大米
{},
{},
], # 锅底步骤: 汤锅(加水) + 大米x64 -> 生米锅 -> 计时 -> 熟米饭
{'itemName': 'rtdd:stewedsoup', 'count': 1}, # 汤锅(空)
{'itemName': 'minecraft:water_bucket', 'count': 1}, # 水桶
{'itemName': 'rtdd:brownrice', 'count': 64}, # 大米
], # 锅底步骤: 汤锅(空)+水桶+大米x64 -> 生米锅 -> 计时 -> 熟米饭
'splitStep': [
{'result': 'rtdd:ricepot_1', 'items': [{'itemName': 'rtdd:brownrice', 'count': 64}, {}, {}]}, # 生米锅→熟米饭(形态随机1/2/3)
{'result': 'rtdd:rice_balls', 'items': [{'itemName': 'rtdd:ricepot_1', 'count': 1}, {}, {}]}, # 饭团: 熟米饭空手捏
@@ -339,9 +339,9 @@ allCookRecipe = [
{
'publicResult': 'rtdd:stewedsoupwater', # 锅底 = 汤锅(加水)
'publicStep': [
{'itemName': 'rtdd:stewedsoup', 'count': 1}, # 汤锅(空)
{'itemName': 'minecraft:water_bucket', 'count': 1}, # 水桶
{},
{},
], # 锅底步骤: 汤锅(空) + 水桶 -> 汤锅(加水)
'splitStep': [
{'result': 'rtdd:bowla_roujiamo', 'items': [{'itemName': 'rtdd:roujiamo_0', 'count': 1}, {}, {}]}, # 羊肉泡馍汤: 馍
@@ -359,8 +359,8 @@ allCookRecipe = [
{
'publicResult': 'rtdd:oilpot_1', # 锅底 = 油锅(满油)
'publicStep': [
{'itemName': 'rtdd:oilcan', 'count': 1}, # 油罐(倒油)
{},
{'itemName': 'rtdd:oilpot_0', 'count': 1}, # 油锅(空)
{'itemName': 'rtdd:oilcan', 'count': 1}, # 油罐(倒油)
{},
], # 锅底步骤: 油锅(空) + 油罐 -> 油锅(满油)
'splitStep': [
@@ -379,7 +379,7 @@ allCookRecipe = [
'publicResult': 'rtdd:rawdough_0', # 锅底 = 生面团(起点)
'publicStep': [
{'itemName': 'rtdd:farineblcok', 'count': 1}, # 面粉
{},
{'itemName': 'minecraft:egg', 'count': 1}, # 鸡蛋(和面)
{},
], # 锅底步骤: 面粉+鸡蛋+水 揉面 -> 生面团
'splitStep': [
@@ -395,10 +395,10 @@ allCookRecipe = [
{
'publicResult': 'rtdd:cooked_dought', # 锅底 = 煎饼
'publicStep': [
{'itemName': 'rtdd:vegetable', 'count': 1}, # 青菜碎
{'itemName': 'rtdd:dought_7', 'count': 1}, # 生面饼
{'itemName': 'rtdd:vegetable', 'count': 1}, # 青菜碎
{},
{},
], # 锅底步骤: 煎饼+青菜碎 -> 煎饼(加蔬菜)
], # 锅底步骤: 生面饼烙成煎饼 + 青菜碎 -> 煎饼(加蔬菜)
'splitStep': [
{'result': 'rtdd:cookeddought_6', 'items': [{'itemName': 'minecraft:cooked_beef', 'count': 1}, {'itemName': 'minecraft:potato', 'count': 1}, {}]}, # 煎饼卷牛肉
{'result': 'rtdd:cookedcoddought_6', 'items': [{'itemName': 'minecraft:cooked_cod', 'count': 1}, {'itemName': 'minecraft:potato', 'count': 1}, {}]}, # 煎饼卷鳕鱼
@@ -480,7 +480,7 @@ allCookRecipe = [
'publicResult': 'rtdd:barbecuegrill_1', # 锅底 = 烧烤架(点燃)
'publicStep': [
{'itemName': 'rtdd:barbecuegrill_0', 'count': 1}, # 烧烤架(无火)
{},
{'itemName': 'minecraft:flint_and_steel', 'count': 1}, # 打火石(点火)
{},
], # 锅底步骤: 烧烤架(无火) + 打火石/烈焰弹 -> 点燃
'splitStep': [
@@ -496,9 +496,9 @@ allCookRecipe = [
{
'publicResult': 'rtdd:b_34', # 锅底 = 支杆
'publicStep': [
{'itemName': 'rtdd:b_34', 'count': 1}, # 支杆
{'itemName': 'minecraft:campfire', 'count': 1}, # 篝火(下方)
{},
{},
], # 锅底步骤: 支杆 + 下方篝火 -> 计时烤制
'splitStep': [
{'result': 'rtdd:roastchicken_1', 'items': [{'itemName': 'rtdd:roastchicken_0', 'count': 1}, {}, {}]}, # 烤鸡(上烤架_熟)
@@ -512,7 +512,11 @@ allCookRecipe = [
# =============================================================
{
'publicResult': 'rtdd:juicer_0', # 锅底 = 榨汁机(空)
'publicStep': [{}, {}, {}], # 锅底步骤: 榨汁机放水果 -> 逐级榨汁 -> 完成
'publicStep': [
{'itemName': 'rtdd:juicer_0', 'count': 1}, # 榨汁机(空)
{},
{},
], # 锅底步骤: 榨汁机(空) 放水果 -> 逐级榨汁 -> 完成
'splitStep': [
{'result': 'rtdd:fruitjuice_1', 'items': [{'itemName': 'minecraft:melon_slice', 'count': 1}, {}, {}]}, # 西瓜汁: 西瓜
{'result': 'rtdd:fruitjuice_3', 'items': [{'itemName': 'minecraft:apple', 'count': 1}, {}, {}]}, # 苹果汁: 苹果
@@ -528,10 +532,10 @@ allCookRecipe = [
{
'publicResult': 'rtdd:icelollybox_2', # 锅底 = 冰棍盒(定型)
'publicStep': [
{'itemName': 'minecraft:ice', 'count': 1}, # 冰块(定型)
{'itemName': 'rtdd:icelollybox_1', 'count': 1}, # 冰棍盒(未定型)
{'itemName': 'minecraft:ice', 'count': 1}, # 冰块(定型)
{},
{},
], # 锅底步骤: 冰棍盒 + 冰块 -> 定型
], # 锅底步骤: 冰棍盒(未定型) + 冰块(计时定型) -> 定型
'splitStep': [
{'result': 'rtdd:apple_popsicleplace', 'items': [{'itemName': 'minecraft:apple', 'count': 2}, {}, {}]}, # 苹果冰棍
{'result': 'rtdd:melon_popsicleplace', 'items': [{'itemName': 'minecraft:melon_slice', 'count': 2}, {}, {}]}, # 西瓜冰棍
@@ -546,10 +550,10 @@ allCookRecipe = [
{
'publicResult': 'rtdd:frytheicebox', # 锅底 = 炒冰盒(空)
'publicStep': [
{'itemName': 'minecraft:ice', 'count': 1}, # 冰块
{'itemName': 'rtdd:frytheicebox', 'count': 1}, # 炒冰盒(空)
{'itemName': 'minecraft:ice', 'count': 1}, # 冰块
{},
{},
], # 锅底步骤: 炒冰盒 + 冰块 -> 放冰
], # 锅底步骤: 炒冰盒(空) + 冰块 -> 放冰
'splitStep': [
{'result': 'rtdd:appleicecreamplace', 'items': [{'itemName': 'minecraft:apple', 'count': 1}, {}, {}]}, # 苹果冰沙
{'result': 'rtdd:grapeicecreamplace', 'items': [{'itemName': 'rtdd:grape', 'count': 1}, {}, {}]}, # 葡萄冰沙
@@ -65,7 +65,7 @@ RICE_CROP_ITEM = "rtdd:brownrice" # 成熟额外掉落大米
# 水稻生长: 改用"原版 tick 概率生长"(每 block tick 一定概率长大一级) + 骨粉右键
# RICE_BLOCKS 顺序即生长阶段: [0]刚种 -> [1]生长中 -> [2]成熟
RICE_GROW_PROB = 0.05 # 每 block tick 生长一级的概率(原版随机式, 可按需调)
RICE_GROW_PROB = 0.001 # 每 block tick 生长一级的概率(原版随机式; 实测约20tick/秒, 每级≈50秒, 满熟≈1分40秒)
BONE_MEAL = "minecraft:bone_meal" # 骨粉(右键概率增加生长)
# 汇总: 乡野自然右键切换规则
@@ -107,5 +107,4 @@ RICE_PLANT = {
"surface": "minecraft:farmland", # 必须右键原版耕地
"target": "rtdd:riceseedlingsb", # 放置水稻刚种下
"consume": 1,
"tip": "§a种下水稻",
}
@@ -184,8 +184,6 @@ class NaturalService(BlueFoxServerSystem):
# 放置水稻刚种下
self.replaceBlock(targetPos, dim, RICE_PLANT["target"], playerId)
if RICE_PLANT.get("tip"):
comp.CreateMsg(playerId).NotifyOneMessage(playerId, RICE_PLANT["tip"])
return True
# ============================================================================
@@ -223,22 +221,13 @@ class NaturalService(BlueFoxServerSystem):
comp.CreateMsg(playerId).NotifyOneMessage(playerId, recipe["tip"])
def _applyBoneMeal(self, playerId, pos, dim, blockName, itemDict):
"""骨粉催熟水稻: 消耗1个骨粉, 按原版概率一次长多级(无失败时2~3级), 封顶成熟"""
"""骨粉催熟水稻: 消耗1个骨粉, 让水稻长大一级(不越级, 到成熟为止), 无提示"""
try:
if blockName == RICE_BLOCKS[-1]:
comp.CreateMsg(playerId).NotifyOneMessage(playerId, "§c水稻已成熟, 无需施肥")
return
return # 已成熟, 不再消耗
index = RICE_BLOCKS.index(blockName)
# 原版骨粉给作物有失败几率: 20% 无效消耗
if random.random() < 0.2:
self.consumeItem(playerId, itemDict, 1)
comp.CreateMsg(playerId).NotifyOneMessage(playerId, "§7施肥没有起效…")
return
add = random.choice([2, 3]) # 生长2级或3级(封顶到成熟)
end = min(index + add, len(RICE_BLOCKS) - 1)
self.consumeItem(playerId, itemDict, 1)
self.replaceBlock(pos, dim, RICE_BLOCKS[end], playerId)
comp.CreateMsg(playerId).NotifyOneMessage(playerId, "§a水稻长大了!")
self.replaceBlock(pos, dim, RICE_BLOCKS[index + 1], playerId)
except Exception:
pass