Class SessionPlayerEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.LivingEntity
org.geysermc.geyser.entity.type.player.PlayerEntity
org.geysermc.geyser.entity.type.player.SessionPlayerEntity
- All Implemented Interfaces:
org.geysermc.geyser.api.entity.type.GeyserEntity,org.geysermc.geyser.api.entity.type.player.GeyserPlayerEntity
The entity class specifically for a
GeyserSession's player.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<GeyserAttributeType,org.cloudburstmc.protocol.bedrock.data.AttributeData> Used to fix some inconsistencies, especially in respawning.Fields inherited from class org.geysermc.geyser.entity.type.player.PlayerEntity
BASE_ABILITY_LAYER, SNEAKING_POSE_HEIGHTFields inherited from class org.geysermc.geyser.entity.type.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offhandFields inherited from class org.geysermc.geyser.entity.type.Entity
definition, dirtyMetadata, entityId, flags, geyserId, headYaw, motion, nametag, onGround, passengers, pitch, position, propertyManager, session, silent, uuid, valid, vehicle, yaw -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.cloudburstmc.protocol.bedrock.data.AttributeDatacalculateAttribute(org.geysermc.mcprotocollib.protocol.data.game.entity.attribute.Attribute javaAttribute, GeyserAttributeType type) Calculates the complete attribute value to send to Bedrock.org.cloudburstmc.protocol.bedrock.data.AttributeDataMap<GeyserAttributeType,org.cloudburstmc.protocol.bedrock.data.AttributeData> Used to fix some inconsistencies, especially in respawning.floatfloatprotected booleanhasShield(boolean offhand) booleanUsed in PlayerInputTranslator for movement checks.voidmoveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround) voidresetAir()voidvoidvoidsetAbsorptionHearts(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.FloatEntityMetadata entityMetadata) protected voidsetAirSupply(int amount) booleansetBoundingBoxHeight(float height) protected voidvoidsetFlags(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata) Sending any updated flags (sprinting, onFire, etc.) to the client while in spectator is not needed Also "fixes" issue 3318voidsetHealth(float health) voidsetLastDeathPosition(@Nullable org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.GlobalPos pos) voidsetPose(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Pose pose) Usually used for bounding box and not animation.voidsetPosition(org.cloudburstmc.math.vector.Vector3f position) voidsetPositionManual(org.cloudburstmc.math.vector.Vector3f position) Set the player's position without applying an offset or moving the bounding box This is used in BedrockMovePlayerTranslator which receives the player's position with the offset pre-appliedvoidsetRiderSeatPosition(org.cloudburstmc.math.vector.Vector3f position) voidprotected voidupdateAttribute(org.geysermc.mcprotocollib.protocol.data.game.entity.attribute.Attribute javaAttribute, List<org.cloudburstmc.protocol.bedrock.data.AttributeData> newAttributes) Takes the Java attribute and adds it to newAttributes as a Bedrock-formatted attributevoidSince 1.19.40, the client must be re-informed of its bounding box on respawn See issue 3370Methods inherited from class org.geysermc.geyser.entity.type.player.PlayerEntity
despawnEntity, getBedPosition, getLeftParrot, getRightParrot, getTexturesProperty, getUsername, initializeMetadata, moveAbsolute, position, sendPlayer, setBedPosition, setBelowNameText, setDimensions, setDisplayName, setDisplayNameVisible, setLeftParrot, setParrot, setRightParrot, setSkinVisibility, setTexturesProperty, setUsername, updateDisplayName, updateRotationMethods inherited from class org.geysermc.geyser.entity.type.LivingEntity
checkInteractWithNameTag, getBoots, getChestplate, getHand, getHelmet, getLeggings, getOffhand, interact, isAlive, isMaxFrozenState, isShaking, setBoots, setChestplate, setFreezing, setHand, setHealth, setHelmet, setLeggings, setLivingEntityFlags, setMaxFrozenState, setMaxHealth, setOffhand, setParticles, setScale, switchHands, updateArmor, updateBedrockAttributes, updateMainHand, updateOffHand, useArmSwingAttackMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, getBedrockRotation, getBoundingBoxHeight, getBoundingBoxWidth, getDefinition, getDirtyMetadata, getEntityId, getFlag, getGeyserId, getHeadYaw, getMaxAir, getMotion, getNametag, getPassengers, getPitch, getPosition, getPropertyManager, getSession, getUuid, getVehicle, getYaw, interactAt, isOnGround, isSilent, isValid, javaId, moveAbsolute, moveRelative, playEntityEvent, playEntityEvent, setAir, setBoundingBoxWidth, setDefinition, setEntityId, setFlag, setFlagsDirty, setGravity, setHeadYaw, setInvisible, setMotion, setOnGround, setPassengers, setPitch, setSilent, setUuid, setValid, setVehicle, setYaw, teleport, testInteraction, updateBedrockEntityProperties, updateBedrockMetadata, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updatePassengerOffsets, updatePositionAndRotation, updateRotationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.geyser.api.entity.type.GeyserEntity
javaId
-
Field Details
-
attributes
protected final Map<GeyserAttributeType,org.cloudburstmc.protocol.bedrock.data.AttributeData> attributesUsed to fix some inconsistencies, especially in respawning.
-
-
Constructor Details
-
SessionPlayerEntity
-
-
Method Details
-
setClientSideSilent
protected void setClientSideSilent()- Overrides:
setClientSideSilentin classEntity
-
spawnEntity
public void spawnEntity()- Overrides:
spawnEntityin classPlayerEntity
-
moveRelative
public void moveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround) - Overrides:
moveRelativein classPlayerEntity
-
setPosition
public void setPosition(org.cloudburstmc.math.vector.Vector3f position) - Overrides:
setPositionin classPlayerEntity
-
setPositionManual
public void setPositionManual(org.cloudburstmc.math.vector.Vector3f position) Set the player's position without applying an offset or moving the bounding box This is used in BedrockMovePlayerTranslator which receives the player's position with the offset pre-applied- Parameters:
position- the new position of the Bedrock player
-
setFlags
public void setFlags(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata) Sending any updated flags (sprinting, onFire, etc.) to the client while in spectator is not needed Also "fixes" issue 3318 -
updateBoundingBox
public void updateBoundingBox()Since 1.19.40, the client must be re-informed of its bounding box on respawn See issue 3370 -
setBoundingBoxHeight
public boolean setBoundingBoxHeight(float height) - Overrides:
setBoundingBoxHeightin classEntity
-
setPose
public void setPose(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.Pose pose) Description copied from class:EntityUsually used for bounding box and not animation. -
getMaxHealth
public float getMaxHealth() -
getHealth
public float getHealth() -
setHealth
public void setHealth(float health) -
setAirSupply
protected void setAirSupply(int amount) - Overrides:
setAirSupplyin classEntity
-
setRiderSeatPosition
public void setRiderSeatPosition(org.cloudburstmc.math.vector.Vector3f position) - Overrides:
setRiderSeatPositionin classEntity
-
createHealthAttribute
public org.cloudburstmc.protocol.bedrock.data.AttributeData createHealthAttribute()- Overrides:
createHealthAttributein classLivingEntity- Returns:
- a Bedrock health attribute constructed from the data sent from the server
-
hasShield
protected boolean hasShield(boolean offhand) - Overrides:
hasShieldin classLivingEntity
-
updateAttribute
protected void updateAttribute(org.geysermc.mcprotocollib.protocol.data.game.entity.attribute.Attribute javaAttribute, List<org.cloudburstmc.protocol.bedrock.data.AttributeData> newAttributes) Description copied from class:LivingEntityTakes the Java attribute and adds it to newAttributes as a Bedrock-formatted attribute- Overrides:
updateAttributein classLivingEntity
-
calculateAttribute
protected org.cloudburstmc.protocol.bedrock.data.AttributeData calculateAttribute(org.geysermc.mcprotocollib.protocol.data.game.entity.attribute.Attribute javaAttribute, GeyserAttributeType type) Description copied from class:LivingEntityCalculates the complete attribute value to send to Bedrock. Will be overriden if attributes need to be cached.- Overrides:
calculateAttributein classLivingEntity
-
setLastDeathPosition
public void setLastDeathPosition(@Nullable org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.GlobalPos pos) -
getTabListUuid
- Overrides:
getTabListUuidin classPlayerEntity- Returns:
- the UUID that should be used when dealing with Bedrock's tab list.
-
setAbsorptionHearts
public void setAbsorptionHearts(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.FloatEntityMetadata entityMetadata) - Overrides:
setAbsorptionHeartsin classPlayerEntity
-
resetMetadata
public void resetMetadata()- Overrides:
resetMetadatain classPlayerEntity
-
resetAttributes
public void resetAttributes() -
resetAir
public void resetAir() -
getAttributes
public Map<GeyserAttributeType,org.cloudburstmc.protocol.bedrock.data.AttributeData> getAttributes()Used to fix some inconsistencies, especially in respawning. -
isRidingInFront
public boolean isRidingInFront()Used in PlayerInputTranslator for movement checks.
-