Class TertiaryLookControl<T extends net.minecraft.world.entity.Mob & TwoHeadedEntity>

java.lang.Object
nokunami.floral_warfare.common.entity.ai.control.TertiaryLookControl<T>
All Implemented Interfaces:
net.minecraft.world.entity.ai.control.Control

public class TertiaryLookControl<T extends net.minecraft.world.entity.Mob & TwoHeadedEntity> extends Object implements net.minecraft.world.entity.ai.control.Control
  • Field Details

    • mob

      protected final T extends net.minecraft.world.entity.Mob & TwoHeadedEntity mob
    • yMaxRotSpeed

      protected float yMaxRotSpeed
    • xMaxRotAngle

      protected float xMaxRotAngle
    • lookAtCooldown

      protected int lookAtCooldown
    • wantedX

      protected double wantedX
    • wantedY

      protected double wantedY
    • wantedZ

      protected double wantedZ
  • Constructor Details

    • TertiaryLookControl

      public TertiaryLookControl(T mob)
  • Method Details

    • setThirdLookAt

      public void setThirdLookAt(net.minecraft.world.phys.Vec3 pLookVector)
      Sets the mob's look vector
    • setThirdLookAt

      public void setThirdLookAt(net.minecraft.world.entity.Entity pEntity)
      Sets the controlling mob's look vector to the provided entity's location
    • setThirdLookAt

      public void setThirdLookAt(net.minecraft.world.entity.Entity pEntity, float pDeltaYaw, float pDeltaPitch)
      Sets position to look at using entity
    • setThirdLookAt

      public void setThirdLookAt(double pX, double pY, double pZ)
    • setThirdLookAt

      public void setThirdLookAt(double pX, double pY, double pZ, float pDeltaYaw, float pDeltaPitch)
      Sets position to look at
    • tick

      public void tick()
      Updates look
    • clampHeadRotationToBody

      protected void clampHeadRotationToBody()
    • resetThirdXRotOnTick

      protected boolean resetThirdXRotOnTick()
    • isThirdLookingAtTarget

      public boolean isThirdLookingAtTarget()
    • getThirdWantedX

      public double getThirdWantedX()
    • getThirdWantedY

      public double getThirdWantedY()
    • getThirdWantedZ

      public double getThirdWantedZ()
    • getThirdXRotD

      protected Optional<Float> getThirdXRotD()
    • getThirdYRotD

      protected Optional<Float> getThirdYRotD()
    • rotateThirdTowards

      protected float rotateThirdTowards(float from, float to, float maxDelta)
      Rotate as much as possible from from to to within the bounds of maxDelta