Skip to content

Commit eff2d83

Browse files
committed
Fix random liquid false positives
1 parent e5df35d commit eff2d83

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/BridgeMisc.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ public static boolean isSpaceBarImpulseKnown(final Player player) {
149149
if (DataManager.getPlayerData(player).getClientVersion().isAtLeast(ClientVersion.V_1_21_2)) {
150150
return true;
151151
}
152-
final IPlayerData pData = DataManager.getPlayerData(player);
153-
final MovingData data = pData.getGenericInstance(MovingData.class);
152+
//final IPlayerData pData = DataManager.getPlayerData(player);
153+
//final MovingData data = pData.getGenericInstance(MovingData.class);
154154
// TODO: getOrUseVerticalVelocity or peekVerticalVelocity?
155155
// TODO: How exactly does ViaVersion provide?
156-
return data.getOrUseVerticalVelocity(data.playerMoves.getCurrentMove().yDistance).isEmpty();
156+
return false;
157157
}
158158

159159
/**

NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/location/RichBoundsLocation.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -786,26 +786,7 @@ public boolean isInPowderSnow() {
786786
inPowderSnow = false;
787787
}
788788
else {
789-
inPowderSnow = false; // Must initialize with false.
790-
final int iMinX = Location.locToBlock(minX + 0.001);
791-
final int iMaxX = Location.locToBlock(maxX - 0.001);
792-
final int iMinY = Location.locToBlock(minY + 0.001);
793-
final int iMaxY = Math.min(Location.locToBlock(maxY - 0.001), blockCache.getMaxBlockY());
794-
final int iMinZ = Location.locToBlock(minZ + 0.001);
795-
final int iMaxZ = Location.locToBlock(maxZ - 0.001);
796-
for (int x = iMinX; x < iMaxX; x++) {
797-
for (int y = iMinY; y < iMaxY; y++) {
798-
for (int z = iMinZ; z < iMaxZ; z++) {
799-
if (x == Math.floor(getX()) && y == Math.floor(getY()) && z == Math.floor(getZ()) // Ensure that we only check the exact block the player is currently inside.
800-
// Use collidesBlock to avoid having to check for a second collision loop within collides()
801-
// Do not check for flags as they already have been checked within isInPowderSnow
802-
&& BlockProperties.collidesBlock(blockCache, minX, minY, minZ, maxX, maxY, maxZ, x, y, z, getOrCreateBlockCacheNode(), null, BlockFlags.F_POWDER_SNOW)) {
803-
inPowderSnow = true;
804-
return inPowderSnow;
805-
}
806-
}
807-
}
808-
}
789+
inPowderSnow = isInside(BlockFlags.F_POWDER_SNOW);
809790
}
810791
}
811792
return inPowderSnow;

0 commit comments

Comments
 (0)