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 Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReason
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private static IMinecartCollisionHandler
private float
private 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 double
private boolean
private int
private double
private double
private double
private double
private double
private double
private double
private double
private @Nullable Float
private float
private static final com.google.common.collect.ImmutableMap<Pose,
com.google.common.collect.ImmutableList<Integer>> protected static final float
Fields inherited from class net.minecraft.world.entity.Entity
BASE_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, forgeFluidTypeHeight, 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, zOld
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
Fields inherited from interface net.minecraftforge.common.extensions.IForgeAbstractMinecart
DEFAULT_AIR_DRAG, DEFAULT_MAX_SPEED_AIR_LATERAL, DEFAULT_MAX_SPEED_AIR_VERTICAL
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMinecart
(EntityType<?> p_38087_, Level p_38088_) protected
AbstractMinecart
(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activateMinecart
(int p_38111_, int p_38112_, int p_38113_, boolean p_38114_) protected void
addAdditionalSaveData
(CompoundTag p_38151_) void
protected void
boolean
canCollideWith
(Entity p_38168_) boolean
Returns true if this cart can currently use rails.protected void
static AbstractMinecart
createMinecart
(Level p_38120_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_) protected void
void
destroy
(DamageSource p_38115_) protected float
float
Returns the current speed cap for the cart when traveling on rails.float
int
getDismountLocationForPassenger
(LivingEntity p_38145_) int
double
protected abstract Item
int
int
protected double
float
float
double
abstract AbstractMinecart.Type
protected Entity.MovementEmission
double
getPos
(double p_38180_, double p_38181_, double p_38182_) getPosOffs
(double p_38097_, double p_38098_, double p_38099_, double p_38100_) protected Vec3
getRelativePortalPosition
(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) boolean
boolean
hurt
(DamageSource p_38117_, float p_38118_) boolean
boolean
private boolean
isRedstoneConductor
(BlockPos p_38130_) void
lerpMotion
(double p_38171_, double p_38172_, double p_38173_) void
lerpTo
(double p_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_, boolean p_38108_) protected void
moveAlongTrack
(BlockPos p_38156_, BlockState p_38157_) void
Moved to allow overrides.void
protected void
readAdditionalSaveData
(CompoundTag p_38137_) static void
void
setCanUseRail
(boolean value) Set whether the minecart can use rails.void
setCurrentCartSpeedCapOnRail
(float value) void
setCustomDisplay
(boolean p_38139_) void
setDamage
(float p_38110_) void
setDisplayBlockState
(BlockState p_38147_) void
setDisplayOffset
(int p_38175_) void
setDragAir
(double value) void
setHurtDir
(int p_38161_) void
setHurtTime
(int p_38155_) void
setMaxSpeedAirLateral
(float value) void
setMaxSpeedAirVertical
(float value) void
tick()
Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, allowsDismounting, 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, checkSlowFallDistance, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, createCommandSourceStack, createHoverEvent, dampensVibrations, discard, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, fixupDimensions, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForPose, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensions, getDirection, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getHandHoldingItemAngle, getHandSlots, getId, getIndirectPassengers, getLeashOffset, getLeashOffset, getLevel, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getMyRidingOffset, getName, getOnPos, getOnPosLegacy, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getPositionCodec, 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, getVisualRotationYInDegrees, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, 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, lavaHurt, lerpHeadTo, limitPistonMovement, load, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, outOfWorld, pick, playEntityOnFireExtinguishedSound, playerTouch, playSound, 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, sendSystemMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setItemSlot, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, 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, syncPacketPositionCodec, teleportRelative, teleportTo, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, wasKilled
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.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeAbstractMinecart
canBeRidden, getComparatorLevel, getCurrentRailPosition, getMaxCartSpeedOnRail, getSlopeAdjustment, isPoweredCart, shouldDoRailFunctions
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canSwimInFluidType, deserializeNBT, getClassification, getFluidFallDistanceModifier, getFluidMotionScale, getParts, getPickedResult, getSoundFromFluidType, getStepHeight, hasCustomOutlineRendering, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, 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_FACTOR
protected static final float WATER_SLOWDOWN_FACTOR- See Also:
-
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
-
maxSpeedAirVertical
private float maxSpeedAirVertical -
dragAir
private double dragAir
-
-
Constructor Details
-
AbstractMinecart
-
AbstractMinecart
protected AbstractMinecart(EntityType<?> p_38090_, Level p_38091_, double p_38092_, double p_38093_, double p_38094_)
-
-
Method Details
-
getCollisionHandler
-
registerCollisionHandler
-
createMinecart
public static AbstractMinecart createMinecart(Level p_38120_, double p_38121_, double p_38122_, double p_38123_, AbstractMinecart.Type p_38124_) -
getMovementEmission
- Overrides:
getMovementEmission
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 Vec3 getRelativePortalPosition(Direction.Axis p_38132_, BlockUtil.FoundRectangle p_38133_) - 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
-
getDropItem
-
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_38111_, int p_38112_, int p_38113_, boolean p_38114_) -
comeOffTrack
protected void comeOffTrack() -
moveAlongTrack
-
isRedstoneConductor
-
applyNaturalSlowdown
protected void applyNaturalSlowdown() -
getPosOffs
@Nullable public Vec3 getPosOffs(double p_38097_, double p_38098_, double p_38099_, double p_38100_) -
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_38102_, double p_38103_, double p_38104_, float p_38105_, float p_38106_, int p_38107_, boolean p_38108_) -
lerpMotion
public void lerpMotion(double p_38171_, double p_38172_, double p_38173_) - Overrides:
lerpMotion
in classEntity
-
setDamage
public void setDamage(float p_38110_) -
getDamage
public float getDamage() -
setHurtTime
public void setHurtTime(int p_38155_) -
getHurtTime
public int getHurtTime() -
setHurtDir
public void setHurtDir(int p_38161_) -
getHurtDir
public int getHurtDir() -
getMinecartType
-
getDisplayBlockState
-
getDefaultDisplayBlockState
-
getDisplayOffset
public int getDisplayOffset() -
getDefaultDisplayOffset
public int getDefaultDisplayOffset() -
setDisplayBlockState
-
setDisplayOffset
public void setDisplayOffset(int p_38175_) -
hasCustomDisplay
public boolean hasCustomDisplay() -
setCustomDisplay
public void setCustomDisplay(boolean p_38139_) -
canUseRail
public boolean canUseRail()Description copied from interface:IForgeAbstractMinecart
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 interfaceIForgeAbstractMinecart
- Returns:
- True if the minecart can use rails.
-
setCanUseRail
public void setCanUseRail(boolean value) Description copied from interface:IForgeAbstractMinecart
Set whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail.- Specified by:
setCanUseRail
in interfaceIForgeAbstractMinecart
- Parameters:
value
- Whether the minecart can currently use rails.
-
getCurrentCartSpeedCapOnRail
public float getCurrentCartSpeedCapOnRail()Description copied from interface:IForgeAbstractMinecart
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 interfaceIForgeAbstractMinecart
-
setCurrentCartSpeedCapOnRail
public void setCurrentCartSpeedCapOnRail(float value) - Specified by:
setCurrentCartSpeedCapOnRail
in interfaceIForgeAbstractMinecart
-
getMaxSpeedAirLateral
public float getMaxSpeedAirLateral()- Specified by:
getMaxSpeedAirLateral
in interfaceIForgeAbstractMinecart
-
setMaxSpeedAirLateral
public void setMaxSpeedAirLateral(float value) - Specified by:
setMaxSpeedAirLateral
in interfaceIForgeAbstractMinecart
-
getMaxSpeedAirVertical
public float getMaxSpeedAirVertical()- Specified by:
getMaxSpeedAirVertical
in interfaceIForgeAbstractMinecart
-
setMaxSpeedAirVertical
public void setMaxSpeedAirVertical(float value) - Specified by:
setMaxSpeedAirVertical
in interfaceIForgeAbstractMinecart
-
getDragAir
public double getDragAir()- Specified by:
getDragAir
in interfaceIForgeAbstractMinecart
-
setDragAir
public void setDragAir(double value) - Specified by:
setDragAir
in interfaceIForgeAbstractMinecart
-
getMaxSpeedWithRail
public double getMaxSpeedWithRail()- Specified by:
getMaxSpeedWithRail
in interfaceIForgeAbstractMinecart
-
moveMinecartOnRail
Description copied from interface:IForgeAbstractMinecart
Moved to allow overrides. This code handles minecart movement and speed capping when on a rail.- Specified by:
moveMinecartOnRail
in interfaceIForgeAbstractMinecart
-
getPickResult
- Overrides:
getPickResult
in classEntity
-