菜谱全部导入 水稻tick 2
This commit is contained in:
1 parent
c41a6d3665
commit
199821911b
4 files changed
+39
-47
No files matched your search
@@ -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种下水稻",
|
||||
}
|
||||
+3
-14
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user