KillAura check works now, currently uses 1 bot

This commit is contained in:
Rammelkast committed 2016-05-30 19:29:30 +02:00
1 parent 4cc8ec9380
commit fed95f8b70
8 files changed
+71 -8

No files matched your search

@@ -20,12 +20,22 @@ public class CheckerNPCS {
public void doMove(PlayerMoveEvent e) {
NPC one = NPCS.get(0);
Location eyeLocation = e.getPlayer().getEyeLocation();
Vector vec = e.getPlayer().getLocation().getDirection();
Vector vec = e.getFrom().getDirection();
Vector newVec = new Vector(vec.getX() * -2, vec.getY() * -2, vec.getZ() * -2);
Location backLocation = eyeLocation.add(newVec);
if (e.getPlayer().getLocation().getPitch() <= -45) // TODO better fix for this
backLocation.add(0, -2.5, 0);
if (e.getPlayer().getLocation().getPitch() <= -45) {// TODO better fix for this
Vector direction = e.getFrom().getDirection();
Vector addVector = direction.setX(direction.getX() * -2).setY(direction.getY() * -2).setZ(direction.getZ() * -2);
backLocation.add(addVector);
}
one.move(backLocation, e.getPlayer());
}
public boolean onHit(int entityId) {
for (NPC npc : NPCS)
if (npc.getEntityId() == entityId)
return true;
return false;
}
}
@@ -40,6 +40,10 @@ public class NPC {
((CraftPlayer)owner).getHandle().playerConnection.sendPacket(new PacketPlayOutNamedEntitySpawn(this.npc));
}
public int getEntityId() {
return npc.getId();
}
public void move(Location loc, Player owner) {
this.npc.setLocation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
((CraftPlayer)owner).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityTeleport(this.npc));
@@ -61,7 +61,7 @@ public enum Permission {
SYSTEM_CALIBRATE,
SYSTEM_CHECK,
SYSTEM_DEBUG,
SYSTEM_RELOAD;
SYSTEM_RELOAD, CHECK_KILLAURA;
private static final String PERMISSION_ALL = "anticheat.*";
private static final String PERMISSION_SPAM = "anticheat.check.spam";