Class SessionPlayerEntity
java.lang.Object
org.geysermc.connector.entity.Entity
org.geysermc.connector.entity.LivingEntity
org.geysermc.connector.entity.player.PlayerEntity
org.geysermc.connector.entity.player.SessionPlayerEntity
The entity class specifically for a
GeyserSession's player.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<GeyserAttributeType,com.nukkitx.protocol.bedrock.data.AttributeData>Used to fix some inconsistencies, especially in respawning.Fields inherited from class org.geysermc.connector.entity.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHand -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.nukkitx.protocol.bedrock.data.AttributeDatacalculateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute, GeyserAttributeType type)Calculates the complete attribute value to send to Bedrock.com.nukkitx.protocol.bedrock.data.AttributeDatafloatvoidmoveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)protected voidsetAir(int amount)Set an int from 0 - this entity's maximum air - (air / maxAir) represents the percentage of bubbles leftvoidsetHealth(float health)voidsetPosition(com.nukkitx.math.vector.Vector3f position)voidsetPositionManual(com.nukkitx.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-appliedvoidspawnEntity(GeyserSession session)protected voidupdateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute, List<com.nukkitx.protocol.bedrock.data.AttributeData> newAttributes)Takes the Java attribute and adds it to newAttributes as a Bedrock-formatted attributevoidupdateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata, GeyserSession session)Applies the Java metadata to the local Bedrock metadata copyvoidupdateBedrockMetadata(GeyserSession session)Sends the Bedrock metadata to the clientMethods inherited from class org.geysermc.connector.entity.player.PlayerEntity
moveAbsolute, sendPlayer, setBelowNameText, setDimensions, setDisplayName, setDisplayNameVisible, updateDisplayName, updateHeadLookRotation, updatePositionAndRotation, updateRotationMethods inherited from class org.geysermc.connector.entity.LivingEntity
isShaking, setFreezing, updateArmor, updateBedrockAttributes, updateMainHand, updateOffHandMethods inherited from class org.geysermc.connector.entity.Entity
addAdditionalSpawnData, as, despawnEntity, getBedrockRotation, getMaxAir, is, moveAbsolute, moveRelative, setInvisible, teleport
-
Field Details
-
attributes
protected final Map<GeyserAttributeType,com.nukkitx.protocol.bedrock.data.AttributeData> attributesUsed to fix some inconsistencies, especially in respawning.
-
-
Constructor Details
-
SessionPlayerEntity
-
-
Method Details
-
spawnEntity
- Overrides:
spawnEntityin classPlayerEntity
-
moveRelative
public void moveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)- Overrides:
moveRelativein classPlayerEntity
-
setPosition
public void setPosition(com.nukkitx.math.vector.Vector3f position)- Overrides:
setPositionin classPlayerEntity
-
setPositionManual
public void setPositionManual(com.nukkitx.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
-
updateBedrockMetadata
public void updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata, GeyserSession session)Description copied from class:EntityApplies the Java metadata to the local Bedrock metadata copy- Overrides:
updateBedrockMetadatain classPlayerEntity- Parameters:
entityMetadata- the Java entity metadatasession- GeyserSession
-
getMaxHealth
public float getMaxHealth() -
setHealth
public void setHealth(float health) -
setAir
protected void setAir(int amount)Description copied from class:EntitySet an int from 0 - this entity's maximum air - (air / maxAir) represents the percentage of bubbles left -
createHealthAttribute
public com.nukkitx.protocol.bedrock.data.AttributeData createHealthAttribute()- Overrides:
createHealthAttributein classLivingEntity- Returns:
- a Bedrock health attribute constructed from the data sent from the server
-
updateBedrockMetadata
Description copied from class:EntitySends the Bedrock metadata to the client- Overrides:
updateBedrockMetadatain classEntity- Parameters:
session- GeyserSession
-
updateAttribute
protected void updateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute, List<com.nukkitx.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 com.nukkitx.protocol.bedrock.data.AttributeData calculateAttribute(com.github.steveice10.mc.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
-