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 classAbstractMinecartEntity.TypeNested 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_SHAPEprivate intclientInterpolationStepsprivate doubleclientPitchprivate doubleclientXprivate doubleclientXVelocityprivate doubleclientYprivate doubleclientYawprivate doubleclientYVelocityprivate doubleclientZprivate doubleclientZVelocityprivate static TrackedData<Integer>CUSTOM_BLOCK_IDprivate static TrackedData<Integer>CUSTOM_BLOCK_OFFSETprivate static TrackedData<Boolean>CUSTOM_BLOCK_PRESENTprivate static TrackedData<Integer>DAMAGE_WOBBLE_SIDEprivate static TrackedData<Float>DAMAGE_WOBBLE_STRENGTHprivate static TrackedData<Integer>DAMAGE_WOBBLE_TICKSprivate static ImmutableMap<EntityPose,ImmutableList<Integer>>DISMOUNT_FREE_Y_SPACES_NEEDEDprivate booleanyawFlippedFields 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, yawFields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMinecartEntity(EntityType<?> type, World world)protectedAbstractMinecartEntity(EntityType<?> type, World world, double x, double y, double z) -
Method Summary
Modifier and Type Method Description voidanimateDamage()protected voidapplySlowdown()protected booleancanClimb()booleancollides()booleancollidesWith(Entity other)static AbstractMinecartEntitycreate(World world, double x, double y, double z, AbstractMinecartEntity.Type type)Packet<?>createSpawnPacket()booleandamage(DamageSource source, float amount)voiddropItems(DamageSource damageSource)private static com.mojang.datafixers.util.Pair<Vec3i,Vec3i>getAdjacentRailPositionsByShape(RailShape shape)intgetBlockOffset()BlockStategetContainedBlock()intgetDamageWobbleSide()floatgetDamageWobbleStrength()intgetDamageWobbleTicks()intgetDefaultBlockOffset()BlockStategetDefaultContainedBlock()protected doublegetMaxOffRailSpeed()abstract AbstractMinecartEntity.TypegetMinecartType()doublegetMountedHeightOffset()DirectiongetMovementDirection()protected floatgetVelocityMultiplier()BoxgetVisibilityBoundingBox()booleanhasCustomBlock()protected voidinitDataTracker()booleanisPushable()protected Vec3dmethod_30633(Direction.Axis axis, class_5459.class_5460 class_5460)protected voidmoveOffRail()protected voidmoveOnRail(BlockPos pos, BlockState state)voidonActivatorRail(int x, int y, int z, boolean powered)voidpushAwayFrom(Entity entity)protected voidreadCustomDataFromTag(CompoundTag tag)voidsetCustomBlock(BlockState state)voidsetCustomBlockOffset(int offset)voidsetCustomBlockPresent(boolean present)voidsetDamageWobbleSide(int wobbleSide)voidsetDamageWobbleStrength(float float2)voidsetDamageWobbleTicks(int wobbleTicks)voidsetVelocityClient(double x, double y, double z)Vec3dsnapPositionToRail(double x, double y, double z)Vec3dsnapPositionToRailWithOffset(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.voidtick()Vec3dupdatePassengerForDismount(LivingEntity passenger)voidupdateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)private booleanwillHitBlockAt(BlockPos pos)protected voidwriteCustomDataToTag(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:
initDataTrackerin classEntity
-
collidesWith
- Overrides:
collidesWithin classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classEntity
-
method_30633
- Overrides:
method_30633in classEntity
-
getMountedHeightOffset
public double getMountedHeightOffset()- Overrides:
getMountedHeightOffsetin classEntity
-
updatePassengerForDismount
- Overrides:
updatePassengerForDismountin classEntity
-
damage
-
getVelocityMultiplier
protected float getVelocityMultiplier()- Overrides:
getVelocityMultiplierin classEntity
-
dropItems
-
animateDamage
@Environment(CLIENT) public void animateDamage()- Overrides:
animateDamagein classEntity
-
collides
public boolean collides() -
getAdjacentRailPositionsByShape
-
getMovementDirection
- Overrides:
getMovementDirectionin 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:
getVisibilityBoundingBoxin classEntity
-
readCustomDataFromTag
- Specified by:
readCustomDataFromTagin classEntity
-
writeCustomDataToTag
- Specified by:
writeCustomDataToTagin classEntity
-
pushAwayFrom
- Overrides:
pushAwayFromin classEntity
-
updateTrackedPositionAndAngles
@Environment(CLIENT) public void updateTrackedPositionAndAngles(double x, double y, double z, float yaw, float pitch, int interpolationSteps, boolean interpolate)- Overrides:
updateTrackedPositionAndAnglesin classEntity
-
setVelocityClient
@Environment(CLIENT) public void setVelocityClient(double x, double y, double z)- Overrides:
setVelocityClientin 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:
createSpawnPacketin classEntity
-