All Implemented Interfaces:
CommandSource, EntityAccess, Nameable, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeBoat, IForgeEntity, INBTSerializable<CompoundTag>
Direct Known Subclasses:
ChestBoat

public class Boat extends Entity implements IForgeBoat
  • Field Details

    • DATA_ID_HURT

      private static final EntityDataAccessor<Integer> DATA_ID_HURT
    • DATA_ID_HURTDIR

      private static final EntityDataAccessor<Integer> DATA_ID_HURTDIR
    • DATA_ID_DAMAGE

      private static final EntityDataAccessor<Float> DATA_ID_DAMAGE
    • DATA_ID_TYPE

      private static final EntityDataAccessor<Integer> DATA_ID_TYPE
    • DATA_ID_PADDLE_LEFT

      private static final EntityDataAccessor<Boolean> DATA_ID_PADDLE_LEFT
    • DATA_ID_PADDLE_RIGHT

      private static final EntityDataAccessor<Boolean> DATA_ID_PADDLE_RIGHT
    • DATA_ID_BUBBLE_TIME

      private static final EntityDataAccessor<Integer> DATA_ID_BUBBLE_TIME
    • PADDLE_LEFT

      public static final int PADDLE_LEFT
      See Also:
    • PADDLE_RIGHT

      public static final int PADDLE_RIGHT
      See Also:
    • TIME_TO_EJECT

      private static final int TIME_TO_EJECT
      See Also:
    • PADDLE_SPEED

      private static final float PADDLE_SPEED
      See Also:
    • PADDLE_SOUND_TIME

      public static final double PADDLE_SOUND_TIME
      See Also:
    • BUBBLE_TIME

      public static final int BUBBLE_TIME
      See Also:
    • paddlePositions

      private final float[] paddlePositions
    • invFriction

      private float invFriction
    • outOfControlTicks

      private float outOfControlTicks
    • deltaRotation

      private float deltaRotation
    • lerpSteps

      private int lerpSteps
    • lerpX

      private double lerpX
    • lerpY

      private double lerpY
    • lerpZ

      private double lerpZ
    • lerpYRot

      private double lerpYRot
    • lerpXRot

      private double lerpXRot
    • inputLeft

      private boolean inputLeft
    • inputRight

      private boolean inputRight
    • inputUp

      private boolean inputUp
    • inputDown

      private boolean inputDown
    • waterLevel

      private double waterLevel
    • landFriction

      private float landFriction
    • status

      private Boat.Status status
    • oldStatus

      private Boat.Status oldStatus
    • lastYd

      private double lastYd
    • isAboveBubbleColumn

      private boolean isAboveBubbleColumn
    • bubbleColumnDirectionIsDown

      private boolean bubbleColumnDirectionIsDown
    • bubbleMultiplier

      private float bubbleMultiplier
    • bubbleAngle

      private float bubbleAngle
    • bubbleAngleO

      private float bubbleAngleO
  • Constructor Details

    • Boat

      public Boat(EntityType<? extends Boat> p_38290_, Level p_38291_)
    • Boat

      public Boat(Level p_38293_, double p_38294_, double p_38295_, double p_38296_)
  • Method Details

    • getEyeHeight

      protected float getEyeHeight(Pose p_38327_, EntityDimensions p_38328_)
      Overrides:
      getEyeHeight in class Entity
    • getMovementEmission

      protected Entity.MovementEmission getMovementEmission()
      Overrides:
      getMovementEmission in class Entity
    • defineSynchedData

      protected void defineSynchedData()
      Specified by:
      defineSynchedData in class Entity
    • canCollideWith

      public boolean canCollideWith(Entity p_38376_)
      Overrides:
      canCollideWith in class Entity
    • canVehicleCollide

      public static boolean canVehicleCollide(Entity p_38324_, Entity p_38325_)
    • canBeCollidedWith

      public boolean canBeCollidedWith()
      Overrides:
      canBeCollidedWith in class Entity
    • isPushable

      public boolean isPushable()
      Overrides:
      isPushable in class Entity
    • getRelativePortalPosition

      protected Vec3 getRelativePortalPosition(Direction.Axis p_38335_, BlockUtil.FoundRectangle p_38336_)
      Overrides:
      getRelativePortalPosition in class Entity
    • getPassengersRidingOffset

      public double getPassengersRidingOffset()
      Overrides:
      getPassengersRidingOffset in class Entity
    • hurt

      public boolean hurt(DamageSource p_38319_, float p_38320_)
      Overrides:
      hurt in class Entity
    • destroy

      protected void destroy(DamageSource p_219862_)
    • onAboveBubbleCol

      public void onAboveBubbleCol(boolean p_38381_)
      Overrides:
      onAboveBubbleCol in class Entity
    • push

      public void push(Entity p_38373_)
      Overrides:
      push in class Entity
    • getDropItem

      public Item getDropItem()
    • animateHurt

      public void animateHurt(float p_265761_)
      Overrides:
      animateHurt in class Entity
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class Entity
    • lerpTo

      public void lerpTo(double p_38299_, double p_38300_, double p_38301_, float p_38302_, float p_38303_, int p_38304_, boolean p_38305_)
      Overrides:
      lerpTo in class Entity
    • getMotionDirection

      public Direction getMotionDirection()
      Overrides:
      getMotionDirection in class Entity
    • tick

      public void tick()
      Overrides:
      tick in class Entity
    • tickBubbleColumn

      private void tickBubbleColumn()
    • getPaddleSound

      @Nullable protected SoundEvent getPaddleSound()
    • tickLerp

      private void tickLerp()
    • setPaddleState

      public void setPaddleState(boolean p_38340_, boolean p_38341_)
    • getRowingTime

      public float getRowingTime(int p_38316_, float p_38317_)
    • getStatus

      private Boat.Status getStatus()
    • getWaterLevelAbove

      public float getWaterLevelAbove()
    • getGroundFriction

      public float getGroundFriction()
    • checkInWater

      private boolean checkInWater()
    • isUnderwater

      @Nullable private Boat.Status isUnderwater()
    • floatBoat

      private void floatBoat()
    • controlBoat

      private void controlBoat()
    • getSinglePassengerXOffset

      protected float getSinglePassengerXOffset()
    • hasEnoughSpaceFor

      public boolean hasEnoughSpaceFor(Entity p_273171_)
    • positionRider

      protected void positionRider(Entity p_289552_, Entity.MoveFunction p_289571_)
      Overrides:
      positionRider in class Entity
    • getDismountLocationForPassenger

      public Vec3 getDismountLocationForPassenger(LivingEntity p_38357_)
      Overrides:
      getDismountLocationForPassenger in class Entity
    • clampRotation

      protected void clampRotation(Entity p_38322_)
    • onPassengerTurned

      public void onPassengerTurned(Entity p_38383_)
      Overrides:
      onPassengerTurned in class Entity
    • addAdditionalSaveData

      protected void addAdditionalSaveData(CompoundTag p_38359_)
      Specified by:
      addAdditionalSaveData in class Entity
    • readAdditionalSaveData

      protected void readAdditionalSaveData(CompoundTag p_38338_)
      Specified by:
      readAdditionalSaveData in class Entity
    • interact

      public InteractionResult interact(Player p_38330_, InteractionHand p_38331_)
      Overrides:
      interact in class Entity
    • checkFallDamage

      protected void checkFallDamage(double p_38307_, boolean p_38308_, BlockState p_38309_, BlockPos p_38310_)
      Overrides:
      checkFallDamage in class Entity
    • getPaddleState

      public boolean getPaddleState(int p_38314_)
    • setDamage

      public void setDamage(float p_38312_)
    • getDamage

      public float getDamage()
    • setHurtTime

      public void setHurtTime(int p_38355_)
    • getHurtTime

      public int getHurtTime()
    • setBubbleTime

      private void setBubbleTime(int p_38367_)
    • getBubbleTime

      private int getBubbleTime()
    • getBubbleAngle

      public float getBubbleAngle(float p_38353_)
    • setHurtDir

      public void setHurtDir(int p_38363_)
    • getHurtDir

      public int getHurtDir()
    • setVariant

      public void setVariant(Boat.Type p_38333_)
    • getVariant

      public Boat.Type getVariant()
    • canAddPassenger

      protected boolean canAddPassenger(Entity p_38390_)
      Overrides:
      canAddPassenger in class Entity
    • getMaxPassengers

      protected int getMaxPassengers()
    • getControllingPassenger

      @Nullable public LivingEntity getControllingPassenger()
      Overrides:
      getControllingPassenger in class Entity
    • setInput

      public void setInput(boolean p_38343_, boolean p_38344_, boolean p_38345_, boolean p_38346_)
    • isUnderWater

      public boolean isUnderWater()
      Overrides:
      isUnderWater in class Entity
    • addPassenger

      protected void addPassenger(Entity passenger)
      Overrides:
      addPassenger in class Entity
    • getPickResult

      public ItemStack getPickResult()
      Overrides:
      getPickResult in class Entity