Class NewMinecartBehavior
java.lang.Object
net.minecraft.world.entity.vehicle.MinecartBehavior
net.minecraft.world.entity.vehicle.NewMinecartBehavior
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record(package private) static final record(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate floatdoubleprivate intstatic final doublestatic final doublestatic final intFields inherited from class net.minecraft.world.entity.vehicle.MinecartBehavior
minecart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustToRails(BlockPos pPos, BlockState pState, boolean pSnapToStart) private Vec3calculateBoostTrackSpeed(Vec3 pSpeed, BlockPos pPos, BlockState pState) private Vec3calculateHaltTrackSpeed(Vec3 pSpeed, BlockState pState) private Vec3calculatePlayerInputSpeed(Vec3 pSpeed) private Vec3calculateSlopeSpeed(Vec3 pSpeed, RailShape pRailShape) private Vec3calculateTrackSpeed(ServerLevel pLevel, Vec3 pSpeed, NewMinecartBehavior.TrackIteration pTrackIteration, BlockPos pPos, BlockState pState, RailShape pRailShape) booleangetCartLerpMovements(float pPartialTick) getCartLerpPosition(float pPartialTick) floatgetCartLerpXRot(float pPartialTick) floatgetCartLerpYRot(float pPartialTick) getCurrentLerpStep(float pPartialTick) doublegetMaxSpeed(ServerLevel pLevel) doubleprivate booleanisDecending(Vec3 pSpeed, RailShape pRailShape) private voidvoidmoveAlongTrack(ServerLevel pLevel) booleanpickupEntities(AABB pBox) booleanbooleanpushEntities(AABB pBox) private booleanrestAtVShape(RailShape pShape1, RailShape pShape2) voidprivate voidsetRotation(float pYRot, float pXRot) doublestepAlongTrack(BlockPos pPos, RailShape pRailShape, double pSpeed) voidtick()Methods inherited from class net.minecraft.world.entity.vehicle.MinecartBehavior
getDeltaMovement, getInterpolation, getKnownMovement, getMotionDirection, getX, getXRot, getY, getYRot, getZ, lerpMotion, level, position, setDeltaMovement, setDeltaMovement, setPos, setPos, setXRot, setYRot
-
Field Details
-
POS_ROT_LERP_TICKS
public static final int POS_ROT_LERP_TICKS- See Also:
-
ON_RAIL_Y_OFFSET
public static final double ON_RAIL_Y_OFFSET- See Also:
-
OPPOSING_SLOPES_REST_AT_SPEED_THRESHOLD
public static final double OPPOSING_SLOPES_REST_AT_SPEED_THRESHOLD- See Also:
-
cacheIndexAlpha
-
cachedLerpDelay
private int cachedLerpDelay -
cachedPartialTick
private float cachedPartialTick -
lerpDelay
private int lerpDelay -
lerpSteps
-
currentLerpSteps
-
currentLerpStepsTotalWeight
public double currentLerpStepsTotalWeight -
oldLerp
-
-
Constructor Details
-
NewMinecartBehavior
-
-
Method Details
-
tick
public void tick()- Specified by:
tickin classMinecartBehavior
-
lerpClientPositionAndRotation
private void lerpClientPositionAndRotation() -
setOldLerpValues
public void setOldLerpValues() -
cartHasPosRotLerp
public boolean cartHasPosRotLerp() -
getCartLerpXRot
public float getCartLerpXRot(float pPartialTick) -
getCartLerpYRot
public float getCartLerpYRot(float pPartialTick) -
getCartLerpPosition
-
getCartLerpMovements
-
getCurrentLerpStep
-
adjustToRails
-
setRotation
private void setRotation(float pYRot, float pXRot) -
moveAlongTrack
- Specified by:
moveAlongTrackin classMinecartBehavior
-
calculateTrackSpeed
private Vec3 calculateTrackSpeed(ServerLevel pLevel, Vec3 pSpeed, NewMinecartBehavior.TrackIteration pTrackIteration, BlockPos pPos, BlockState pState, RailShape pRailShape) -
calculateSlopeSpeed
-
calculatePlayerInputSpeed
-
calculateHaltTrackSpeed
-
calculateBoostTrackSpeed
-
stepAlongTrack
- Specified by:
stepAlongTrackin classMinecartBehavior
-
restAtVShape
-
getMaxSpeed
- Specified by:
getMaxSpeedin classMinecartBehavior
-
isDecending
-
getSlowdownFactor
public double getSlowdownFactor()- Specified by:
getSlowdownFactorin classMinecartBehavior
-
pushAndPickupEntities
public boolean pushAndPickupEntities()- Specified by:
pushAndPickupEntitiesin classMinecartBehavior
-
pickupEntities
-
pushEntities
-