Package net.minecraft.src
Class EntityMinecart
java.lang.Object
net.minecraft.src.Entity
net.minecraft.src.EntityMinecart
- Direct Known Subclasses:
EntityMinecartContainer,EntityMinecartEmpty,EntityMinecartFurnace,EntityMinecartMobSpawner,EntityMinecartTNT
-
Field Summary
FieldsFields inherited from class net.minecraft.src.Entity
addedToChunk, boundingBox, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastGroundPosX, lastGroundPosY, lastGroundPosZ, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, nextBlockCheckDistance, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize -
Constructor Summary
ConstructorsConstructorDescriptionEntityMinecart(World par1World) EntityMinecart(World par1World, double par2, double par4, double par6) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidapplyEntityCollision(Entity par1Entity) Applies a velocity to each of the entities pushing them away from each other.booleanattackEntityFrom(DamageSource par1DamageSource, float par2) Called when the entity is attacked.booleanReturns true if other Entities should be prevented from moving through this Entity.booleanReturns true if this entity should push and be pushed by other entities when colliding.booleancanCollideWithEntity(Entity entity) protected booleanreturns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to prevent them from trampling cropsstatic EntityMinecartcreateMinecart(World par0World, double par1, double par3, double par5, int par7) Creates a new minecart of the specified type in the specified location in the given world. par0World - world to create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for a standard empty minecartprotected voidfunc_70489_a(double par1, double par3, double par5) func_70495_a(double par1, double par3, double par5, double par7) protected voidfunc_94088_b(double par1) returns the bounding box for this entitygetCollisionBox(Entity par1Entity) Returns a boundingBox used to collide the entity with other entities and blocks.floatGets the current amount of damage the minecart has taken.intintintintGets the username of the entity.abstract intdoubleReturns the Y offset from the entity's position for any entity riding this one.intGets the rolling amplitude the cart rolls while being attacked.intGets the rolling direction the cart rolls while being attacked.floatbooleanbooleanIf this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language.voidkillMinecart(DamageSource par1DamageSource) voidonActivatorRailPass(int par1, int par2, int par3, boolean par4) Called every tick the minecart is on an activator rail.booleanonBlockDispenserConsume(BlockDispenserBlock blockDispenser, BlockDispenserTileEntity tileEentityDispenser) Called when block dispenser tries to eat this entity, return true if the Dispenser should stop looking for more stuff to consumevoidonUpdate()Called to update the entity's position/logic.voidSetups the entity to do the hurt animation.protected voidreadEntityFromNBT(NBTTagCompound par1NBTTagCompound) (abstract) Protected helper method to read subclass entity data from NBT.voidsetDamage(float par1) Sets the current amount of damage the minecart has taken.voidsetDead()Will get destroyed next tick.voidsetDisplayTile(int par1) voidsetDisplayTileData(int par1) voidsetDisplayTileOffset(int par1) voidsetHasDisplayTile(boolean par1) voidsetMinecartName(String par1Str) Sets the minecart's name.voidsetPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) Sets the position and rotation.voidsetRollingAmplitude(int par1) Sets the rolling amplitude the cart rolls while being attacked.voidsetRollingDirection(int par1) Sets the rolling direction the cart rolls while being attacked.voidsetVelocity(double par1, double par3, double par5) Sets the velocity to the args.protected voidupdateOnTrack(int par1, int par2, int par3, double par4, double par6, int par8, int par9) protected voidwriteEntityToNBT(NBTTagCompound par1NBTTagCompound) (abstract) Protected helper method to write subclass entity data to NBT.Methods inherited from class net.minecraft.src.Entity
addComponent, addEntityCrashInfo, addToPlayerScore, addVelocity, appliesConstantForceWhenRidingBoat, attractsLightning, canAttackWithItem, canEntityTriggerTripwire, canRenderOnFire, copyDataFrom, copyLocationAndAnglesFrom, dealFireDamage, doBlockCollisions, doesEntityApplyToSpawnCap, doesEntityApplyToSquidPossessionCap, doesEntityNotTriggerPressurePlate, doesNotDismountInWater, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fall, flagAllWatchedObjectsDirty, flingAwayFromEntity, getAir, getAnimalKickMovementMultiplier, getBlockExplosionResistance, getBrightness, getBrightnessForRender, getCanBeHeadCrabbed, getCollisionBorderSize, getComponent, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityString, getEyeHeight, getFlag, getHeadCrabSharedAttackTarget, getLastActiveItems, getLookVec, getMaxInPortalTime, getMaxSafePointTries, getParts, getPortalCooldown, getRotationYawHead, getTeleportDirection, getTranslatedEntityName, getUniqueID, getVisualBoundingBox, getXZDistanceSqToEntity, getYOffset, handleHealthUpdate, handleLavaMovement, handleWaterMovement, hasComponent, hashCode, hasHeadCrabbedSquid, hitByEntity, initComponents, interactFirst, isAffectedByMovementModifiers, isBeingRainedOn, isBurning, isEating, isEntityAlive, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInsideOpaqueBlock, isEntityInsideSuffocatingBlock, isEntityInsideSuffocatingBlock, isEntityInvulnerable, isImmuneToFire, isImmuneToHeadCrabDamage, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isItemEntity, isOffsetPositionInLiquid, isPushedByWater, isRiding, isSecondaryTargetForSquid, isSneaking, isSprinting, isUsingSpecialKey, isValidOngoingAttackTargetForSquid, isValidZombieSecondaryTarget, isWet, kill, mountEntity, mountEntityRemote, moveEntity, moveFlying, movementModifierWhenRidingBoat, newDoubleNBTList, newFloatNBTList, notifyOfWolfHowl, onChunkLoad, onCollideWithPlayer, onEntityUpdate, onFlungBySquidTentacle, onHeadCrabbedBySquid, onKickedByAnimal, onKillEntity, onPossessedRidingEntityDeath, onStruckByLightning, outOfUpdateRangeUpdate, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, readFromNBT, setAir, setAngles, setBeenAttacked, setCurrentItemOrArmor, setEating, setFire, setFlag, setInPortal, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setPosition, setPositionAndRotation, setRotation, setRotationYawHead, setSize, setSneaking, setSprinting, setWorld, shouldExplodeBlock, shouldSetPosAfterLoading, shouldSetPositionOnLoad, toString, travelToDimension, tryToSetFireToBlocksInContact, updateCloak, updateFallState, updateRidden, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional
-
Field Details
-
minecartItemToDrop
-
-
Constructor Details
-
EntityMinecart
-
EntityMinecart
-
-
Method Details
-
createMinecart
public static EntityMinecart createMinecart(World par0World, double par1, double par3, double par5, int par7) Creates a new minecart of the specified type in the specified location in the given world. par0World - world to create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for a standard empty minecart -
canTriggerWalking
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- Overrides:
canTriggerWalkingin classEntity
-
entityInit
protected void entityInit()- Specified by:
entityInitin classEntity
-
getCollisionBox
Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be pushable on contact, like boats or minecarts.- Overrides:
getCollisionBoxin classEntity
-
getBoundingBox
returns the bounding box for this entity- Overrides:
getBoundingBoxin classEntity
-
canBePushed
public boolean canBePushed()Returns true if this entity should push and be pushed by other entities when colliding.- Overrides:
canBePushedin classEntity
-
getMountedYOffset
public double getMountedYOffset()Returns the Y offset from the entity's position for any entity riding this one.- Overrides:
getMountedYOffsetin classEntity
-
attackEntityFrom
Called when the entity is attacked.- Overrides:
attackEntityFromin classEntity
-
killMinecart
-
performHurtAnimation
public void performHurtAnimation()Setups the entity to do the hurt animation. Only used by packets in multiplayer.- Overrides:
performHurtAnimationin classEntity
-
canBeCollidedWith
public boolean canBeCollidedWith()Returns true if other Entities should be prevented from moving through this Entity.- Overrides:
canBeCollidedWithin classEntity
-
setDead
public void setDead()Will get destroyed next tick. -
onUpdate
public void onUpdate()Called to update the entity's position/logic. -
onActivatorRailPass
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) Called every tick the minecart is on an activator rail. -
func_94088_b
protected void func_94088_b(double par1) -
updateOnTrack
protected void updateOnTrack(int par1, int par2, int par3, double par4, double par6, int par8, int par9) -
applyDrag
protected void applyDrag() -
func_70495_a
-
func_70489_a
-
readEntityFromNBT
(abstract) Protected helper method to read subclass entity data from NBT.- Specified by:
readEntityFromNBTin classEntity
-
writeEntityToNBT
(abstract) Protected helper method to write subclass entity data to NBT.- Specified by:
writeEntityToNBTin classEntity
-
getShadowSize
public float getShadowSize()- Overrides:
getShadowSizein classEntity
-
applyEntityCollision
Applies a velocity to each of the entities pushing them away from each other. Args: entity- Overrides:
applyEntityCollisionin classEntity
-
setPositionAndRotation2
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, posZ, yaw, pitch- Overrides:
setPositionAndRotation2in classEntity
-
setVelocity
public void setVelocity(double par1, double par3, double par5) Sets the velocity to the args. Args: x, y, z- Overrides:
setVelocityin classEntity
-
setDamage
public void setDamage(float par1) Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over 40. -
getDamage
public float getDamage()Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over 40. -
setRollingAmplitude
public void setRollingAmplitude(int par1) Sets the rolling amplitude the cart rolls while being attacked. -
getRollingAmplitude
public int getRollingAmplitude()Gets the rolling amplitude the cart rolls while being attacked. -
setRollingDirection
public void setRollingDirection(int par1) Sets the rolling direction the cart rolls while being attacked. Can be 1 or -1. -
getRollingDirection
public int getRollingDirection()Gets the rolling direction the cart rolls while being attacked. Can be 1 or -1. -
getMinecartType
public abstract int getMinecartType() -
getDisplayTile
-
getDefaultDisplayTile
-
getDisplayTileData
public int getDisplayTileData() -
getDefaultDisplayTileData
public int getDefaultDisplayTileData() -
getDisplayTileOffset
public int getDisplayTileOffset() -
getDefaultDisplayTileOffset
public int getDefaultDisplayTileOffset() -
setDisplayTile
public void setDisplayTile(int par1) -
setDisplayTileData
public void setDisplayTileData(int par1) -
setDisplayTileOffset
public void setDisplayTileOffset(int par1) -
hasDisplayTile
public boolean hasDisplayTile() -
setHasDisplayTile
public void setHasDisplayTile(boolean par1) -
setMinecartName
Sets the minecart's name. -
getEntityName
Gets the username of the entity.- Overrides:
getEntityNamein classEntity
-
isInvNameLocalized
public boolean isInvNameLocalized()If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language. Otherwise it will be used directly. -
func_95999_t
-
canCollideWithEntity
- Overrides:
canCollideWithEntityin classEntity
-
onBlockDispenserConsume
public boolean onBlockDispenserConsume(BlockDispenserBlock blockDispenser, BlockDispenserTileEntity tileEentityDispenser) Description copied from class:EntityCalled when block dispenser tries to eat this entity, return true if the Dispenser should stop looking for more stuff to consume- Overrides:
onBlockDispenserConsumein classEntity
-