Class NewMinecartBehavior
java.lang.Object
net.minecraft.world.entity.vehicle.minecart.MinecartBehavior
net.minecraft.world.entity.vehicle.minecart.NewMinecartBehavior
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordprivate static final recordprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate floatprivate @Nullable NewMinecartBehavior.StepPartialTicksdoubleprivate intstatic final doublestatic final doublestatic final intFields inherited from class MinecartBehavior
minecart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustToRails(BlockPos targetBlockPos, BlockState currentState, boolean instant) private Vec3calculateBoostTrackSpeed(Vec3 deltaMovement, BlockPos pos, BlockState state) private Vec3calculateHaltTrackSpeed(Vec3 deltaMovement, BlockState state) private Vec3calculatePlayerInputSpeed(Vec3 deltaMovement) private Vec3calculateSlopeSpeed(Vec3 deltaMovement, RailShape shape) private Vec3calculateTrackSpeed(ServerLevel level, Vec3 deltaMovement, NewMinecartBehavior.TrackIteration trackIteration, BlockPos currentPos, BlockState currentState, RailShape shape) booleangetCartLerpMovements(float partialTicks) getCartLerpPosition(float partialTicks) floatgetCartLerpXRot(float partialTicks) floatgetCartLerpYRot(float partialTicks) getCurrentLerpStep(float partialTick) doublegetMaxSpeed(ServerLevel level) doubleprivate booleanisDecending(Vec3 movement, RailShape shape) private voidvoidmoveAlongTrack(ServerLevel level) booleanpickupEntities(AABB hitbox) booleanbooleanpushEntities(AABB hitbox) private booleanrestAtVShape(RailShape currentRailShape, RailShape newRailShape) voidprivate voidsetRotation(float yRot, float xRot) doublestepAlongTrack(BlockPos pos, RailShape shape, double movementLeft) voidtick()Methods inherited from class 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 partialTicks) -
getCartLerpYRot
public float getCartLerpYRot(float partialTicks) -
getCartLerpPosition
-
getCartLerpMovements
-
getCurrentLerpStep
-
adjustToRails
-
setRotation
private void setRotation(float yRot, float xRot) -
moveAlongTrack
- Specified by:
moveAlongTrackin classMinecartBehavior
-
calculateTrackSpeed
private Vec3 calculateTrackSpeed(ServerLevel level, Vec3 deltaMovement, NewMinecartBehavior.TrackIteration trackIteration, BlockPos currentPos, BlockState currentState, RailShape shape) -
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
-