fix(ignis): allow safe Dagger blinks in midair
Retain swept collision, hazards, loaded chunks and protection checks without requiring a supported exit. Add native paid crafting, item-use packet, target movement and safeguard regression coverage; 201 tests pass.
This commit is contained in:
1 parent
3f721e928a
commit
7e60224096
6 files changed
+674
-10
No files matched your search
@@ -38,21 +38,22 @@ public final class DaggerSafety {
|
||||
if (!world.isChunkLoaded(x, z)) return false;
|
||||
}
|
||||
}
|
||||
var supportedBody = end.clone().shift(0, -.05, 0);
|
||||
// Keep rejecting hazardous surfaces just beneath the exit, but do not require ground.
|
||||
var nearFeetBody = end.clone().shift(0, -.05, 0);
|
||||
for (int x = minX; x <= maxX; x++) {
|
||||
for (int y = minY; y <= maxY; y++) {
|
||||
for (int z = minZ; z <= maxZ; z++) {
|
||||
var block = world.getBlockAt(x, y, z);
|
||||
var cell = new BoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||
if ((block.isLiquid() || dangerous(block.getType()))
|
||||
&& (DaggerSweep.hits(body, motion, cell) || supportedBody.overlaps(cell))) return false;
|
||||
&& (DaggerSweep.hits(body, motion, cell) || nearFeetBody.overlaps(cell))) return false;
|
||||
for (var local : block.getCollisionShape().getBoundingBoxes()) {
|
||||
if (DaggerSweep.hits(body, motion, local.clone().shift(x, y, z))) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return player.wouldCollideUsing(supportedBody);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean dangerous(Material material) {
|
||||
|
||||
Reference in new issue
Block a user