public class EntityPlayerSP extends AbstractClientPlayer
EntityPlayer.EnumChatVisibility, EntityPlayer.EnumStatus
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
clientBrand |
private boolean |
hasValidHealth |
private float |
horseJumpPower |
private int |
horseJumpPowerCounter |
private float |
lastReportedPitch
The last pitch value which was transmitted to the server, used to determine when the pitch changes and needs to
be re-transmitted
|
private double |
lastReportedPosX
The last X position which was transmitted to the server, used to determine when the X position changes and needs
to be re-trasmitted
|
private double |
lastReportedPosY
The last Y position which was transmitted to the server, used to determine when the Y position changes and needs
to be re-transmitted
|
private double |
lastReportedPosZ
The last Z position which was transmitted to the server, used to determine when the Z position changes and needs
to be re-transmitted
|
private float |
lastReportedYaw
The last yaw value which was transmitted to the server, used to determine when the yaw changes and needs to be
re-transmitted
|
protected Minecraft |
mc |
MovementInput |
movementInput |
private int |
positionUpdateTicks
Reset to 0 every time position is sent to the server, used to send periodic updates every 20 ticks even when the
player is not moving.
|
float |
prevRenderArmPitch |
float |
prevRenderArmYaw |
float |
prevTimeInPortal
The amount of time an entity has been in a Portal the previous tick
|
float |
renderArmPitch |
float |
renderArmYaw |
NetHandlerPlayClient |
sendQueue |
private boolean |
serverSneakState
the last sneaking state sent to the server
|
private boolean |
serverSprintState
the last sprinting state sent to the server
|
int |
sprintingTicksLeft
Ticks left before sprinting is disabled.
|
protected int |
sprintToggleTimer
Used to tell if the player pressed forward twice.
|
private StatFileWriter |
statWriter |
float |
timeInPortal
The amount of time an entity has been in a Portal
|
cameraYaw, capabilities, chasingPosX, chasingPosY, chasingPosZ, experience, experienceLevel, experienceTotal, fishEntity, flyToggleTimer, foodStats, inventory, inventoryContainer, openContainer, playerLocation, prevCameraYaw, prevChasingPosX, prevChasingPosY, prevChasingPosZ, renderOffsetX, renderOffsetY, renderOffsetZ, sleeping, speedInAir, speedOnGround, xpCooldown
arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, field_70741_aB, field_70769_ao, field_70770_ap, hurtTime, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingProgress, swingProgressInt
addedToChunk, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, 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 |
---|
EntityPlayerSP(Minecraft mcIn,
World worldIn,
NetHandlerPlayClient netHandler,
StatFileWriter statFile) |
Modifier and Type | Method and Description |
---|---|
void |
addChatComponentMessage(IChatComponent chatComponent) |
void |
addChatMessage(IChatComponent component)
Send a chat message to the CommandSender
|
void |
addStat(StatBase stat,
int amount)
Adds a value to a statistic field.
|
boolean |
attackEntityFrom(DamageSource source,
float amount)
Called when the entity is attacked.
|
boolean |
canCommandSenderUseCommand(int permLevel,
java.lang.String commandName)
Returns
true if the CommandSender is allowed to execute the command, false if not |
void |
closeScreen()
set current crafting inventory back to the 2x2 square
|
void |
closeScreenAndDropStack() |
protected void |
damageEntity(DamageSource damageSrc,
float damageAmount)
Deals damage to the entity.
|
void |
displayGui(IInteractionObject guiOwner) |
void |
displayGUIBook(ItemStack bookStack)
Displays the GUI for interacting with a book.
|
void |
displayGUIChest(IInventory chestInventory)
Displays the GUI for interacting with a chest inventory.
|
void |
displayGUIHorse(EntityHorse horse,
IInventory horseInventory) |
void |
displayVillagerTradeGui(IMerchant villager) |
EntityItem |
dropOneItem(boolean dropAll)
Called when player presses the drop item key
|
java.lang.String |
getClientBrand() |
float |
getHorseJumpPower() |
BlockPos |
getPosition()
Get the position in the world.
|
StatFileWriter |
getStatFileWriter() |
void |
heal(float healAmount)
Heal living entity (param: amount of half-hearts)
|
protected boolean |
isCurrentViewEntity() |
private boolean |
isOpenBlockSpace(BlockPos pos)
Returns true if the block at the given BlockPos and the block above it are NOT full cubes.
|
boolean |
isRidingHorse() |
boolean |
isServerWorld()
Returns whether the entity is in a server world
|
boolean |
isSneaking()
Returns if this entity is sneaking.
|
boolean |
isUser()
returns true if this is an EntityPlayerSP, or the logged in player.
|
protected void |
joinEntityItemWithWorld(EntityItem itemIn)
Joins the passed in entity item with the world.
|
void |
mountEntity(Entity entityIn)
Called when a player mounts an entity.
|
void |
onCriticalHit(Entity entityHit)
Called when the player performs a critical hit on the Entity.
|
void |
onEnchantmentCritical(Entity entityHit) |
void |
onLivingUpdate()
Called frequently so the entity can update its state every tick as required.
|
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
onUpdateWalkingPlayer()
called every tick when the player is on foot.
|
void |
openEditCommandBlock(CommandBlockLogic cmdBlockLogic) |
void |
openEditSign(TileEntitySign signTile) |
void |
playSound(java.lang.String name,
float volume,
float pitch) |
protected boolean |
pushOutOfBlocks(double x,
double y,
double z) |
void |
respawnPlayer() |
void |
sendChatMessage(java.lang.String message)
Sends a chat message from the player.
|
void |
sendHorseInventory() |
protected void |
sendHorseJump() |
void |
sendPlayerAbilities()
Sends the player's abilities to the server (if there is one).
|
void |
setClientBrand(java.lang.String brand) |
void |
setPlayerSPHealth(float health)
Updates health locally.
|
void |
setSprinting(boolean sprinting)
Set sprinting switch for Entity.
|
void |
setXPStats(float currentXP,
int maxXP,
int level)
Sets the current XP, total XP, and level number.
|
void |
swingItem()
Swings the item the player is holding.
|
void |
updateEntityActionState() |
getDownloadImageSkin, getFovModifier, getLocationCape, getLocationSkin, getLocationSkin, getPlayerInfo, getSkinType, hasPlayerInfo, hasSkin, isSpectator
addExhaustion, addExperience, addExperienceLevel, addMovementStat, addScore, addToPlayerScore, applyEntityAttributes, attackTargetEntityWithCurrentItem, canAttackPlayer, canEat, canHarvestBlock, canOpen, canPlayerEdit, canTriggerWalking, clearItemInUse, clonePlayer, damageArmor, destroyCurrentEquippedItem, dropItem, dropPlayerItemWithRandomChoice, entityInit, fall, func_175145_a, getAbsorptionAmount, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArmorVisibility, getBedLocation, getBedOrientationInDegrees, getBedSpawnLocation, getCurrentArmor, getCurrentEquippedItem, getDeathSound, getDisplayName, getEquipmentInSlot, getExperiencePoints, getEyeHeight, getFallSoundString, getFoodStats, getGameProfile, getHeldItem, getHurtSound, getInventory, getInventoryEnderChest, getItemInUse, getItemInUseCount, getItemInUseDuration, getMaxInPortalTime, getName, getOfflineUUID, getPortalCooldown, getScore, getSleepTimer, getSplashSound, getSwimSound, getTeam, getToolDigEfficiency, getTotalArmorValue, getUUID, getWorldScoreboard, getXPSeed, getYOffset, handleStatusUpdate, hasReducedDebug, interactWith, isAllowEdit, isBlocking, isEntityInsideOpaqueBlock, isInvisibleToPlayer, isMovementBlocked, isPlayer, isPlayerFullyAsleep, isPlayerSleeping, isPushedByWater, isSpawnForced, isUsingItem, isWearing, jump, moveEntityWithHeading, onDeath, onItemUseFinish, onKillEntity, preparePlayerToSpawn, readEntityFromNBT, removeExperienceLevel, replaceItemInInventory, resetHeight, sendCommandFeedback, setAbsorptionAmount, setCurrentItemOrArmor, setDead, setGameType, setInWeb, setItemInUse, setReducedDebug, setScore, setSpawnPoint, shouldHeal, stopUsingItem, triggerAchievement, trySleep, updateItemUse, updateRidden, wakeUpPlayer, writeEntityToNBT, xpBarCap
addPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, decreaseAirSupply, dismountEntity, dropEquipment, dropFewItems, func_110146_f, func_181013_g, func_94060_bK, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getArrowCountInEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getEntityAttribute, getHealth, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, handleJumpLava, isChild, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, kill, knockBack, markPotionsDirty, onChangedPotionEffect, onDeathUpdate, onEntityUpdate, onFinishedPotionEffect, onItemPickup, onKillCommand, onNewPotionEffect, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRevengeTarget, setRotationYawHead, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata
addEntityCrashInfo, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canRenderOnFire, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, func_174817_o, func_181012_aH, func_181014_aG, func_181015_d, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getCustomNameTag, getDataWatcher, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getFlag, getHorizontalFacing, getHoverEvent, getMaxFallHeight, getMountedYOffset, getNBTTagCompound, getParts, getPositionEyes, getPositionVector, getUniqueID, getVectorForRotation, handleWaterMovement, hasCustomName, hashCode, hitByEntity, interactAt, interactFirst, isBurning, isEating, isEntityEqual, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isRiding, isSilent, isSpectatedByPlayer, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onStruckByLightning, playStepSound, rayTrace, readFromNBT, setAir, setAlwaysRenderNameTag, setAngles, setCommandStat, setCustomNameTag, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldSetPosAfterLoading, spawnRunningParticles, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional
public final NetHandlerPlayClient sendQueue
private final StatFileWriter statWriter
private double lastReportedPosX
private double lastReportedPosY
private double lastReportedPosZ
private float lastReportedYaw
private float lastReportedPitch
private boolean serverSneakState
private boolean serverSprintState
private int positionUpdateTicks
private boolean hasValidHealth
private java.lang.String clientBrand
public MovementInput movementInput
protected Minecraft mc
protected int sprintToggleTimer
public int sprintingTicksLeft
public float renderArmYaw
public float renderArmPitch
public float prevRenderArmYaw
public float prevRenderArmPitch
private int horseJumpPowerCounter
private float horseJumpPower
public float timeInPortal
public float prevTimeInPortal
public EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statFile)
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class EntityPlayer
public void heal(float healAmount)
heal
in class EntityLivingBase
public void mountEntity(Entity entityIn)
mountEntity
in class EntityLivingBase
public void onUpdate()
onUpdate
in class EntityPlayer
public void onUpdateWalkingPlayer()
public EntityItem dropOneItem(boolean dropAll)
dropOneItem
in class EntityPlayer
protected void joinEntityItemWithWorld(EntityItem itemIn)
joinEntityItemWithWorld
in class EntityPlayer
public void sendChatMessage(java.lang.String message)
public void swingItem()
swingItem
in class EntityLivingBase
public void respawnPlayer()
respawnPlayer
in class EntityPlayer
protected void damageEntity(DamageSource damageSrc, float damageAmount)
damageEntity
in class EntityPlayer
public void closeScreen()
closeScreen
in class EntityPlayer
public void closeScreenAndDropStack()
public void setPlayerSPHealth(float health)
public void addStat(StatBase stat, int amount)
addStat
in class EntityPlayer
public void sendPlayerAbilities()
sendPlayerAbilities
in class EntityPlayer
public boolean isUser()
isUser
in class EntityPlayer
protected void sendHorseJump()
public void sendHorseInventory()
public void setClientBrand(java.lang.String brand)
public java.lang.String getClientBrand()
public StatFileWriter getStatFileWriter()
public void addChatComponentMessage(IChatComponent chatComponent)
addChatComponentMessage
in class EntityPlayer
protected boolean pushOutOfBlocks(double x, double y, double z)
pushOutOfBlocks
in class Entity
private boolean isOpenBlockSpace(BlockPos pos)
public void setSprinting(boolean sprinting)
setSprinting
in class EntityLivingBase
public void setXPStats(float currentXP, int maxXP, int level)
public void addChatMessage(IChatComponent component)
addChatMessage
in interface ICommandSender
addChatMessage
in class Entity
public boolean canCommandSenderUseCommand(int permLevel, java.lang.String commandName)
true
if the CommandSender is allowed to execute the command, false
if notcanCommandSenderUseCommand
in interface ICommandSender
canCommandSenderUseCommand
in class Entity
public BlockPos getPosition()
null
is not allowed! If you are not an entity in the world, return
the coordinates 0, 0, 0getPosition
in interface ICommandSender
getPosition
in class Entity
public void playSound(java.lang.String name, float volume, float pitch)
playSound
in class EntityPlayer
public boolean isServerWorld()
isServerWorld
in class EntityLivingBase
public boolean isRidingHorse()
public float getHorseJumpPower()
public void openEditSign(TileEntitySign signTile)
openEditSign
in class EntityPlayer
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
openEditCommandBlock
in class EntityPlayer
public void displayGUIBook(ItemStack bookStack)
displayGUIBook
in class EntityPlayer
public void displayGUIChest(IInventory chestInventory)
displayGUIChest
in class EntityPlayer
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
displayGUIHorse
in class EntityPlayer
public void displayGui(IInteractionObject guiOwner)
displayGui
in class EntityPlayer
public void displayVillagerTradeGui(IMerchant villager)
displayVillagerTradeGui
in class EntityPlayer
public void onCriticalHit(Entity entityHit)
onCriticalHit
in class EntityPlayer
public void onEnchantmentCritical(Entity entityHit)
onEnchantmentCritical
in class EntityPlayer
public boolean isSneaking()
isSneaking
in class Entity
public void updateEntityActionState()
updateEntityActionState
in class EntityPlayer
protected boolean isCurrentViewEntity()
public void onLivingUpdate()
onLivingUpdate
in class EntityPlayer