Class AbstractMinecartEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<Entity>
net.minecraft.entity.Entity
net.minecraft.entity.item.minecart.AbstractMinecartEntity
- All Implemented Interfaces:
ICommandSource,INameable,ICapabilityProvider,ICapabilitySerializable<CompoundNBT>,IForgeEntity,IForgeEntityMinecart,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
CommandBlockMinecartEntity,ContainerMinecartEntity,FurnaceMinecartEntity,MinecartEntity,SpawnerMinecartEntity,TNTMinecartEntity
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.IMoveCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate static IMinecartCollisionHandlerprivate floatprivate static final DataParameter<Boolean>private static final DataParameter<Float>private static final DataParameter<Integer>private static final DataParameter<Integer>private static final DataParameter<Integer>private static final DataParameter<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>> Fields inherited from class net.minecraft.entity.Entity
blocksBuilding, boardingCooldown, DATA_POSE, DATA_SHARED_FLAGS_ID, ENTITY_COUNTER, entityData, fallDistance, firstTick, fluidHeight, fluidOnEyes, forcedLoading, glowing, hasImpulse, horizontalCollision, hurtMarked, inChunk, invulnerableTime, isInsidePortal, level, LOGGER, maxUpStep, moveDist, noCulling, noPhysics, onGround, portalEntrancePos, portalTime, pushthrough, random, removed, stringUUID, stuckSpeedMultiplier, tickCount, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOldFields inherited from interface net.minecraft.command.ICommandSource
NULLFields inherited from interface net.minecraftforge.common.extensions.IForgeEntityMinecart
DEFAULT_AIR_DRAG, DEFAULT_MAX_SPEED_AIR_LATERAL, DEFAULT_MAX_SPEED_AIR_VERTICAL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMinecartEntity(EntityType<?> p_i48538_1_, World p_i48538_2_) protectedAbstractMinecartEntity(EntityType<?> p_i48539_1_, World p_i48539_2_, double p_i48539_3_, double p_i48539_5_, double p_i48539_7_) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateMinecart(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) protected voidaddAdditionalSaveData(CompoundNBT p_213281_1_) voidprotected voidbooleancanCollideWith(Entity p_241849_1_) booleanReturns true if this cart can currently use rails.protected voidstatic AbstractMinecartEntitycreateMinecart(World p_184263_0_, double p_184263_1_, double p_184263_3_, double p_184263_5_, AbstractMinecartEntity.Type p_184263_7_) protected voidvoiddestroy(DamageSource p_94095_1_) IPacket<?>protected floatGets the current global Minecart Collision handler if none is registered, returns null TODO: remove 1.17floatReturns the current speed cap for the cart when traveling on rails.floatintgetDismountLocationForPassenger(LivingEntity p_230268_1_) intdoubleintintprotected doublefloatfloatdoubleabstract AbstractMinecartEntity.TypedoublegetPos(double p_70489_1_, double p_70489_3_, double p_70489_5_) getPosOffs(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) protected Vector3dgetRelativePortalPosition(Direction.Axis p_241839_1_, TeleportationRepositioner.Result p_241839_2_) booleanbooleanhurt(DamageSource p_70097_1_, float p_70097_2_) protected booleanbooleanbooleanprivate booleanisRedstoneConductor(BlockPos p_213900_1_) voidlerpMotion(double p_70016_1_, double p_70016_3_, double p_70016_5_) voidlerpTo(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_) protected voidmoveAlongTrack(BlockPos p_180460_1_, BlockState p_180460_2_) voidMoved to allow overrides.voidprotected voidreadAdditionalSaveData(CompoundNBT p_70037_1_) static voidvoidsetCanUseRail(boolean value) Set whether the minecart can use rails.voidsetCurrentCartSpeedCapOnRail(float value) voidsetCustomDisplay(boolean p_94096_1_) voidsetDamage(float p_70492_1_) voidsetDisplayBlockState(BlockState p_174899_1_) voidsetDisplayOffset(int p_94086_1_) voidsetDragAir(double value) voidsetHurtDir(int p_70494_1_) voidsetHurtTime(int p_70497_1_) voidsetMaxSpeedAirLateral(float value) voidsetMaxSpeedAirVertical(float value) voidtick()Methods inherited from class net.minecraft.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, causeFallDamage, changeDimension, changeDimension, checkAndResetForcedChunkAdditionFlag, checkAndResetUpdateChunkPos, checkDespawn, checkFallDamage, checkInsideBlocks, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyeY, getFireImmuneTicks, getFluidHeight, getFluidJumpThreshold, getForward, getHandSlots, getHorizontalDistanceSqr, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getViewYRot, getX, getX, getY, getY, getYHeadRot, getZ, getZ, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasCustomName, hashCode, hasIndirectPassenger, hasOnePlayerPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFree, isGlowing, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killed, lavaHurt, lerpHeadTo, limitPistonMovement, load, lookAt, makeFlySound, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, outOfWorld, pick, playerTouch, playFlySound, playSound, playStepSound, playSwimSound, position, positionRider, processPortalCooldown, push, reapplyPosition, refreshDimensions, remove, remove, removeAfterChangingDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rideableUnderWater, rideTick, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowing, setId, setInvisible, setInvulnerable, setItemSlot, setLevel, setLocationFromBoundingbox, setNoGravity, setOnGround, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPosAndOldPos, setPose, setPosRaw, setRemainingFireTicks, setRot, setSecondsOnFire, setSharedFlag, setShiftKeyDown, setSilent, setSlot, setSprinting, setSwimming, setUUID, setViewScale, setYBodyRot, setYHeadRot, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, turn, unRide, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimmingMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getDimensionsForge, getEntity, getEyeHeightForge, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSitMethods inherited from interface net.minecraftforge.common.extensions.IForgeEntityMinecart
canBeRidden, getCartItem, getComparatorLevel, getCurrentRailPosition, getMaxCartSpeedOnRail, getMinecart, getSlopeAdjustment, isPoweredCart, shouldDoRailFunctions
-
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
-
flipped
private boolean flipped -
EXITS
-
COLLISIONS
-
lSteps
private int lSteps -
lx
private double lx -
ly
private double ly -
lz
private double lz -
lyr
private double lyr -
lxr
private double lxr -
lxd
private double lxd -
lyd
private double lyd -
lzd
private double lzd -
canBePushed
private boolean canBePushed -
canUseRail
private boolean canUseRail -
currentSpeedCapOnRail
private float currentSpeedCapOnRail -
maxSpeedAirLateral
private float maxSpeedAirLateral -
maxSpeedAirVertical
private float maxSpeedAirVertical -
dragAir
private double dragAir
-
-
Constructor Details
-
AbstractMinecartEntity
-
AbstractMinecartEntity
protected AbstractMinecartEntity(EntityType<?> p_i48539_1_, World p_i48539_2_, double p_i48539_3_, double p_i48539_5_, double p_i48539_7_)
-
-
Method Details
-
getCollisionHandler
Description copied from interface:IForgeEntityMinecartGets the current global Minecart Collision handler if none is registered, returns null TODO: remove 1.17- Specified by:
getCollisionHandlerin interfaceIForgeEntityMinecart- Returns:
- The collision handler or null
-
registerCollisionHandler
-
createMinecart
public static AbstractMinecartEntity createMinecart(World p_184263_0_, double p_184263_1_, double p_184263_3_, double p_184263_5_, AbstractMinecartEntity.Type p_184263_7_) -
isMovementNoisy
protected boolean isMovementNoisy()- Overrides:
isMovementNoisyin classEntity
-
defineSynchedData
protected void defineSynchedData()- Specified by:
defineSynchedDatain classEntity
-
canCollideWith
- Overrides:
canCollideWithin classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classEntity
-
getRelativePortalPosition
protected Vector3d getRelativePortalPosition(Direction.Axis p_241839_1_, TeleportationRepositioner.Result p_241839_2_) - Overrides:
getRelativePortalPositionin classEntity
-
getPassengersRidingOffset
public double getPassengersRidingOffset()- Overrides:
getPassengersRidingOffsetin classEntity
-
getDismountLocationForPassenger
- Overrides:
getDismountLocationForPassengerin classEntity
-
hurt
-
getBlockSpeedFactor
protected float getBlockSpeedFactor()- Overrides:
getBlockSpeedFactorin classEntity
-
destroy
-
animateHurt
public void animateHurt()- Overrides:
animateHurtin classEntity
-
isPickable
public boolean isPickable()- Overrides:
isPickablein classEntity
-
exits
-
getMotionDirection
- Overrides:
getMotionDirectionin classEntity
-
tick
public void tick() -
getMaxSpeed
protected double getMaxSpeed() -
activateMinecart
public void activateMinecart(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) -
comeOffTrack
protected void comeOffTrack() -
moveAlongTrack
-
isRedstoneConductor
-
applyNaturalSlowdown
protected void applyNaturalSlowdown() -
getPosOffs
@Nullable public Vector3d getPosOffs(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) -
getPos
-
getBoundingBoxForCulling
- Overrides:
getBoundingBoxForCullingin classEntity
-
readAdditionalSaveData
- Specified by:
readAdditionalSaveDatain classEntity
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveDatain classEntity
-
push
-
lerpTo
public void lerpTo(double p_180426_1_, double p_180426_3_, double p_180426_5_, float p_180426_7_, float p_180426_8_, int p_180426_9_, boolean p_180426_10_) -
lerpMotion
public void lerpMotion(double p_70016_1_, double p_70016_3_, double p_70016_5_) - Overrides:
lerpMotionin classEntity
-
setDamage
public void setDamage(float p_70492_1_) -
getDamage
public float getDamage() -
setHurtTime
public void setHurtTime(int p_70497_1_) -
getHurtTime
public int getHurtTime() -
setHurtDir
public void setHurtDir(int p_70494_1_) -
getHurtDir
public int getHurtDir() -
getMinecartType
-
getDisplayBlockState
-
getDefaultDisplayBlockState
-
getDisplayOffset
public int getDisplayOffset() -
getDefaultDisplayOffset
public int getDefaultDisplayOffset() -
setDisplayBlockState
-
setDisplayOffset
public void setDisplayOffset(int p_94086_1_) -
hasCustomDisplay
public boolean hasCustomDisplay() -
setCustomDisplay
public void setCustomDisplay(boolean p_94096_1_) -
getAddEntityPacket
- Specified by:
getAddEntityPacketin classEntity
-
canUseRail
public boolean canUseRail()Description copied from interface:IForgeEntityMinecartReturns true if this cart can currently use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
canUseRailin interfaceIForgeEntityMinecart- Returns:
- True if the minecart can use rails.
-
setCanUseRail
public void setCanUseRail(boolean value) Description copied from interface:IForgeEntityMinecartSet whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
setCanUseRailin interfaceIForgeEntityMinecart- Parameters:
value- Whether the minecart can currently use rails.
-
getCurrentCartSpeedCapOnRail
public float getCurrentCartSpeedCapOnRail()Description copied from interface:IForgeEntityMinecartReturns 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 interfaceIForgeEntityMinecart- Returns:
-
setCurrentCartSpeedCapOnRail
public void setCurrentCartSpeedCapOnRail(float value) - Specified by:
setCurrentCartSpeedCapOnRailin interfaceIForgeEntityMinecart
-
getMaxSpeedAirLateral
public float getMaxSpeedAirLateral()- Specified by:
getMaxSpeedAirLateralin interfaceIForgeEntityMinecart
-
setMaxSpeedAirLateral
public void setMaxSpeedAirLateral(float value) - Specified by:
setMaxSpeedAirLateralin interfaceIForgeEntityMinecart
-
getMaxSpeedAirVertical
public float getMaxSpeedAirVertical()- Specified by:
getMaxSpeedAirVerticalin interfaceIForgeEntityMinecart
-
setMaxSpeedAirVertical
public void setMaxSpeedAirVertical(float value) - Specified by:
setMaxSpeedAirVerticalin interfaceIForgeEntityMinecart
-
getDragAir
public double getDragAir()- Specified by:
getDragAirin interfaceIForgeEntityMinecart
-
setDragAir
public void setDragAir(double value) - Specified by:
setDragAirin interfaceIForgeEntityMinecart
-
getMaxSpeedWithRail
public double getMaxSpeedWithRail()- Specified by:
getMaxSpeedWithRailin interfaceIForgeEntityMinecart
-
moveMinecartOnRail
Description copied from interface:IForgeEntityMinecartMoved to allow overrides. This code handles minecart movement and speed capping when on a rail.- Specified by:
moveMinecartOnRailin interfaceIForgeEntityMinecart
-