public abstract class EntityMinecart extends Entity implements IWorldNameable
Modifier and Type | Class and Description |
---|---|
static class |
EntityMinecart.Type |
Modifier and Type | Field and Description |
---|---|
protected boolean |
canBePushed |
protected boolean |
canUseRail |
static double |
defaultDragAir |
static float |
defaultMaxSpeedAirLateral |
static float |
defaultMaxSpeedAirVertical |
protected double |
dragAir |
protected float |
maxSpeedAirLateral |
protected float |
maxSpeedAirVertical |
addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, updateBlocked, velocityChanged, width, world
Constructor and Description |
---|
EntityMinecart(World worldIn) |
EntityMinecart(World worldIn,
double x,
double y,
double z) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyDrag() |
void |
applyEntityCollision(Entity entityIn)
Applies a velocity to the entities, to push them away from eachother.
|
boolean |
attackEntityFrom(DamageSource source,
float amount)
Called when the entity is attacked.
|
boolean |
canBeCollidedWith()
Returns true if other Entities should be prevented from moving through this Entity.
|
boolean |
canBePushed()
Returns true if this entity should push and be pushed by other entities when colliding.
|
boolean |
canBeRidden()
Returns true if this cart can be ridden by an Entity.
|
protected boolean |
canTriggerWalking()
returns if this entity triggers Block.onEntityWalking on the blocks they walk on.
|
boolean |
canUseRail()
Returns true if this cart can currently use rails.
|
static EntityMinecart |
create(World worldIn,
double x,
double y,
double z,
EntityMinecart.Type typeIn) |
protected void |
entityInit() |
EnumFacing |
getAdjustedHorizontalFacing()
Gets the horizontal facing direction of this Entity, adjusted to take specially-treated entity types into
account.
|
ItemStack |
getCartItem()
This function returns an ItemStack that represents this cart.
|
AxisAlignedBB |
getCollisionBoundingBox()
Returns the collision bounding box for this entity
|
AxisAlignedBB |
getCollisionBox(Entity entityIn)
Returns a boundingBox used to collide the entity with other entities and blocks.
|
static IMinecartCollisionHandler |
getCollisionHandler()
Gets the current global Minecart Collision handler if none
is registered, returns null
|
int |
getComparatorLevel()
Called from Detector Rails to retrieve a redstone power level for comparators.
|
float |
getCurrentCartSpeedCapOnRail()
Returns the current speed cap for the cart when traveling on rails.
|
float |
getDamage()
Gets the current amount of damage the minecart has taken.
|
IBlockState |
getDefaultDisplayTile() |
int |
getDefaultDisplayTileOffset() |
IBlockState |
getDisplayTile() |
int |
getDisplayTileOffset() |
double |
getDragAir() |
float |
getMaxCartSpeedOnRail()
Returns the carts max speed when traveling on rails.
|
protected double |
getMaximumSpeed()
Get's the maximum speed for a minecart
|
protected double |
getMaxSpeed() |
float |
getMaxSpeedAirLateral() |
float |
getMaxSpeedAirVertical() |
double |
getMountedYOffset()
Returns the Y offset from the entity's position for any entity riding this one.
|
Vec3d |
getPos(double p_70489_1_,
double p_70489_3_,
double p_70489_5_) |
Vec3d |
getPosOffset(double x,
double y,
double z,
double offset) |
AxisAlignedBB |
getRenderBoundingBox()
Gets the bounding box of this Entity, adjusted to take auxiliary entities into account (e.g.
|
int |
getRollingAmplitude()
Gets the rolling amplitude the cart rolls while being attacked.
|
int |
getRollingDirection()
Gets the rolling direction the cart rolls while being attacked.
|
double |
getSlopeAdjustment() |
abstract EntityMinecart.Type |
getType() |
boolean |
hasDisplayTile() |
boolean |
isPoweredCart()
Returns true if this cart is self propelled.
|
void |
killMinecart(DamageSource source) |
protected void |
moveAlongTrack(BlockPos pos,
IBlockState state) |
protected void |
moveDerailedMinecart()
Moves a minecart that is not attached to a rail
|
void |
moveMinecartOnRail(BlockPos pos)
Moved to allow overrides.
|
void |
onActivatorRailPass(int x,
int y,
int z,
boolean receivingPower)
Called every tick the minecart is on an activator rail.
|
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
performHurtAnimation()
Setups the entity to do the hurt animation.
|
protected void |
readEntityFromNBT(NBTTagCompound compound)
(abstract) Protected helper method to read subclass entity data from NBT.
|
static void |
registerFixesMinecart(DataFixer fixer,
java.lang.Class<?> name) |
void |
setCanUseRail(boolean use)
Set whether the minecart can use rails.
|
static void |
setCollisionHandler(IMinecartCollisionHandler handler)
Sets the global Minecart Collision handler, overwrites any
that is currently set.
|
void |
setCurrentCartSpeedCapOnRail(float value) |
void |
setDamage(float damage)
Sets the current amount of damage the minecart has taken.
|
void |
setDisplayTile(IBlockState displayTile) |
void |
setDisplayTileOffset(int displayTileOffset) |
void |
setDragAir(double value) |
void |
setHasDisplayTile(boolean showBlock) |
void |
setMaxSpeedAirLateral(float value) |
void |
setMaxSpeedAirVertical(float value) |
void |
setPosition(double x,
double y,
double z)
Sets the x,y,z of the entity from the given parameters.
|
void |
setPositionAndRotationDirect(double x,
double y,
double z,
float yaw,
float pitch,
int posRotationIncrements,
boolean teleport)
Set the position and rotation values directly without any clamping.
|
void |
setRollingAmplitude(int rollingAmplitude)
Sets the rolling amplitude the cart rolls while being attacked.
|
void |
setRollingDirection(int rollingDirection)
Sets the rolling direction the cart rolls while being attacked.
|
void |
setVelocity(double x,
double y,
double z)
Updates the velocity of the entity to a new value.
|
boolean |
shouldDoRailFunctions()
Return false if this cart should not call onMinecartPass() and should ignore Powered Rails.
|
protected void |
writeEntityToNBT(NBTTagCompound compound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addEntityCrashInfo, addPassenger, addTag, addToPlayerScore, addTrackingPlayer, addVelocity, applyEnchantments, applyOrientationToEntity, applyPlayerInteraction, canBeAttackedWithItem, canBeRidden, canFitPassenger, canPassengerSteer, canRenderOnFire, canRiderInteract, canTrample, canUseCommand, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, dismountRidingEntity, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fall, getAir, getAlwaysRenderNameTag, getAlwaysRenderNameTagForRender, getArmorInventoryList, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCapability, getCollisionBorderSize, getCommandSenderEntity, getCommandStats, getControllingPassenger, getCustomNameTag, getDataManager, getDisplayName, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getEyeHeight, getFireImmuneTicks, getFlag, getForward, getHeldEquipment, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, getLook, getLookVec, getLowestRidingEntity, getMaxFallHeight, getMaxInPortalTime, getMirroredYaw, getName, getParts, getPassengers, getPersistentID, getPickedResult, getPitchYaw, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getPushReaction, getRecursivePassengers, getRecursivePassengersByType, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getRotationYawHead, getServer, getSoundCategory, getSplashSound, getSwimSound, getTags, getTeam, getTeleportDirection, getUniqueID, getVectorForRotation, getYOffset, handleStatusUpdate, handleWaterMovement, hasCapability, hasCustomName, hashCode, hasNoGravity, hitByEntity, ignoreItemEntityData, isBeingRidden, isBurning, isCreatureType, isEntityAlive, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isPassenger, isPushedByWater, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, kill, move, moveRelative, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, notifyDataManagerChange, onCollideWithPlayer, onEntityUpdate, onKillCommand, onKillEntity, onStruckByLightning, playSound, playStepSound, preparePlayerToSpawn, processInitialInteract, pushOutOfBlocks, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, replaceItemInInventory, resetEntityId, resetHeight, resetPositionToBB, sendCommandFeedback, sendMessage, serializeNBT, setAir, setAlwaysRenderNameTag, setBeenAttacked, setCommandStat, setCommandStats, setCustomNameTag, setDead, setDropItemsWhenDead, setEntityBoundingBox, setEntityId, setEntityInvulnerable, setFire, setFlag, setGlowing, setInvisible, setInWeb, setItemStackToSlot, setLocationAndAngles, setNoGravity, setOnFireFromLava, setOutsideBorder, setPortal, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRenderDistanceWeight, setRenderYawOffset, setRotation, setRotationYawHead, setSilent, setSize, setSneaking, setSprinting, setUniqueId, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, startRiding, toString, turn, updateFallState, updatePassenger, updateRidden, verifyExplosion, writeToNBT, writeToNBTAtomically, writeToNBTOptional
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDisplayName, getName, hasCustomName
public static float defaultMaxSpeedAirLateral
public static float defaultMaxSpeedAirVertical
public static double defaultDragAir
protected boolean canUseRail
protected boolean canBePushed
protected float maxSpeedAirLateral
protected float maxSpeedAirVertical
protected double dragAir
public EntityMinecart(World worldIn)
public EntityMinecart(World worldIn, double x, double y, double z)
public static EntityMinecart create(World worldIn, double x, double y, double z, EntityMinecart.Type typeIn)
protected boolean canTriggerWalking()
canTriggerWalking
in class Entity
protected void entityInit()
entityInit
in class Entity
public AxisAlignedBB getCollisionBox(Entity entityIn)
getCollisionBox
in class Entity
public AxisAlignedBB getCollisionBoundingBox()
getCollisionBoundingBox
in class Entity
public boolean canBePushed()
canBePushed
in class Entity
public double getMountedYOffset()
getMountedYOffset
in class Entity
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class Entity
public void killMinecart(DamageSource source)
public void performHurtAnimation()
performHurtAnimation
in class Entity
public boolean canBeCollidedWith()
canBeCollidedWith
in class Entity
public EnumFacing getAdjustedHorizontalFacing()
getAdjustedHorizontalFacing
in class Entity
public void onUpdate()
protected double getMaximumSpeed()
public void onActivatorRailPass(int x, int y, int z, boolean receivingPower)
protected void moveDerailedMinecart()
protected void moveAlongTrack(BlockPos pos, IBlockState state)
protected void applyDrag()
public void setPosition(double x, double y, double z)
setPosition
in class Entity
public Vec3d getPosOffset(double x, double y, double z, double offset)
public Vec3d getPos(double p_70489_1_, double p_70489_3_, double p_70489_5_)
public AxisAlignedBB getRenderBoundingBox()
getRenderBoundingBox
in class Entity
public static void registerFixesMinecart(DataFixer fixer, java.lang.Class<?> name)
protected void readEntityFromNBT(NBTTagCompound compound)
readEntityFromNBT
in class Entity
protected void writeEntityToNBT(NBTTagCompound compound)
writeEntityToNBT
in class Entity
public void applyEntityCollision(Entity entityIn)
applyEntityCollision
in class Entity
public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport)
setPositionAndRotationDirect
in class Entity
public void setDamage(float damage)
public void setVelocity(double x, double y, double z)
setVelocity
in class Entity
public float getDamage()
public void setRollingAmplitude(int rollingAmplitude)
public int getRollingAmplitude()
public void setRollingDirection(int rollingDirection)
public int getRollingDirection()
public abstract EntityMinecart.Type getType()
public IBlockState getDisplayTile()
public IBlockState getDefaultDisplayTile()
public int getDisplayTileOffset()
public int getDefaultDisplayTileOffset()
public void setDisplayTile(IBlockState displayTile)
public void setDisplayTileOffset(int displayTileOffset)
public boolean hasDisplayTile()
public void setHasDisplayTile(boolean showBlock)
protected double getMaxSpeed()
public void moveMinecartOnRail(BlockPos pos)
public static IMinecartCollisionHandler getCollisionHandler()
public static void setCollisionHandler(IMinecartCollisionHandler handler)
handler
- The new handlerpublic ItemStack getCartItem()
public boolean canUseRail()
public void setCanUseRail(boolean use)
use
- Whether the minecart can currently use rails.public boolean shouldDoRailFunctions()
public boolean isPoweredCart()
public boolean canBeRidden()
public float getMaxCartSpeedOnRail()
public final float getCurrentCartSpeedCapOnRail()
public final void setCurrentCartSpeedCapOnRail(float value)
public float getMaxSpeedAirLateral()
public void setMaxSpeedAirLateral(float value)
public float getMaxSpeedAirVertical()
public void setMaxSpeedAirVertical(float value)
public double getDragAir()
public void setDragAir(double value)
public double getSlopeAdjustment()
public int getComparatorLevel()