Frage von MuBeDes, 15

Wie kann ich diesen Fehler lösen?

Der volle Code: import java.util.ArrayList; import java.util.List; import java.util.Random; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType;

public class AimAssist extends Module { private double range = 3.8D; private EntityPlayer curtarget; private List targetlist = new ArrayList();

public AimAssist() {
    super("AimAssist", 0xAC5866, Category.Combat);
}
public void onEnable()
  {
    this.curtarget = null;
  }

  public void onPostUpdate()
  {
    this.targetlist.clear();
    for (EntityPlayer e : mc.theWorld.playerEntities) {
      if (isAttackable(e)) {
        this.targetlist.add(e);
      }
    }
    if (this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
      Entity entity = this.mc.objectMouseOver.entityHit;
      if ((entity instanceof EntityPlayer)) {
        this.curtarget = ((EntityPlayer)entity);
        return;
      }
    }
    if ((!this.targetlist.contains(this.curtarget)) && (this.curtarget != null)) {
      this.curtarget = null;
      return;
    }
    Random r = new Random();
    if (this.curtarget == null) return;
    float diff = this.mc.thePlayer.rotationYaw - getAngles(this.curtarget)[0] % 180.0F;
    EntityPlayerSP tmp186_183 = this.mc.thePlayer; tmp186_183.rotationYaw = ((float)(tmp186_183.rotationYaw - (this.mc.thePlayer.rotationYaw - getAngles(this.curtarget)[0]) * 0.5D));
    EntityPlayerSP tmp229_226 = this.mc.thePlayer; tmp229_226.rotationPitch = ((float)(tmp229_226.rotationPitch - (this.mc.thePlayer.rotationPitch - getAngles(this.curtarget)[1]) * 0.5D));
  }

  public float[] getAngles(Entity entity)
  {
    float xDiff = (float)(entity.posX - this.mc.thePlayer.posX);
    float yDiff = (float)(entity.boundingBox.minY + entity.getEyeHeight() - this.mc.thePlayer.boundingBox.maxY);
    float zDiff = (float)(entity.posZ - this.mc.thePlayer.posZ);
    float yaw = (float)(Math.atan2(zDiff, xDiff) * 180.0D / 3.141592653589793D - 90.0D);
    float pitch = (float)-Math.toDegrees(Math.atan(yDiff / Math.sqrt(zDiff * zDiff + xDiff * xDiff)));
    return new float[] {
      yaw, pitch };
  }

  private float updateRotation(float par1, float par2, float par3)
  {
    float var4 = MathHelper.wrapAngleTo180_float(par2 - par1);
    if (var4 > par3) {
      var4 = par3;
    }
    if (var4 < -par3) {
      var4 = -par3;
    }
    return par1 + var4;
  }

  private boolean isAttackable(Entity e) {
    if (e == null)
      return false;
    if ((e instanceof EntityPlayer)) {
      EntityPlayer p = (EntityPlayer)e;
      if ((!p.isDead) && (!p.isInvisible()) && (this.mc.thePlayer.getDistanceToEntity(p) <= this.range) && (this.mc.thePlaye

Keine passende Antwort gefunden?

Fragen Sie die Community

Weitere Fragen mit Antworten