Class AbstractMinecart

All Implemented Interfaces:
SyncedDataHolder, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, INBTSerializable<CompoundTag>
Direct Known Subclasses:
AbstractMinecartContainer, Minecart, MinecartCommandBlock, MinecartFurnace, MinecartSpawner, MinecartTNT

public abstract class AbstractMinecart extends VehicleEntity
  • Field Details

    • LOWERED_PASSENGER_ATTACHMENT

      private static final Vec3 LOWERED_PASSENGER_ATTACHMENT
    • DATA_ID_DISPLAY_BLOCK

      private static final EntityDataAccessor<Integer> DATA_ID_DISPLAY_BLOCK
    • DATA_ID_DISPLAY_OFFSET

      private static final EntityDataAccessor<Integer> DATA_ID_DISPLAY_OFFSET
    • DATA_ID_CUSTOM_DISPLAY

      private static final EntityDataAccessor<Boolean> DATA_ID_CUSTOM_DISPLAY
    • POSE_DISMOUNT_HEIGHTS

      private static final com.google.common.collect.ImmutableMap<Pose,com.google.common.collect.ImmutableList<Integer>> POSE_DISMOUNT_HEIGHTS
    • WATER_SLOWDOWN_FACTOR

      protected static final float WATER_SLOWDOWN_FACTOR
      See Also:
    • onRails

      private boolean onRails
    • flipped

      private boolean flipped
    • behavior

      private final MinecartBehavior behavior
    • EXITS

      private static final Map<RailShape,com.mojang.datafixers.util.Pair<Vec3i,Vec3i>> EXITS
  • Constructor Details

    • AbstractMinecart

      protected AbstractMinecart(EntityType<?> p_38087_, Level p_38088_)
    • AbstractMinecart

      protected AbstractMinecart(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_)
  • Method Details

    • setInitialPos

      public void setInitialPos(double p_374451_, double p_374374_, double p_374085_)
    • createMinecart

      @Nullable public static <T extends AbstractMinecart> T createMinecart(Level p_366408_, double p_38121_, double p_38122_, double p_38123_, EntityType<T> p_374583_, EntitySpawnReason p_374412_, ItemStack p_305892_, @Nullable Player p_306203_)
    • getBehavior

      public MinecartBehavior getBehavior()
    • getMovementEmission

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

      protected void defineSynchedData(SynchedEntityData.Builder p_326247_)
      Overrides:
      defineSynchedData in class VehicleEntity
    • canCollideWith

      public boolean canCollideWith(Entity p_38168_)
      Overrides:
      canCollideWith in class Entity
    • isPushable

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

      public Vec3 getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_)
      Overrides:
      getRelativePortalPosition in class Entity
    • getPassengerAttachmentPoint

      protected Vec3 getPassengerAttachmentPoint(Entity p_294753_, EntityDimensions p_295251_, float p_296054_)
      Overrides:
      getPassengerAttachmentPoint in class Entity
    • getDismountLocationForPassenger

      public Vec3 getDismountLocationForPassenger(LivingEntity p_38145_)
      Overrides:
      getDismountLocationForPassenger in class Entity
    • getBlockSpeedFactor

      protected float getBlockSpeedFactor()
      Overrides:
      getBlockSpeedFactor in class Entity
    • animateHurt

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

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

      public static com.mojang.datafixers.util.Pair<Vec3i,Vec3i> exits(RailShape p_38126_)
    • getMotionDirection

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

      protected double getDefaultGravity()
      Overrides:
      getDefaultGravity in class Entity
    • tick

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

      public boolean isFirstTick()
    • getCurrentBlockPosOrRailBelow

      public BlockPos getCurrentBlockPosOrRailBelow()
    • getMaxSpeed

      protected double getMaxSpeed(ServerLevel p_376848_)
    • activateMinecart

      public void activateMinecart(int p_38111_, int p_38112_, int p_38113_, boolean p_38114_)
    • lerpPositionAndRotationStep

      public void lerpPositionAndRotationStep(int p_364572_, double p_364337_, double p_362183_, double p_362957_, double p_363121_, double p_365178_)
      Overrides:
      lerpPositionAndRotationStep in class Entity
    • applyGravity

      public void applyGravity()
      Overrides:
      applyGravity in class Entity
    • reapplyPosition

      public void reapplyPosition()
      Overrides:
      reapplyPosition in class Entity
    • updateInWaterStateAndDoFluidPushing

      public boolean updateInWaterStateAndDoFluidPushing()
      Overrides:
      updateInWaterStateAndDoFluidPushing in class Entity
    • getKnownMovement

      public Vec3 getKnownMovement()
      Overrides:
      getKnownMovement in class Entity
    • cancelLerp

      public void cancelLerp()
      Overrides:
      cancelLerp in class Entity
    • lerpTo

      public void lerpTo(double p_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_)
      Overrides:
      lerpTo in class Entity
    • lerpTargetX

      public double lerpTargetX()
      Overrides:
      lerpTargetX in class Entity
    • lerpTargetY

      public double lerpTargetY()
      Overrides:
      lerpTargetY in class Entity
    • lerpTargetZ

      public double lerpTargetZ()
      Overrides:
      lerpTargetZ in class Entity
    • lerpTargetXRot

      public float lerpTargetXRot()
      Overrides:
      lerpTargetXRot in class Entity
    • lerpTargetYRot

      public float lerpTargetYRot()
      Overrides:
      lerpTargetYRot in class Entity
    • lerpMotion

      public void lerpMotion(double p_38171_, double p_38172_, double p_38173_)
      Overrides:
      lerpMotion in class Entity
    • moveAlongTrack

      protected void moveAlongTrack(ServerLevel p_376546_)
    • comeOffTrack

      protected void comeOffTrack(ServerLevel p_376696_)
    • makeStepAlongTrack

      protected double makeStepAlongTrack(BlockPos p_365229_, RailShape p_363321_, double p_364439_)
    • move

      public void move(MoverType p_362087_, Vec3 p_363190_)
      Overrides:
      move in class Entity
    • applyEffectsFromBlocks

      public void applyEffectsFromBlocks()
      Overrides:
      applyEffectsFromBlocks in class Entity
    • isOnRails

      public boolean isOnRails()
      Overrides:
      isOnRails in class Entity
    • setOnRails

      public void setOnRails(boolean p_365128_)
    • isFlipped

      public boolean isFlipped()
    • setFlipped

      public void setFlipped(boolean p_364443_)
    • getRedstoneDirection

      public Vec3 getRedstoneDirection(BlockPos p_361470_)
    • isRedstoneConductor

      public boolean isRedstoneConductor(BlockPos p_38130_)
    • applyNaturalSlowdown

      protected Vec3 applyNaturalSlowdown(Vec3 p_362705_)
    • readAdditionalSaveData

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

      protected void addAdditionalSaveData(CompoundTag p_38151_)
      Specified by:
      addAdditionalSaveData in class Entity
    • push

      public void push(Entity p_38165_)
      Overrides:
      push in class Entity
    • pushOtherMinecart

      private void pushOtherMinecart(AbstractMinecart p_374524_, double p_374304_, double p_374378_)
    • getDisplayBlockState

      public BlockState getDisplayBlockState()
    • getDefaultDisplayBlockState

      public BlockState getDefaultDisplayBlockState()
    • getDisplayOffset

      public int getDisplayOffset()
    • getDefaultDisplayOffset

      public int getDefaultDisplayOffset()
    • setDisplayBlockState

      public void setDisplayBlockState(BlockState p_38147_)
    • setDisplayOffset

      public void setDisplayOffset(int p_38175_)
    • hasCustomDisplay

      public boolean hasCustomDisplay()
    • setCustomDisplay

      public void setCustomDisplay(boolean p_38139_)
    • useExperimentalMovement

      public static boolean useExperimentalMovement(Level p_360970_)
    • getPickResult

      public abstract ItemStack getPickResult()
      Overrides:
      getPickResult in class Entity
    • isRideable

      public boolean isRideable()
    • isFurnace

      public boolean isFurnace()