钓鱼获得龙虾/螃蟹 改小bug(可用版本)
This commit is contained in:
1 parent
23598ed3dd
commit
a647878ac1
12 files changed
+373
-36
No files matched your search
+17
-8
@@ -547,7 +547,8 @@ class ChujuService(BlueFoxServerSystem):
|
||||
if prog is None or prog < 0:
|
||||
return False
|
||||
mat = self._readMillMat((x, y, z), dim) or "soybean"
|
||||
ret = FLOUR_ITEM if mat == "wheat" else SOYBEAN_ITEM
|
||||
# 打碎返还【放入的原料】(不是成品): 小麦返小麦, 黄豆返黄豆
|
||||
ret = WHEAT_ITEM if mat == "wheat" else SOYBEAN_ITEM
|
||||
count = WHEAT_COUNT if mat == "wheat" else SOYBEAN_COUNT
|
||||
# 有材料:额外掉落对应原料(石磨本体由默认破坏掉落)
|
||||
try:
|
||||
@@ -559,11 +560,17 @@ class ChujuService(BlueFoxServerSystem):
|
||||
return False
|
||||
|
||||
def _handleStonemill(self, playerId, pos, dim, itemDict, itemName, key):
|
||||
prog = self._readMill(pos, dim) # None=空, 0~3=研磨中, 4=完成
|
||||
prog = self._readMill(pos, dim) # None/负=空(未放料, 或已取走成品), 0~3=研磨中, 4=完成
|
||||
mat = self._readMillMat(pos, dim) or "soybean" # 默认黄豆; 'wheat'=小麦
|
||||
# 空磨: prog 为 None(从未放料) 或 <0(_clearMill 取走成品后写成 -1)
|
||||
isEmpty = prog is None or prog < 0
|
||||
# 研磨已完成: prog 达到 STONEMILL_GRIND_COUNT(4)
|
||||
isComplete = prog is not None and prog >= STONEMILL_GRIND_COUNT
|
||||
|
||||
# ---- 空石磨 + 黄豆(16) 或 小麦(6) -> 加入 ----
|
||||
if prog is None:
|
||||
# ---- 加入研磨材料: 仅空磨(从未放料, 或已取走成品后)。 ----
|
||||
# 完成态(prog=4)必须先取走成品(空手取面粉/玻璃罐取油罐)变回空磨,
|
||||
# 然后才能手持 黄豆(16)/小麦(6) 重新放入开工。
|
||||
if isEmpty:
|
||||
if itemName == WHEAT_ITEM:
|
||||
if (itemDict.get("count") or 0) < WHEAT_COUNT:
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(
|
||||
@@ -590,10 +597,12 @@ class ChujuService(BlueFoxServerSystem):
|
||||
comp.CreateMsg(playerId).NotifyOneMessage(
|
||||
playerId, "§a加入黄豆,空手右键研磨")
|
||||
return True
|
||||
return False
|
||||
# 空磨 + 空手: 无操作(交还默认); 完成态 + 手持非材料(玻璃罐/空手取粉) 不在此拦住
|
||||
if isEmpty and (not itemName or itemName == "minecraft:air"):
|
||||
return False
|
||||
|
||||
# ---- 研磨中: 空手右键旋转一次 ----
|
||||
if 0 <= prog < STONEMILL_GRIND_COUNT:
|
||||
if prog is not None and 0 <= prog < STONEMILL_GRIND_COUNT:
|
||||
if itemName and itemName != "minecraft:air":
|
||||
return False
|
||||
if not self.checkCooldown(key, 0.5):
|
||||
@@ -610,8 +619,8 @@ class ChujuService(BlueFoxServerSystem):
|
||||
playerId, "§a研磨中,(%d/%d)" % (newProg, STONEMILL_GRIND_COUNT))
|
||||
return True
|
||||
|
||||
# ---- 完成 ----
|
||||
if prog >= STONEMILL_GRIND_COUNT:
|
||||
# ---- 完成: 取成品 ----
|
||||
if isComplete:
|
||||
if mat == "wheat":
|
||||
# 小麦已磨成面粉: 空手右键 -> 掉落 1 面粉 + 还原空
|
||||
if itemName and itemName != "minecraft:air":
|
||||
|
||||
Reference in new issue
Block a user