Package net.minecraft.client.entity
Class EntityPlayerSP
- java.lang.Object
-
- All Implemented Interfaces:
ICommandSender
,org.teavm.jso.JSObject
public class EntityPlayerSP extends AbstractClientPlayer
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.entity.player.EntityPlayer
EntityPlayer.EnumChatVisibility, EntityPlayer.EnumStatus
-
Nested classes/interfaces inherited from class net.zxmushroom63.plugins.BaseData
BaseData.BooleanCallback, BaseData.BooleanCallbackArr, BaseData.DataBooleanCallback, BaseData.DataBooleanCallbackArr, BaseData.DataDoubleCallback, BaseData.DataDoubleCallbackArr, BaseData.DataFloatCallback, BaseData.DataFloatCallbackArr, BaseData.DataIntCallback, BaseData.DataIntCallbackArr, BaseData.DataObjectCallback, BaseData.DataObjectCallbackArr, BaseData.DataStringCallback, BaseData.DataStringCallbackArr, BaseData.DataVoidCallback, BaseData.DoubleCallback, BaseData.DoubleCallbackArr, BaseData.FloatCallback, BaseData.FloatCallbackArr, BaseData.IntCallback, BaseData.IntCallbackArr, BaseData.ObjectCallback, BaseData.ObjectCallbackArr, BaseData.StringCallback, BaseData.StringCallbackArr, BaseData.VoidCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected Minecraft
mc
MovementInput
movementInput
float
prevRenderArmPitch
float
prevRenderArmYaw
float
prevTimeInPortal
float
renderArmPitch
float
renderArmYaw
NetHandlerPlayClient
sendQueue
int
sprintingTicksLeft
float
timeInPortal
-
Fields inherited from class net.minecraft.entity.player.EntityPlayer
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
-
Fields inherited from class net.minecraft.entity.EntityLivingBase
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
-
Fields inherited from class net.minecraft.entity.Entity
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 Summary
Constructors Constructor Description EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChatComponentMessage(IChatComponent chatComponent)
void
addChatMessage(IChatComponent ichatcomponent)
+ Send a chat message to the CommandSendervoid
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 i, java.lang.String var2)
+ Returnstrue
if the CommandSender is allowed to execute the command,false
if notvoid
closeScreen()
+ set current crafting inventory back to the 2x2 squarevoid
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 keyjava.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)boolean
isCurrentViewEntity()
boolean
isRidingHorse()
boolean
isServerWorld()
+ Returns whether the entity is in a server worldboolean
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
loadPluginData(BaseData data)
PluginData
makePluginData()
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()
-
Methods inherited from class net.minecraft.client.entity.AbstractClientPlayer
getFovModifier, getLocationCape, getLocationSkin, getPlayerInfo, getSkinType, hasPlayerInfo, hasSkin, isSpectator
-
Methods inherited from class net.minecraft.entity.player.EntityPlayer
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
-
Methods inherited from class net.minecraft.entity.EntityLivingBase
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
-
Methods inherited from class net.minecraft.entity.Entity
addEntityCrashInfo, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canRenderOnFire, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fromNBT, func_181012_aH, func_181014_aG, func_181015_d, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, 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, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onStruckByLightning, playStepSound, rayTrace, readFromNBT, setAir, setAlwaysRenderNameTag, setAngles, setCustomNameTag, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldSetPosAfterLoading, spawnRunningParticles, toNBT, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional
-
Methods inherited from class net.zxmushroom63.plugins.BaseData
execFuncBaseData, execFuncObject, execFuncString, getBaseData, getBaseDataArr, getBoolean, getBooleanArr, getByte, getByteArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getObject, getObjectArr, getShort, getShortArr, getString, getStringArr, has, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCallbackBoolean, setCallbackBooleanArr, setCallbackBooleanArrWithDataArg, setCallbackBooleanWithDataArg, setCallbackDouble, setCallbackDoubleArr, setCallbackDoubleArrWithDataArg, setCallbackDoubleWithDataArg, setCallbackFloat, setCallbackFloatArr, setCallbackFloatArrWithDataArg, setCallbackFloatWithDataArg, setCallbackInt, setCallbackIntArr, setCallbackIntArrWithDataArg, setCallbackIntWithDataArg, setCallbackObject, setCallbackObjectArr, setCallbackObjectArrWithDataArg, setCallbackObjectWithDataArg, setCallbackString, setCallbackStringArr, setCallbackStringArrWithDataArg, setCallbackStringWithDataArg, setCallbackVoid, setCallbackVoidWithDataArg, setNull
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraft.command.ICommandSender
getCommandSenderEntity, getEntityWorld, getPositionVector
-
-
-
-
Field Detail
-
sendQueue
public final NetHandlerPlayClient sendQueue
-
movementInput
public MovementInput movementInput
-
mc
protected Minecraft mc
-
sprintingTicksLeft
public int sprintingTicksLeft
-
renderArmYaw
public float renderArmYaw
-
renderArmPitch
public float renderArmPitch
-
prevRenderArmYaw
public float prevRenderArmYaw
-
prevRenderArmPitch
public float prevRenderArmPitch
-
timeInPortal
public float timeInPortal
-
prevTimeInPortal
public float prevTimeInPortal
-
-
Constructor Detail
-
EntityPlayerSP
public EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statWriter)
-
-
Method Detail
-
makePluginData
public PluginData makePluginData()
- Overrides:
makePluginData
in classEntityPlayer
-
loadPluginData
public void loadPluginData(BaseData data)
- Overrides:
loadPluginData
in classEntityPlayer
-
attackEntityFrom
public boolean attackEntityFrom(DamageSource source, float amount)
+ Called when the entity is attacked.- Overrides:
attackEntityFrom
in classEntityPlayer
-
heal
public void heal(float healAmount)
+ Heal living entity (param: amount of half-hearts)- Overrides:
heal
in classEntityLivingBase
-
mountEntity
public void mountEntity(Entity entityIn)
+ Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.- Overrides:
mountEntity
in classEntityLivingBase
-
onUpdate
public void onUpdate()
+ Called to update the entity's position/logic.- Overrides:
onUpdate
in classEntityPlayer
-
onUpdateWalkingPlayer
public void onUpdateWalkingPlayer()
+ called every tick when the player is on foot. Performs all the things that normally happen during movement.
-
dropOneItem
public EntityItem dropOneItem(boolean dropAll)
+ Called when player presses the drop item key- Overrides:
dropOneItem
in classEntityPlayer
-
joinEntityItemWithWorld
protected void joinEntityItemWithWorld(EntityItem itemIn)
+ Joins the passed in entity item with the world. Args: entityItem- Overrides:
joinEntityItemWithWorld
in classEntityPlayer
-
sendChatMessage
public void sendChatMessage(java.lang.String message)
+ Sends a chat message from the player. Args: chatMessage
-
swingItem
public void swingItem()
+ Swings the item the player is holding.- Overrides:
swingItem
in classEntityLivingBase
-
respawnPlayer
public void respawnPlayer()
- Overrides:
respawnPlayer
in classEntityPlayer
-
damageEntity
protected void damageEntity(DamageSource damageSrc, float damageAmount)
+ Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second with the reduced value. Args: damageAmount- Overrides:
damageEntity
in classEntityPlayer
-
closeScreen
public void closeScreen()
+ set current crafting inventory back to the 2x2 square- Overrides:
closeScreen
in classEntityPlayer
-
closeScreenAndDropStack
public void closeScreenAndDropStack()
-
setPlayerSPHealth
public void setPlayerSPHealth(float health)
+ Updates health locally.
-
addStat
public void addStat(StatBase stat, int amount)
+ Adds a value to a statistic field.- Overrides:
addStat
in classEntityPlayer
-
sendPlayerAbilities
public void sendPlayerAbilities()
+ Sends the player's abilities to the server (if there is one).- Overrides:
sendPlayerAbilities
in classEntityPlayer
-
isUser
public boolean isUser()
+ returns true if this is an EntityPlayerSP, or the logged in player.- Overrides:
isUser
in classEntityPlayer
-
sendHorseJump
protected void sendHorseJump()
-
sendHorseInventory
public void sendHorseInventory()
-
setClientBrand
public void setClientBrand(java.lang.String brand)
-
getClientBrand
public java.lang.String getClientBrand()
-
getStatFileWriter
public StatFileWriter getStatFileWriter()
-
addChatComponentMessage
public void addChatComponentMessage(IChatComponent chatComponent)
- Overrides:
addChatComponentMessage
in classEntityPlayer
-
pushOutOfBlocks
protected boolean pushOutOfBlocks(double x, double y, double z)
- Overrides:
pushOutOfBlocks
in classEntity
-
setSprinting
public void setSprinting(boolean sprinting)
+ Set sprinting switch for Entity.- Overrides:
setSprinting
in classEntityLivingBase
-
setXPStats
public void setXPStats(float currentXP, int maxXP, int level)
+ Sets the current XP, total XP, and level number.
-
addChatMessage
public void addChatMessage(IChatComponent ichatcomponent)
+ Send a chat message to the CommandSender- Specified by:
addChatMessage
in interfaceICommandSender
- Overrides:
addChatMessage
in classEntity
-
canCommandSenderUseCommand
public boolean canCommandSenderUseCommand(int i, java.lang.String var2)
+ Returnstrue
if the CommandSender is allowed to execute the command,false
if not- Specified by:
canCommandSenderUseCommand
in interfaceICommandSender
- Overrides:
canCommandSenderUseCommand
in classEntity
-
getPosition
public BlockPos getPosition()
+ Get the position in the world.null
is not allowed! If you are not an entity in the world, return the coordinates 0, 0, 0- Specified by:
getPosition
in interfaceICommandSender
- Overrides:
getPosition
in classEntity
-
playSound
public void playSound(java.lang.String name, float volume, float pitch)
- Overrides:
playSound
in classEntityPlayer
-
isServerWorld
public boolean isServerWorld()
+ Returns whether the entity is in a server world- Overrides:
isServerWorld
in classEntityLivingBase
-
isRidingHorse
public boolean isRidingHorse()
-
getHorseJumpPower
public float getHorseJumpPower()
-
openEditSign
public void openEditSign(TileEntitySign signTile)
- Overrides:
openEditSign
in classEntityPlayer
-
openEditCommandBlock
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
- Overrides:
openEditCommandBlock
in classEntityPlayer
-
displayGUIBook
public void displayGUIBook(ItemStack bookStack)
+ Displays the GUI for interacting with a book.- Overrides:
displayGUIBook
in classEntityPlayer
-
displayGUIChest
public void displayGUIChest(IInventory chestInventory)
+ Displays the GUI for interacting with a chest inventory. Args: chestInventory- Overrides:
displayGUIChest
in classEntityPlayer
-
displayGUIHorse
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
- Overrides:
displayGUIHorse
in classEntityPlayer
-
displayGui
public void displayGui(IInteractionObject guiOwner)
- Overrides:
displayGui
in classEntityPlayer
-
displayVillagerTradeGui
public void displayVillagerTradeGui(IMerchant villager)
- Overrides:
displayVillagerTradeGui
in classEntityPlayer
-
onCriticalHit
public void onCriticalHit(Entity entityHit)
+ Called when the player performs a critical hit on the Entity. Args: entity that was hit critically- Overrides:
onCriticalHit
in classEntityPlayer
-
onEnchantmentCritical
public void onEnchantmentCritical(Entity entityHit)
- Overrides:
onEnchantmentCritical
in classEntityPlayer
-
isSneaking
public boolean isSneaking()
+ Returns if this entity is sneaking.- Overrides:
isSneaking
in classEntity
-
updateEntityActionState
public void updateEntityActionState()
- Overrides:
updateEntityActionState
in classEntityPlayer
-
isCurrentViewEntity
public boolean isCurrentViewEntity()
-
onLivingUpdate
public void onLivingUpdate()
+ Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn.- Overrides:
onLivingUpdate
in classEntityPlayer
-
-