Class AbstractMinecart
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<Entity>
net.minecraft.world.entity.Entity
net.minecraft.world.entity.vehicle.AbstractMinecart
- All Implemented Interfaces:
- CommandSource,- EntityAccess,- Nameable,- ICapabilityProvider,- ICapabilityProviderImpl<Entity>,- ICapabilitySerializable<CompoundTag>,- IForgeAbstractMinecart,- IForgeEntity,- INBTSerializable<CompoundTag>
- Direct Known Subclasses:
- AbstractMinecartContainer,- Minecart,- MinecartCommandBlock,- MinecartFurnace,- MinecartSpawner,- MinecartTNT
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.EntityEntity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProviderCapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate static IMinecartCollisionHandlerprivate floatprivate static final EntityDataAccessor<Boolean>private static final EntityDataAccessor<Float>private static final EntityDataAccessor<Integer>private static final EntityDataAccessor<Integer>private static final EntityDataAccessor<Integer>private static final EntityDataAccessor<Integer>private doubleprivate booleanprivate intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate floatprivate floatprivate static final com.google.common.collect.ImmutableMap<Pose,com.google.common.collect.ImmutableList<Integer>> protected static final floatFields inherited from class net.minecraft.world.entity.EntityBASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, isInsidePortal, level, MAX_ENTITY_TAG_COUNT, maxUpStep, minorHorizontalCollision, moveDist, noCulling, noPhysics, onGround, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from interface net.minecraft.commands.CommandSourceNULLFields inherited from interface net.minecraftforge.common.extensions.IForgeAbstractMinecartDEFAULT_AIR_DRAG, DEFAULT_MAX_SPEED_AIR_LATERAL, DEFAULT_MAX_SPEED_AIR_VERTICAL
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractMinecart(EntityType<?> p_38087_, Level p_38088_) protectedAbstractMinecart(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidactivateMinecart(int p_38111_, int p_38112_, int p_38113_, boolean p_38114_) protected voidaddAdditionalSaveData(CompoundTag p_38151_) voidprotected voidbooleancanCollideWith(Entity p_38168_) booleanReturns true if this cart can currently use rails.protected voidstatic AbstractMinecartcreateMinecart(Level p_38120_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_) protected voidvoiddestroy(DamageSource p_38115_) Packet<?>protected floatfloatReturns the current speed cap for the cart when traveling on rails.floatintgetDismountLocationForPassenger(LivingEntity p_38145_) intdoubleintintprotected doublefloatfloatdoubleabstract AbstractMinecart.Typeprotected Entity.MovementEmissiondoublegetPos(double p_38180_, double p_38181_, double p_38182_) getPosOffs(double p_38097_, double p_38098_, double p_38099_, double p_38100_) protected Vec3getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) booleanbooleanhurt(DamageSource p_38117_, float p_38118_) booleanbooleanprivate booleanisRedstoneConductor(BlockPos p_38130_) voidlerpMotion(double p_38171_, double p_38172_, double p_38173_) voidlerpTo(double p_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_, boolean p_38108_) protected voidmoveAlongTrack(BlockPos p_38156_, BlockState p_38157_) voidMoved to allow overrides.voidprotected voidreadAdditionalSaveData(CompoundTag p_38137_) static voidvoidsetCanUseRail(boolean value) Set whether the minecart can use rails.voidsetCurrentCartSpeedCapOnRail(float value) voidsetCustomDisplay(boolean p_38139_) voidsetDamage(float p_38110_) voidsetDisplayBlockState(BlockState p_38147_) voidsetDisplayOffset(int p_38175_) voidsetDragAir(double value) voidsetHurtDir(int p_38161_) voidsetHurtTime(int p_38155_) voidsetMaxSpeedAirLateral(float value) voidsetMaxSpeedAirVertical(float value) voidtick()Methods inherited from class net.minecraft.world.entity.EntityabsMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canEnterPose, canFreeze, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, causeFallDamage, changeDimension, changeDimension, checkDespawn, checkFallDamage, checkInsideBlocks, checkOutOfWorld, chunkPosition, clearFire, closerThan, collideBoundingBox, copyPosition, createCommandSourceStack, createHoverEvent, discard, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, eyeBlockPosition, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, gameEvent, gameEvent, gameEvent, gameEvent, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getForward, getGameEventListenerRegistrar, getHandHoldingItemAngle, getHandSlots, getId, getIndirectPassengers, getLeashOffset, getLevel, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getViewYRot, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killed, lavaHurt, lerpHeadTo, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, occludesVibrations, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, outOfWorld, pick, playEntityOnFireExtinguishedSound, playerTouch, playSound, playStepSound, playSwimSound, position, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, recreateFromPacket, refreshDimensions, remove, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideableUnderWater, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setItemSlot, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimmingMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProviderareCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSourcealwaysAcceptsMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvidergetCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeAbstractMinecartcanBeRidden, getCartItem, getComparatorLevel, getCurrentRailPosition, getMaxCartSpeedOnRail, getSlopeAdjustment, isPoweredCart, shouldDoRailFunctionsMethods inherited from interface net.minecraftforge.common.extensions.IForgeEntitycanBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getParts, getPickedResult, getStepHeight, isMultipartEntity, serializeNBT, shouldRiderSit
- 
Field Details- 
DATA_ID_HURT
- 
DATA_ID_HURTDIR
- 
DATA_ID_DAMAGE
- 
DATA_ID_DISPLAY_BLOCK
- 
DATA_ID_DISPLAY_OFFSET
- 
DATA_ID_CUSTOM_DISPLAY
- 
POSE_DISMOUNT_HEIGHTS
- 
WATER_SLOWDOWN_FACTORprotected static final float WATER_SLOWDOWN_FACTOR- See Also:
 
- 
flippedprivate boolean flipped
- 
EXITS
- 
COLLISIONS
- 
lStepsprivate int lSteps
- 
lxprivate double lx
- 
lyprivate double ly
- 
lzprivate double lz
- 
lyrprivate double lyr
- 
lxrprivate double lxr
- 
lxdprivate double lxd
- 
lydprivate double lyd
- 
lzdprivate double lzd
- 
canBePushedprivate boolean canBePushed
- 
canUseRailprivate boolean canUseRail
- 
currentSpeedCapOnRailprivate float currentSpeedCapOnRail
- 
maxSpeedAirLateralprivate float maxSpeedAirLateral
- 
maxSpeedAirVerticalprivate float maxSpeedAirVertical
- 
dragAirprivate double dragAir
 
- 
- 
Constructor Details- 
AbstractMinecart
- 
AbstractMinecartprotected AbstractMinecart(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_) 
 
- 
- 
Method Details- 
getCollisionHandler
- 
registerCollisionHandler
- 
createMinecartpublic static AbstractMinecart createMinecart(Level p_38120_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_) 
- 
getMovementEmission- Overrides:
- getMovementEmissionin class- Entity
 
- 
defineSynchedDataprotected void defineSynchedData()- Specified by:
- defineSynchedDatain class- Entity
 
- 
canCollideWith- Overrides:
- canCollideWithin class- Entity
 
- 
isPushablepublic boolean isPushable()- Overrides:
- isPushablein class- Entity
 
- 
getRelativePortalPositionprotected Vec3 getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) - Overrides:
- getRelativePortalPositionin class- Entity
 
- 
getPassengersRidingOffsetpublic double getPassengersRidingOffset()- Overrides:
- getPassengersRidingOffsetin class- Entity
 
- 
getDismountLocationForPassenger- Overrides:
- getDismountLocationForPassengerin class- Entity
 
- 
hurt
- 
getBlockSpeedFactorprotected float getBlockSpeedFactor()- Overrides:
- getBlockSpeedFactorin class- Entity
 
- 
destroy
- 
animateHurtpublic void animateHurt()- Overrides:
- animateHurtin class- Entity
 
- 
isPickablepublic boolean isPickable()- Overrides:
- isPickablein class- Entity
 
- 
exits
- 
getMotionDirection- Overrides:
- getMotionDirectionin class- Entity
 
- 
tickpublic void tick()
- 
getMaxSpeedprotected double getMaxSpeed()
- 
activateMinecartpublic void activateMinecart(int p_38111_, int p_38112_, int p_38113_, boolean p_38114_) 
- 
comeOffTrackprotected void comeOffTrack()
- 
moveAlongTrack
- 
isRedstoneConductor
- 
applyNaturalSlowdownprotected void applyNaturalSlowdown()
- 
getPosOffs@Nullable public Vec3 getPosOffs(double p_38097_, double p_38098_, double p_38099_, double p_38100_) 
- 
getPos
- 
getBoundingBoxForCulling- Overrides:
- getBoundingBoxForCullingin class- Entity
 
- 
readAdditionalSaveData- Specified by:
- readAdditionalSaveDatain class- Entity
 
- 
addAdditionalSaveData- Specified by:
- addAdditionalSaveDatain class- Entity
 
- 
push
- 
lerpTopublic void lerpTo(double p_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_, boolean p_38108_) 
- 
lerpMotionpublic void lerpMotion(double p_38171_, double p_38172_, double p_38173_) - Overrides:
- lerpMotionin class- Entity
 
- 
setDamagepublic void setDamage(float p_38110_) 
- 
getDamagepublic float getDamage()
- 
setHurtTimepublic void setHurtTime(int p_38155_) 
- 
getHurtTimepublic int getHurtTime()
- 
setHurtDirpublic void setHurtDir(int p_38161_) 
- 
getHurtDirpublic int getHurtDir()
- 
getMinecartType
- 
getDisplayBlockState
- 
getDefaultDisplayBlockState
- 
getDisplayOffsetpublic int getDisplayOffset()
- 
getDefaultDisplayOffsetpublic int getDefaultDisplayOffset()
- 
setDisplayBlockState
- 
setDisplayOffsetpublic void setDisplayOffset(int p_38175_) 
- 
hasCustomDisplaypublic boolean hasCustomDisplay()
- 
setCustomDisplaypublic void setCustomDisplay(boolean p_38139_) 
- 
getAddEntityPacket- Specified by:
- getAddEntityPacketin class- Entity
 
- 
canUseRailpublic boolean canUseRail()Description copied from interface:IForgeAbstractMinecartReturns true if this cart can currently use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
- canUseRailin interface- IForgeAbstractMinecart
- Returns:
- True if the minecart can use rails.
 
- 
setCanUseRailpublic void setCanUseRail(boolean value) Description copied from interface:IForgeAbstractMinecartSet whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
- setCanUseRailin interface- IForgeAbstractMinecart
- Parameters:
- value- Whether the minecart can currently use rails.
 
- 
getCurrentCartSpeedCapOnRailpublic float getCurrentCartSpeedCapOnRail()Description copied from interface:IForgeAbstractMinecartReturns the current speed cap for the cart when traveling on rails. This functions differs from getMaxCartSpeedOnRail() in that it controls current movement and cannot be overridden. The value however can never be higher than getMaxCartSpeedOnRail().- Specified by:
- getCurrentCartSpeedCapOnRailin interface- IForgeAbstractMinecart
 
- 
setCurrentCartSpeedCapOnRailpublic void setCurrentCartSpeedCapOnRail(float value) - Specified by:
- setCurrentCartSpeedCapOnRailin interface- IForgeAbstractMinecart
 
- 
getMaxSpeedAirLateralpublic float getMaxSpeedAirLateral()- Specified by:
- getMaxSpeedAirLateralin interface- IForgeAbstractMinecart
 
- 
setMaxSpeedAirLateralpublic void setMaxSpeedAirLateral(float value) - Specified by:
- setMaxSpeedAirLateralin interface- IForgeAbstractMinecart
 
- 
getMaxSpeedAirVerticalpublic float getMaxSpeedAirVertical()- Specified by:
- getMaxSpeedAirVerticalin interface- IForgeAbstractMinecart
 
- 
setMaxSpeedAirVerticalpublic void setMaxSpeedAirVertical(float value) - Specified by:
- setMaxSpeedAirVerticalin interface- IForgeAbstractMinecart
 
- 
getDragAirpublic double getDragAir()- Specified by:
- getDragAirin interface- IForgeAbstractMinecart
 
- 
setDragAirpublic void setDragAir(double value) - Specified by:
- setDragAirin interface- IForgeAbstractMinecart
 
- 
getMaxSpeedWithRailpublic double getMaxSpeedWithRail()- Specified by:
- getMaxSpeedWithRailin interface- IForgeAbstractMinecart
 
- 
moveMinecartOnRailDescription copied from interface:IForgeAbstractMinecartMoved to allow overrides. This code handles minecart movement and speed capping when on a rail.- Specified by:
- moveMinecartOnRailin interface- IForgeAbstractMinecart
 
- 
getPickResult- Overrides:
- getPickResultin class- Entity
 
 
-