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
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.geyser.entity.type.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHandFields inherited from class org.geysermc.geyser.entity.type.Entity
boundingBoxHeight, boundingBoxWidth, definition, dirtyMetadata, entityId, flags, geyserId, headYaw, motion, nametag, onGround, passengers, pitch, position, uuid, valid, yaw -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFakeTradeExperience(int tradeXp)protected 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(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)protected voidsetAirSupply(int amount)voidsetFlags(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata)voidsetHealth(float health)voidsetPose(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose,?> entityMetadata)Usually used for bounding box and not animation.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-appliedvoidsetRiderSeatPosition(com.nukkitx.math.vector.Vector3f position)voidprotected 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 attributevoidSends the Bedrock metadata to the clientMethods inherited from class org.geysermc.geyser.entity.type.player.PlayerEntity
initializeMetadata, moveAbsolute, sendPlayer, setAbsorptionHearts, setBedPosition, setBelowNameText, setDimensions, setDisplayName, setDisplayNameVisible, setLeftParrot, setRightParrot, setSkinVisibility, updateDisplayName, updateHeadLookRotation, updatePositionAndRotation, updateRotationMethods inherited from class org.geysermc.geyser.entity.type.LivingEntity
isShaking, setFreezing, setHealth, setLivingEntityFlags, updateArmor, updateBedrockAttributes, updateMainHand, updateOffHandMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, despawnEntity, getBedrockRotation, getFlag, getMaxAir, is, moveAbsolute, moveRelative, setAir, setBoundingBoxHeight, setBoundingBoxWidth, setFlag, setGravity, 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
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(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
-
setFlags
public void setFlags(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata) -
setPose
public void setPose(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose,?> entityMetadata)Description copied from class:EntityUsually used for bounding box and not animation. -
getMaxHealth
public float getMaxHealth() -
setHealth
public void setHealth(float health) -
setAirSupply
protected void setAirSupply(int amount)- Overrides:
setAirSupplyin classEntity
-
setRiderSeatPosition
public void setRiderSeatPosition(com.nukkitx.math.vector.Vector3f position)- Overrides:
setRiderSeatPositionin classEntity
-
addFakeTradeExperience
public void addFakeTradeExperience(int tradeXp) -
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
public void updateBedrockMetadata()Description copied from class:EntitySends the Bedrock metadata to the client- Overrides:
updateBedrockMetadatain classEntity
-
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
-