mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-29 19:01:22 +01:00
Attempt to fix issues with falling through narrow spots.
The bounding box gets "corrected" by decreasing maxX and maxZ slightly. This is not a generic approach, might get replaced by something else later on.
This commit is contained in:
parent
434a83c398
commit
dfc8e7c5a7
@ -33,6 +33,13 @@ import fr.neatmonster.nocheatplus.compat.MCAccess;
|
||||
*/
|
||||
public class PlayerLocation {
|
||||
|
||||
/**
|
||||
* This is only for x+ and z+, since those provide trouble with falling through narrow places.
|
||||
* <br>
|
||||
* TODO: Check for closest value to 0.X (1 digit), dynamically ?
|
||||
*/
|
||||
private static final double xzInset = 0.0000001;
|
||||
|
||||
// Final members //
|
||||
private final MCAccess mcAccess;
|
||||
|
||||
@ -731,9 +738,9 @@ public class PlayerLocation {
|
||||
minX = x - dxz;
|
||||
minY = y;
|
||||
minZ = z - dxz;
|
||||
maxX = x + dxz;
|
||||
maxX = x + dxz - xzInset;
|
||||
maxY = y + player.getEyeHeight();
|
||||
maxZ = z + dxz;
|
||||
maxZ = z + dxz - xzInset;
|
||||
// TODO: With current bounding box the stance is never checked.
|
||||
|
||||
// Set world / block access.
|
||||
|
Loading…
Reference in New Issue
Block a user