Search in sources :

Example 96 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project NoCheatPlus by NoCheatPlus.

the class MCAccessSpigotCB1_10_R1 method isIllegalBounds.

@Override
public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead) {
        return AlmostBoolean.NO;
    }
    // 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);
        if (dY > 1.8) {
            // dY > 1.65D ||
            return AlmostBoolean.YES;
        }
        if (dY < 0.1D && entityPlayer.length >= 0.1) {
            return AlmostBoolean.YES;
        }
    }
    return AlmostBoolean.MAYBE;
}
Also used : AxisAlignedBB(net.minecraft.server.v1_10_R1.AxisAlignedBB) EntityPlayer(net.minecraft.server.v1_10_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)

Example 97 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project NoCheatPlus by NoCheatPlus.

the class MCAccessSpigotCB1_9_R1 method isIllegalBounds.

@Override
public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead) {
        return AlmostBoolean.NO;
    }
    // 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);
        if (dY > 1.8) {
            // dY > 1.65D ||
            return AlmostBoolean.YES;
        }
        if (dY < 0.1D && entityPlayer.length >= 0.1) {
            return AlmostBoolean.YES;
        }
    }
    return AlmostBoolean.MAYBE;
}
Also used : AxisAlignedBB(net.minecraft.server.v1_9_R1.AxisAlignedBB) EntityPlayer(net.minecraft.server.v1_9_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer)

Example 98 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project NoCheatPlus by NoCheatPlus.

the class MCAccessSpigotCB1_11_R1 method isIllegalBounds.

@Override
public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead) {
        return AlmostBoolean.NO;
    }
    // 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);
        if (dY > 1.8) {
            // dY > 1.65D ||
            return AlmostBoolean.YES;
        }
        if (dY < 0.1D && entityPlayer.length >= 0.1) {
            return AlmostBoolean.YES;
        }
    }
    return AlmostBoolean.MAYBE;
}
Also used : AxisAlignedBB(net.minecraft.server.v1_11_R1.AxisAlignedBB) EntityPlayer(net.minecraft.server.v1_11_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)

Example 99 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project NoCheatPlus by NoCheatPlus.

the class MCAccessCB2922 method isIllegalBounds.

@Override
public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead)
        return AlmostBoolean.NO;
    // 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 (!entityPlayer.isSleeping()) {
        // This can not really test stance but height of bounding box.
        final double dY = Math.abs(box.e - box.b);
        // dY > 1.65D ||
        if (dY > 1.8)
            return AlmostBoolean.YES;
        if (dY < 0.1D && entityPlayer.length >= 0.1)
            return AlmostBoolean.YES;
    }
    return AlmostBoolean.MAYBE;
}
Also used : AxisAlignedBB(net.minecraft.server.v1_7_R1.AxisAlignedBB) EntityPlayer(net.minecraft.server.v1_7_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer)

Example 100 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project NoCheatPlus by NoCheatPlus.

the class MCAccessSpigotCB1_8_R1 method isIllegalBounds.

@Override
public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead) {
        return AlmostBoolean.NO;
    }
    // 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);
        if (dY > 1.8) {
            // dY > 1.65D ||
            return AlmostBoolean.YES;
        }
        if (dY < 0.1D && entityPlayer.length >= 0.1) {
            return AlmostBoolean.YES;
        }
    }
    return AlmostBoolean.MAYBE;
}
Also used : AxisAlignedBB(net.minecraft.server.v1_8_R1.AxisAlignedBB) EntityPlayer(net.minecraft.server.v1_8_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)65 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)26 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)24 EntityPlayer (net.minecraft.server.v1_16_R3.EntityPlayer)23 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)20 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)20 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)19 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)19 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)19 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)18 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)17 GameProfile (com.mojang.authlib.GameProfile)16 MyPet (de.Keyle.MyPet.api.entity.MyPet)16 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)16 OfflinePlayer (org.bukkit.OfflinePlayer)15 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)15 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)15 EntityPlayer (net.minecraft.server.v1_9_R2.EntityPlayer)13 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)13 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)13