public abstract class EntityMinecart extends Entity implements IWorldNameable
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityMinecart.EnumMinecartType |
| 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, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, extendedProperties, fallDistance, field_181016_an, field_181017_ao, field_181018_ap, fireResistance, firstUpdate, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj| 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 each of the entities pushing them away from each other.
|
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. used for spiders and wolves to
prevent them from trampling crops
|
boolean |
canUseRail()
Returns true if this cart can currently use rails.
|
protected void |
entityInit() |
void |
func_174899_a(IBlockState p_174899_1_) |
static EntityMinecart |
func_180458_a(World worldIn,
double p_180458_1_,
double p_180458_3_,
double p_180458_5_,
EntityMinecart.EnumMinecartType p_180458_7_) |
protected void |
func_180460_a(BlockPos p_180460_1_,
IBlockState p_180460_2_) |
Vec3 |
func_70489_a(double p_70489_1_,
double p_70489_3_,
double p_70489_5_) |
Vec3 |
func_70495_a(double p_70495_1_,
double p_70495_3_,
double p_70495_5_,
double p_70495_7_) |
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
|
float |
getCurrentCartSpeedCapOnRail()
Returns the current speed cap for the cart when traveling on rails.
|
java.lang.String |
getCustomNameTag() |
float |
getDamage()
Gets the current amount of damage the minecart has taken.
|
IBlockState |
getDefaultDisplayTile() |
int |
getDefaultDisplayTileOffset() |
IChatComponent |
getDisplayName()
Get the formatted ChatComponent that will be used for the sender's username in chat
|
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() |
abstract EntityMinecart.EnumMinecartType |
getMinecartType() |
double |
getMountedYOffset()
Returns the Y offset from the entity's position for any entity riding this one.
|
java.lang.String |
getName()
Get the name of this object.
|
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() |
boolean |
hasCustomName()
Returns true if this thing is named
|
boolean |
hasDisplayTile() |
boolean |
isPoweredCart()
Returns true if this cart is self propelled.
|
void |
killMinecart(DamageSource p_94095_1_) |
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 tagCompund)
(abstract) Protected helper method to read subclass entity data from NBT.
|
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 |
setCustomNameTag(java.lang.String name)
Sets the custom name tag for this entity
|
void |
setDamage(float p_70492_1_)
Sets the current amount of damage the minecart has taken.
|
void |
setDead()
Will get destroyed next tick.
|
void |
setDisplayTileOffset(int p_94086_1_) |
void |
setDragAir(double value) |
void |
setHasDisplayTile(boolean p_94096_1_) |
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 |
setPositionAndRotation2(double x,
double y,
double z,
float yaw,
float pitch,
int posRotationIncrements,
boolean p_180426_10_) |
void |
setRollingAmplitude(int p_70497_1_)
Sets the rolling amplitude the cart rolls while being attacked.
|
void |
setRollingDirection(int p_70494_1_)
Sets the rolling direction the cart rolls while being attacked.
|
void |
setVelocity(double x,
double y,
double z)
Sets the velocity to the args.
|
boolean |
shouldDoRailFunctions()
Return false if this cart should not call onMinecartPass() and should ignore Powered Rails.
|
protected void |
writeEntityToNBT(NBTTagCompound tagCompound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addChatMessage, addEntityCrashInfo, addToPlayerScore, addVelocity, applyEnchantments, canAttackWithItem, canCommandSenderUseCommand, canRenderOnFire, canRiderInteract, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fall, func_174817_o, func_181012_aH, func_181013_g, func_181014_aG, getAir, getAlwaysRenderNameTag, getAlwaysRenderNameTagForRender, getBrightness, getBrightnessForRender, getCapability, getCollisionBorderSize, getCommandSenderEntity, getCommandStats, getDataWatcher, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getExtendedProperties, getEyeHeight, getFlag, getHorizontalFacing, getHoverEvent, getInventory, getLook, getLookVec, getMaxFallHeight, getMaxInPortalTime, getNBTTagCompound, getParts, getPersistentID, getPickedResult, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getRotationYawHead, getSplashSound, getSwimSound, getUniqueID, getVectorForRotation, getYOffset, handleStatusUpdate, handleWaterMovement, hasCapability, hashCode, hitByEntity, interactAt, interactFirst, isBurning, isCreatureType, isEating, isEntityAlive, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isPushedByWater, isRiding, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, kill, mountEntity, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onEntityUpdate, onKillCommand, onKillEntity, onStruckByLightning, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, registerExtendedProperties, replaceItemInInventory, resetEntityId, resetHeight, sendCommandFeedback, serializeNBT, setAir, setAlwaysRenderNameTag, setAngles, setBeenAttacked, setCommandStat, setCurrentItemOrArmor, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPortal, setPositionAndRotation, setPositionAndUpdate, setRotation, setRotationYawHead, setSilent, setSize, setSneaking, setSprinting, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, toString, travelToDimension, updateFallState, updateRidden, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptionalpublic 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 func_180458_a(World worldIn, double p_180458_1_, double p_180458_3_, double p_180458_5_, EntityMinecart.EnumMinecartType p_180458_7_)
protected boolean canTriggerWalking()
canTriggerWalking in class Entityprotected void entityInit()
entityInit in class Entitypublic AxisAlignedBB getCollisionBox(Entity entityIn)
getCollisionBox in class Entitypublic AxisAlignedBB getCollisionBoundingBox()
getCollisionBoundingBox in class Entitypublic boolean canBePushed()
canBePushed in class Entitypublic double getMountedYOffset()
getMountedYOffset in class Entitypublic boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom in class Entitypublic void killMinecart(DamageSource p_94095_1_)
public void performHurtAnimation()
performHurtAnimation in class Entitypublic boolean canBeCollidedWith()
canBeCollidedWith in class Entitypublic void onUpdate()
protected double getMaximumSpeed()
public void onActivatorRailPass(int x,
int y,
int z,
boolean receivingPower)
protected void moveDerailedMinecart()
protected void func_180460_a(BlockPos p_180460_1_, IBlockState p_180460_2_)
protected void applyDrag()
public void setPosition(double x,
double y,
double z)
setPosition in class Entitypublic Vec3 func_70495_a(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_)
public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
readEntityFromNBT in class Entityprotected void writeEntityToNBT(NBTTagCompound tagCompound)
writeEntityToNBT in class Entitypublic void applyEntityCollision(Entity entityIn)
applyEntityCollision in class Entitypublic void setPositionAndRotation2(double x,
double y,
double z,
float yaw,
float pitch,
int posRotationIncrements,
boolean p_180426_10_)
setPositionAndRotation2 in class Entitypublic void setDamage(float p_70492_1_)
public void setVelocity(double x,
double y,
double z)
setVelocity in class Entitypublic float getDamage()
public void setRollingAmplitude(int p_70497_1_)
public int getRollingAmplitude()
public void setRollingDirection(int p_70494_1_)
public int getRollingDirection()
public abstract EntityMinecart.EnumMinecartType getMinecartType()
public IBlockState getDisplayTile()
public IBlockState getDefaultDisplayTile()
public int getDisplayTileOffset()
public int getDefaultDisplayTileOffset()
public void func_174899_a(IBlockState p_174899_1_)
public void setDisplayTileOffset(int p_94086_1_)
public boolean hasDisplayTile()
public void setHasDisplayTile(boolean p_94096_1_)
public void setCustomNameTag(java.lang.String name)
setCustomNameTag in class Entitypublic java.lang.String getName()
getName in interface ICommandSendergetName in interface IWorldNameablegetName in class Entitypublic boolean hasCustomName()
hasCustomName in interface IWorldNameablehasCustomName in class Entitypublic java.lang.String getCustomNameTag()
getCustomNameTag in class Entitypublic IChatComponent getDisplayName()
getDisplayName in interface ICommandSendergetDisplayName in interface IWorldNameablegetDisplayName in class Entityprotected 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()