public class SessionPlayerEntity extends PlayerEntity
GeyserSession's player.| Modifier and Type | Field and Description |
|---|---|
protected Map<GeyserAttributeType,com.nukkitx.protocol.bedrock.data.AttributeData> |
attributes
Used to fix some inconsistencies, especially in respawning.
|
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHand| Constructor and Description |
|---|
SessionPlayerEntity(GeyserSession session) |
| Modifier and Type | Method and Description |
|---|---|
protected com.nukkitx.protocol.bedrock.data.AttributeData |
calculateAttribute(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.AttributeData |
createHealthAttribute() |
float |
getMaxHealth() |
void |
moveRelative(GeyserSession session,
double relX,
double relY,
double relZ,
com.nukkitx.math.vector.Vector3f rotation,
boolean isOnGround) |
void |
setHealth(float health) |
void |
setPosition(com.nukkitx.math.vector.Vector3f position) |
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
|
void |
spawnEntity(GeyserSession session) |
protected void |
updateAttribute(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 attribute
|
void |
updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata,
GeyserSession session)
Applies the Java metadata to the local Bedrock metadata copy
|
void |
updateBedrockMetadata(GeyserSession session)
Sends the Bedrock metadata to the client
|
moveAbsolute, sendPlayer, setDimensions, updateHeadLookRotation, updatePositionAndRotation, updateRotationisShaking, setFreezing, updateArmor, updateBedrockAttributes, updateMainHand, updateOffHandaddAdditionalSpawnData, as, despawnEntity, getBedrockRotation, is, moveAbsolute, moveRelative, teleportprotected final Map<GeyserAttributeType,com.nukkitx.protocol.bedrock.data.AttributeData> attributes
public SessionPlayerEntity(GeyserSession session)
public void spawnEntity(GeyserSession session)
spawnEntity in class PlayerEntitypublic void moveRelative(GeyserSession session, double relX, double relY, double relZ, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround)
moveRelative in class PlayerEntitypublic void setPosition(com.nukkitx.math.vector.Vector3f position)
setPosition in class PlayerEntitypublic void setPositionManual(com.nukkitx.math.vector.Vector3f position)
position - the new position of the Bedrock playerpublic void updateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata,
GeyserSession session)
EntityupdateBedrockMetadata in class PlayerEntityentityMetadata - the Java entity metadatasession - GeyserSessionpublic float getMaxHealth()
public void setHealth(float health)
public com.nukkitx.protocol.bedrock.data.AttributeData createHealthAttribute()
createHealthAttribute in class LivingEntitypublic void updateBedrockMetadata(GeyserSession session)
EntityupdateBedrockMetadata in class Entitysession - GeyserSessionprotected void updateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute,
List<com.nukkitx.protocol.bedrock.data.AttributeData> newAttributes)
LivingEntityupdateAttribute in class LivingEntityprotected com.nukkitx.protocol.bedrock.data.AttributeData calculateAttribute(com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute javaAttribute,
GeyserAttributeType type)
LivingEntitycalculateAttribute in class LivingEntityCopyright © 2021 GeyserMC. All rights reserved.