isIllegalBounds: Check for bad coordinates as well. Down to 1.7.10.

This commit is contained in:
asofold 2016-12-27 16:36:25 +01:00
parent 95b2984ca9
commit db68a710d9
7 changed files with 28 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_7_R4.AxisAlignedBB;
import net.minecraft.server.v1_7_R4.Block;
@ -120,6 +121,9 @@ public class MCAccessCB3100 implements MCAccess{
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.boundingBox;
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Block;
@ -177,6 +178,9 @@ public class MCAccessCBDev implements MCAccess {
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.getBoundingBox();
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_8_R1.AxisAlignedBB;
import net.minecraft.server.v1_8_R1.Block;
@ -121,6 +122,9 @@ public class MCAccessSpigotCB1_8_R1 implements MCAccess{
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.getBoundingBox();
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_8_R2.AxisAlignedBB;
import net.minecraft.server.v1_8_R2.Block;
@ -121,6 +122,9 @@ public class MCAccessSpigotCB1_8_R2 implements MCAccess{
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.getBoundingBox();
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_8_R3.AxisAlignedBB;
import net.minecraft.server.v1_8_R3.Block;
@ -141,6 +142,9 @@ public class MCAccessSpigotCB1_8_R3 implements MCAccess{
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.getBoundingBox();
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_9_R1.AxisAlignedBB;
import net.minecraft.server.v1_9_R1.Block;
@ -175,6 +176,9 @@ public class MCAccessSpigotCB1_9_R1 implements MCAccess {
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.getBoundingBox();
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.utilities.ReflectionUtil;
import fr.neatmonster.nocheatplus.utilities.location.LocUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockCache;
import net.minecraft.server.v1_9_R2.AxisAlignedBB;
import net.minecraft.server.v1_9_R2.Block;
@ -177,6 +178,9 @@ public class MCAccessSpigotCB1_9_R2 implements MCAccess {
}
// TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
final AxisAlignedBB box = entityPlayer.getBoundingBox();
if (LocUtil.isBadCoordinate(box.a, box.b, box.c, box.d, box.e, box.f)) {
return AlmostBoolean.YES;
}
if (!entityPlayer.isSleeping()) {
// This can not really test stance but height of bounding box.
final double dY = Math.abs(box.e - box.b);