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 classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.IMoveCallback
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private static IMinecartCollisionHandler
private float
private 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 double
private boolean
private int
private double
private double
private double
private double
private double
private double
private double
private double
private float
private float
private 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, zOld
Fields inherited from interface net.minecraft.command.ICommandSource
NULL
Fields inherited from interface net.minecraftforge.common.extensions.IForgeEntityMinecart
DEFAULT_AIR_DRAG, DEFAULT_MAX_SPEED_AIR_LATERAL, DEFAULT_MAX_SPEED_AIR_VERTICAL
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMinecartEntity
(EntityType<?> p_i48538_1_, World p_i48538_2_) protected
AbstractMinecartEntity
(EntityType<?> p_i48539_1_, World p_i48539_2_, double p_i48539_3_, double p_i48539_5_, double p_i48539_7_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateMinecart
(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) protected void
addAdditionalSaveData
(CompoundNBT p_213281_1_) void
protected void
boolean
canCollideWith
(Entity p_241849_1_) boolean
Returns true if this cart can currently use rails.protected void
static AbstractMinecartEntity
createMinecart
(World p_184263_0_, double p_184263_1_, double p_184263_3_, double p_184263_5_, AbstractMinecartEntity.Type p_184263_7_) protected void
void
destroy
(DamageSource p_94095_1_) IPacket<?>
protected float
Gets the current global Minecart Collision handler if none is registered, returns null TODO: remove 1.17float
Returns the current speed cap for the cart when traveling on rails.float
int
getDismountLocationForPassenger
(LivingEntity p_230268_1_) int
double
int
int
protected double
float
float
double
abstract AbstractMinecartEntity.Type
double
getPos
(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 Vector3d
getRelativePortalPosition
(Direction.Axis p_241839_1_, TeleportationRepositioner.Result p_241839_2_) boolean
boolean
hurt
(DamageSource p_70097_1_, float p_70097_2_) protected boolean
boolean
boolean
private boolean
isRedstoneConductor
(BlockPos p_213900_1_) void
lerpMotion
(double p_70016_1_, double p_70016_3_, double p_70016_5_) 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_) protected void
moveAlongTrack
(BlockPos p_180460_1_, BlockState p_180460_2_) void
Moved to allow overrides.void
protected void
readAdditionalSaveData
(CompoundNBT p_70037_1_) static void
void
setCanUseRail
(boolean value) Set whether the minecart can use rails.void
setCurrentCartSpeedCapOnRail
(float value) void
setCustomDisplay
(boolean p_94096_1_) void
setDamage
(float p_70492_1_) void
setDisplayBlockState
(BlockState p_174899_1_) void
setDisplayOffset
(int p_94086_1_) void
setDragAir
(double value) void
setHurtDir
(int p_70494_1_) void
setHurtTime
(int p_70497_1_) void
setMaxSpeedAirLateral
(float value) void
setMaxSpeedAirVertical
(float value) void
tick()
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, updateSwimming
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getDimensionsForge, getEntity, getEyeHeightForge, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
Methods 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:IForgeEntityMinecart
Gets the current global Minecart Collision handler if none is registered, returns null TODO: remove 1.17- Specified by:
getCollisionHandler
in 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:
isMovementNoisy
in classEntity
-
defineSynchedData
protected void defineSynchedData()- Specified by:
defineSynchedData
in classEntity
-
canCollideWith
- Overrides:
canCollideWith
in classEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushable
in classEntity
-
getRelativePortalPosition
protected Vector3d getRelativePortalPosition(Direction.Axis p_241839_1_, TeleportationRepositioner.Result p_241839_2_) - Overrides:
getRelativePortalPosition
in classEntity
-
getPassengersRidingOffset
public double getPassengersRidingOffset()- Overrides:
getPassengersRidingOffset
in classEntity
-
getDismountLocationForPassenger
- Overrides:
getDismountLocationForPassenger
in classEntity
-
hurt
-
getBlockSpeedFactor
protected float getBlockSpeedFactor()- Overrides:
getBlockSpeedFactor
in classEntity
-
destroy
-
animateHurt
public void animateHurt()- Overrides:
animateHurt
in classEntity
-
isPickable
public boolean isPickable()- Overrides:
isPickable
in classEntity
-
exits
-
getMotionDirection
- Overrides:
getMotionDirection
in 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:
getBoundingBoxForCulling
in classEntity
-
readAdditionalSaveData
- Specified by:
readAdditionalSaveData
in classEntity
-
addAdditionalSaveData
- Specified by:
addAdditionalSaveData
in 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:
lerpMotion
in 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:
getAddEntityPacket
in classEntity
-
canUseRail
public boolean canUseRail()Description copied from interface:IForgeEntityMinecart
Returns true if this cart can currently use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
canUseRail
in interfaceIForgeEntityMinecart
- Returns:
- True if the minecart can use rails.
-
setCanUseRail
public void setCanUseRail(boolean value) Description copied from interface:IForgeEntityMinecart
Set whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
setCanUseRail
in interfaceIForgeEntityMinecart
- Parameters:
value
- Whether the minecart can currently use rails.
-
getCurrentCartSpeedCapOnRail
public float getCurrentCartSpeedCapOnRail()Description copied from interface:IForgeEntityMinecart
Returns 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:
getCurrentCartSpeedCapOnRail
in interfaceIForgeEntityMinecart
- Returns:
-
setCurrentCartSpeedCapOnRail
public void setCurrentCartSpeedCapOnRail(float value) - Specified by:
setCurrentCartSpeedCapOnRail
in interfaceIForgeEntityMinecart
-
getMaxSpeedAirLateral
public float getMaxSpeedAirLateral()- Specified by:
getMaxSpeedAirLateral
in interfaceIForgeEntityMinecart
-
setMaxSpeedAirLateral
public void setMaxSpeedAirLateral(float value) - Specified by:
setMaxSpeedAirLateral
in interfaceIForgeEntityMinecart
-
getMaxSpeedAirVertical
public float getMaxSpeedAirVertical()- Specified by:
getMaxSpeedAirVertical
in interfaceIForgeEntityMinecart
-
setMaxSpeedAirVertical
public void setMaxSpeedAirVertical(float value) - Specified by:
setMaxSpeedAirVertical
in interfaceIForgeEntityMinecart
-
getDragAir
public double getDragAir()- Specified by:
getDragAir
in interfaceIForgeEntityMinecart
-
setDragAir
public void setDragAir(double value) - Specified by:
setDragAir
in interfaceIForgeEntityMinecart
-
getMaxSpeedWithRail
public double getMaxSpeedWithRail()- Specified by:
getMaxSpeedWithRail
in interfaceIForgeEntityMinecart
-
moveMinecartOnRail
Description copied from interface:IForgeEntityMinecart
Moved to allow overrides. This code handles minecart movement and speed capping when on a rail.- Specified by:
moveMinecartOnRail
in interfaceIForgeEntityMinecart
-