第33批十八次修正:双箱合并真根因——update applyPhysics 改 true 触发引擎双箱检测
生产服 latest.log 实锤:接双箱 connected=是 但主箱实测 placed=27格(需29)→ 双箱未连回退寄玩家,连续 8 次全失败。 根因(已核实 MC 原版双箱合并机制): - 两箱 XZ 紧邻、Y 相同、facing 一致 → 才构成双箱(代码 L493/L519 的 facing 对齐正确,勿改) - 合并检测由引擎在方块物理更新时触发。代码全程 update(true,false) (applyPhysics=false) 跳过检测 → 主箱永远 27 格、永不 54 格 - 这是十三/十四/十五/十六次全失败的真正根因 修复(最小改动,仅 4 处 update true,false → true,true): ① 接已有箱分支 placed/c 两处 ② 接空气位分支 placed/air 两处 facing 对齐逻辑保持不变;实测 <54 回退兜底保留(环境不安全仍清双箱+重打包) 配平 0(149/149),编译 EXIT=0
This commit is contained in:
@@ -483,8 +483,9 @@ public class ChestCarryManager implements Listener {
|
|||||||
for (Location dl : dirs) {
|
for (Location dl : dirs) {
|
||||||
Block c = w.getBlockAt(dl);
|
Block c = w.getBlockAt(dl);
|
||||||
if (c != null && c.getType() == org.bukkit.Material.CHEST) {
|
if (c != null && c.getType() == org.bukkit.Material.CHEST) {
|
||||||
// ★ 33批十四次修正:引擎原生——placed 已是 CHEST,只需把 facing 对齐邻箱,
|
// ★ 33批十八次修正:双箱合并真根因——facing 对齐邻箱(原版双箱要求同朝向)
|
||||||
// 引擎据相邻关系自动连 54 格双箱;彻底移除手动 setBlockData(LEFT)。
|
// 必须 applyPhysics=true 让引擎做双箱检测;之前 false 跳过检测,
|
||||||
|
// 主箱永远 27 格(生产服日志实锤:connected=是 但实测 placed=27格)。
|
||||||
try {
|
try {
|
||||||
org.bukkit.block.data.type.Chest bdP =
|
org.bukkit.block.data.type.Chest bdP =
|
||||||
(org.bukkit.block.data.type.Chest) placed.getBlockData();
|
(org.bukkit.block.data.type.Chest) placed.getBlockData();
|
||||||
@@ -492,8 +493,9 @@ public class ChestCarryManager implements Listener {
|
|||||||
(org.bukkit.block.data.type.Chest) c.getBlockData();
|
(org.bukkit.block.data.type.Chest) c.getBlockData();
|
||||||
bdP.setFacing(bdC.getFacing());
|
bdP.setFacing(bdC.getFacing());
|
||||||
placed.setBlockData(bdP);
|
placed.setBlockData(bdP);
|
||||||
placed.getState().update(true, false);
|
// ★ 关键:applyPhysics=true 触发引擎双箱合并检测
|
||||||
c.getState().update(true, false);
|
placed.getState().update(true, true);
|
||||||
|
c.getState().update(true, true);
|
||||||
} catch (Exception ign) {
|
} catch (Exception ign) {
|
||||||
}
|
}
|
||||||
connected = true;
|
connected = true;
|
||||||
@@ -506,11 +508,11 @@ public class ChestCarryManager implements Listener {
|
|||||||
for (Location dl : dirs) {
|
for (Location dl : dirs) {
|
||||||
Block air = w.getBlockAt(dl);
|
Block air = w.getBlockAt(dl);
|
||||||
if (air.getType() == org.bukkit.Material.AIR) {
|
if (air.getType() == org.bukkit.Material.AIR) {
|
||||||
// ★ 33批十四次修正:引擎原生——air.setType(CHEST,false) 摆第二只箱子,
|
// ★ 33批十八次修正:摆第二只箱 + facing 对齐 placed(原版双箱同朝向)
|
||||||
// 引擎检测到与 placed 紧邻会自动连成 54 格双箱;
|
// + applyPhysics=true 触发引擎双箱检测。
|
||||||
// 彻底移除手动 setBlockData(LEFT)(Paper26 建不出 54 格连接,十三次实锤)。
|
// 之前 air.setType(CHEST,false)+update(true,false) 全程跳过物理,
|
||||||
|
// 引擎从不做合并检测 → 主箱永远 27 格(生产服日志实锤)。
|
||||||
air.setType(org.bukkit.Material.CHEST, false);
|
air.setType(org.bukkit.Material.CHEST, false);
|
||||||
// 仅对齐 facing(双箱朝向一致),不碰 Chest.Type(引擎自动判定 LEFT/RIGHT)
|
|
||||||
try {
|
try {
|
||||||
org.bukkit.block.data.type.Chest bdP =
|
org.bukkit.block.data.type.Chest bdP =
|
||||||
(org.bukkit.block.data.type.Chest) placed.getBlockData();
|
(org.bukkit.block.data.type.Chest) placed.getBlockData();
|
||||||
@@ -518,8 +520,9 @@ public class ChestCarryManager implements Listener {
|
|||||||
(org.bukkit.block.data.type.Chest) air.getBlockData();
|
(org.bukkit.block.data.type.Chest) air.getBlockData();
|
||||||
bdA.setFacing(bdP.getFacing());
|
bdA.setFacing(bdP.getFacing());
|
||||||
air.setBlockData(bdA);
|
air.setBlockData(bdA);
|
||||||
placed.getState().update(true, false);
|
// ★ 关键:applyPhysics=true 触发引擎双箱合并检测
|
||||||
air.getState().update(true, false);
|
placed.getState().update(true, true);
|
||||||
|
air.getState().update(true, true);
|
||||||
} catch (Exception ign) {
|
} catch (Exception ign) {
|
||||||
}
|
}
|
||||||
connected = true;
|
connected = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user