Package net.minecraft.entity.vehicle
Class AbstractMinecartEntity
java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.vehicle.AbstractMinecartEntity
- All Implemented Interfaces:
CommandOutput
,Nameable
- Direct Known Subclasses:
CommandBlockMinecartEntity
,FurnaceMinecartEntity
,MinecartEntity
,SpawnerMinecartEntity
,StorageMinecartEntity
,TntMinecartEntity
public abstract class AbstractMinecartEntity extends Entity
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractMinecartEntity.Type
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.PositionUpdater
-
Field Summary
Fields Modifier and Type Field Description private static Map<RailShape,com.mojang.datafixers.util.Pair<Vec3i,Vec3i>>
ADJACENT_RAIL_POSITIONS_BY_SHAPE
private int
clientInterpolationSteps
private double
clientPitch
private double
clientX
private double
clientXVelocity
private double
clientY
private double
clientYaw
private double
clientYVelocity
private double
clientZ
private double
clientZVelocity
private static TrackedData<Integer>
CUSTOM_BLOCK_ID
private static TrackedData<Integer>
CUSTOM_BLOCK_OFFSET
private static TrackedData<Boolean>
CUSTOM_BLOCK_PRESENT
private static TrackedData<Integer>
DAMAGE_WOBBLE_SIDE
private static TrackedData<Float>
DAMAGE_WOBBLE_STRENGTH
private static TrackedData<Integer>
DAMAGE_WOBBLE_TICKS
private static ImmutableMap<EntityPose,ImmutableList<Integer>>
DISMOUNT_FREE_Y_SPACES_NEEDED
private boolean
yawFlipped
Fields inherited from class net.minecraft.entity.Entity
age, chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yaw
Fields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMinecartEntity(EntityType<?> type, World world)
protected
AbstractMinecartEntity(EntityType<?> type, World world, double x, double y, double z)
-
Method Summary
Modifier and Type Method Description void
animateDamage()
protected void
applySlowdown()
protected boolean
canClimb()
boolean
collides()
boolean
collidesWith(Entity other)
static AbstractMinecartEntity
create(World world, double x, double y, double z, AbstractMinecartEntity.Type type)
Packet<?>
createSpawnPacket()
boolean
damage(DamageSource source, float amount)
void
dropItems(DamageSource damageSource)
private static com.mojang.datafixers.util.Pair<Vec3i,Vec3i>
getAdjacentRailPositionsByShape(RailShape shape)
int
getBlockOffset()
BlockState
getContainedBlock()
int
getDamageWobbleSide()
float
getDamageWobbleStrength()
int
getDamageWobbleTicks()
int
getDefaultBlockOffset()
BlockState
getDefaultContainedBlock()
protected double
getMaxOffRailSpeed()
abstract AbstractMinecartEntity.Type
getMinecartType()
double
getMountedHeightOffset()
Direction
getMovementDirection()
protected float
getVelocityMultiplier()
Box
getVisibilityBoundingBox()
boolean
hasCustomBlock()
protected void
initDataTracker()
boolean
isPushable()
protected Vec3d
method_30633(Direction.Axis axis, class_5459.class_5460 class_5460)
protected void
moveOffRail()
protected void
moveOnRail(BlockPos pos, BlockState state)
void
onActivatorRail(int x, int y, int z, boolean powered)
void
pushAwayFrom(Entity entity)
protected void
readCustomDataFromTag(CompoundTag tag)
void
setCustomBlock(BlockState state)
void
setCustomBlockOffset(int offset)
void
setCustomBlockPresent(boolean present)
void
setDamageWobbleSide(int wobbleSide)
void
setDamageWobbleStrength(float float2)
void
setDamageWobbleTicks(int wobbleTicks)
void
setVelocityClient(double x, double y, double z)
Vec3d
snapPositionToRail(double x, double y, double z)
Vec3d
snapPositionToRailWithOffset(double x, double y, double z, double offset)
This method is used to determine the minecart's render orientation, by computing a position along the rail slightly before and slightly after the minecart's actual position.void
tick()
Vec3d
updatePassengerForDismount(LivingEntity passenger)
void
updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)
private boolean
willHitBlockAt(BlockPos pos)
protected void
writeCustomDataToTag(CompoundTag tag)
Methods inherited from class net.minecraft.entity.Entity
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, adjustSingleAxisMovementForCollisions, afterSpawn, applyMirror, applyRotation, baseTick, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeRiddenInWater, canBeSpectated, canExplosionDestroyBlock, canFly, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, checkDespawn, copyFrom, copyPositionAndRotation, dealDamage, destroy, detach, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, equip, equipStack, extinguish, fall, fromTag, getAir, getArmorItems, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDimensions, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeHeight, getEyeY, getFireTicks, getFlag, getFluidHeight, getHeadYaw, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getItemsHand, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, getName, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPermissionLevel, getPistonBehavior, getPitch, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSafeFallDistance, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStandingEyeHeight, getSwimSound, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getWidth, getX, getY, getYaw, getZ, handleAttack, handleFallDamage, handleStatus, hasCustomName, hashCode, hasNetherPortalCooldown, hasNoGravity, hasPassenger, hasPassengerDeep, hasPassengers, hasPassengerType, hasPermissionLevel, hasPlayerRider, hasVehicle, hasWings, interact, interactAt, isAlive, isAttackable, isChunkPosUpdateRequested, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWall, isInsideWaterOrBubbleColumn, isInSneakingPose, isInSwimmingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isLogicalSideForUpdatingMovement, isOnFire, isOnGround, isPartOf, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, kill, lookAt, method_29239, method_29241, method_29919, method_30076, method_30330, method_30632, method_30634, method_30950, method_30951, method_31166, move, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, onTrackedDataSet, playFlySound, playSound, playStepSound, playSwimSound, populateCrashReport, pushOutOfBlocks, raycast, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, remove, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetNetherPortalCooldown, resetPosition, saveSelfToTag, saveToTag, scheduleVelocityUpdate, sendSystemMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFireTicks, setFlag, setGlowing, setHeadYaw, setInNetherPortal, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setOnGround, setPos, setPose, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSprinting, setSwimming, setUuid, setVelocity, setVelocity, setWorld, setYaw, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldRenderName, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, startRiding, stopRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, tickRiding, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedHeadRotation, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
-
Field Details
-
DAMAGE_WOBBLE_TICKS
-
DAMAGE_WOBBLE_SIDE
-
DAMAGE_WOBBLE_STRENGTH
-
CUSTOM_BLOCK_ID
-
CUSTOM_BLOCK_OFFSET
-
CUSTOM_BLOCK_PRESENT
-
DISMOUNT_FREE_Y_SPACES_NEEDED
-
ADJACENT_RAIL_POSITIONS_BY_SHAPE
-
yawFlipped
private boolean yawFlipped -
clientInterpolationSteps
private int clientInterpolationSteps -
clientX
private double clientX -
clientY
private double clientY -
clientZ
private double clientZ -
clientYaw
private double clientYaw -
clientPitch
private double clientPitch -
clientXVelocity
@Environment(CLIENT) private double clientXVelocity -
clientYVelocity
@Environment(CLIENT) private double clientYVelocity -
clientZVelocity
@Environment(CLIENT) private double clientZVelocity
-
-
Constructor Details
-
AbstractMinecartEntity
-
AbstractMinecartEntity
-
-
Method Details
-
create
public static AbstractMinecartEntity create(World world, double x, double y, double z, AbstractMinecartEntity.Type type) -
canClimb
protected boolean canClimb() -
initDataTracker
protected void initDataTracker()- Specified by:
initDataTracker
in classEntity
-
collidesWith
- Overrides:
collidesWith
in classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushable
in classEntity
-
method_30633
- Overrides:
method_30633
in classEntity
-
getMountedHeightOffset
public double getMountedHeightOffset()- Overrides:
getMountedHeightOffset
in classEntity
-
updatePassengerForDismount
- Overrides:
updatePassengerForDismount
in classEntity
-
damage
-
getVelocityMultiplier
protected float getVelocityMultiplier()- Overrides:
getVelocityMultiplier
in classEntity
-
dropItems
-
animateDamage
@Environment(CLIENT) public void animateDamage()- Overrides:
animateDamage
in classEntity
-
collides
public boolean collides() -
getAdjacentRailPositionsByShape
-
getMovementDirection
- Overrides:
getMovementDirection
in classEntity
-
tick
public void tick() -
getMaxOffRailSpeed
protected double getMaxOffRailSpeed() -
onActivatorRail
public void onActivatorRail(int x, int y, int z, boolean powered) -
moveOffRail
protected void moveOffRail() -
moveOnRail
-
willHitBlockAt
-
applySlowdown
protected void applySlowdown() -
snapPositionToRailWithOffset
@Environment(CLIENT) @Nullable public Vec3d snapPositionToRailWithOffset(double x, double y, double z, double offset)This method is used to determine the minecart's render orientation, by computing a position along the rail slightly before and slightly after the minecart's actual position. -
snapPositionToRail
-
getVisibilityBoundingBox
- Overrides:
getVisibilityBoundingBox
in classEntity
-
readCustomDataFromTag
- Specified by:
readCustomDataFromTag
in classEntity
-
writeCustomDataToTag
- Specified by:
writeCustomDataToTag
in classEntity
-
pushAwayFrom
- Overrides:
pushAwayFrom
in classEntity
-
updateTrackedPositionAndAngles
@Environment(CLIENT) public void updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)- Overrides:
updateTrackedPositionAndAngles
in classEntity
-
setVelocityClient
@Environment(CLIENT) public void setVelocityClient(double x, double y, double z)- Overrides:
setVelocityClient
in classEntity
-
setDamageWobbleStrength
public void setDamageWobbleStrength(float float2) -
getDamageWobbleStrength
public float getDamageWobbleStrength() -
setDamageWobbleTicks
public void setDamageWobbleTicks(int wobbleTicks) -
getDamageWobbleTicks
public int getDamageWobbleTicks() -
setDamageWobbleSide
public void setDamageWobbleSide(int wobbleSide) -
getDamageWobbleSide
public int getDamageWobbleSide() -
getMinecartType
-
getContainedBlock
-
getDefaultContainedBlock
-
getBlockOffset
public int getBlockOffset() -
getDefaultBlockOffset
public int getDefaultBlockOffset() -
setCustomBlock
-
setCustomBlockOffset
public void setCustomBlockOffset(int offset) -
hasCustomBlock
public boolean hasCustomBlock() -
setCustomBlockPresent
public void setCustomBlockPresent(boolean present) -
createSpawnPacket
- Specified by:
createSpawnPacket
in classEntity
-