diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleChecks.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleChecks.java index 2a010720..c380edc3 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleChecks.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleChecks.java @@ -876,6 +876,7 @@ public class VehicleChecks extends CheckListener { builder.append(LocUtil.simpleFormat(thisMove.from)); builder.append("\nTo: "); builder.append(LocUtil.simpleFormat(thisMove.to)); + builder.append("\n" + (thisMove.from.resetCond ? "resetcond" : (thisMove.from.onGround ? "ground" : "---")) + " -> " + (thisMove.to.resetCond ? "resetcond" : (thisMove.to.onGround ? "ground" : "---"))); builder.append("\n Vehicle: "); builder.append(LocUtil.simpleFormat(vLoc)); builder.append("\n Player: "); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleEnvelope.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleEnvelope.java index b2f2de30..37d7fc81 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleEnvelope.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/vehicle/VehicleEnvelope.java @@ -36,6 +36,7 @@ import fr.neatmonster.nocheatplus.checks.moving.magic.MagicVehicle; import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveData; import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveInfo; import fr.neatmonster.nocheatplus.checks.workaround.WRPT; +import fr.neatmonster.nocheatplus.utilities.ReflectionUtil; import fr.neatmonster.nocheatplus.utilities.StringUtil; /** @@ -94,8 +95,12 @@ public class VehicleEnvelope extends Check { /** Details for re-use. */ private final CheckDetails checkDetails = new CheckDetails(); + private final Class bestHorse; + public VehicleEnvelope() { super(CheckType.MOVING_VEHICLE_ENVELOPE); + Class clazz = ReflectionUtil.getClass("org.bukkit.entity.AbstractHorse"); + bestHorse = clazz == null ? Horse.class : clazz; } public SetBackEntry check(final Player player, final Entity vehicle, final VehicleMoveData thisMove, final boolean isFake, final MovingData data, final MovingConfig cc) { @@ -326,9 +331,9 @@ public class VehicleEnvelope extends Check { } checkDetails.gravityTargetSpeed = 0.79; } - else if (vehicle instanceof Horse) { + else if (bestHorse.isAssignableFrom(vehicle.getClass())) { // TODO: Climbable? -> seems not. - checkDetails.simplifiedType = EntityType.HORSE; + checkDetails.simplifiedType = EntityType.HORSE; // TODO: 1.11 - Use AbstractHorse? checkDetails.canJump = checkDetails.canStepUpBlock = true; } else if (vehicle instanceof Pig) {