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.player.PlayerEntity
SNEAKING_POSE_HEIGHTFields inherited from class org.geysermc.geyser.entity.type.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHand -
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.AttributeDatafloatfloatprotected booleanhasShield(boolean offhand, ItemMapping shieldMapping)voidmoveRelative(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround)protected voidsetAirSupply(int amount)booleansetBoundingBoxHeight(float height)protected voidvoidsetFlags(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata)voidsetHealth(float health)voidsetLastDeathPosition(com.github.steveice10.mc.protocol.data.game.entity.metadata.GlobalPos pos)voidsetPose(com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose pose)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, updateRotationMethods inherited from class org.geysermc.geyser.entity.type.LivingEntity
checkInteractWithNameTag, interact, isAlive, isShaking, setFreezing, setHealth, setLivingEntityFlags, updateArmor, updateBedrockAttributes, updateMainHand, updateOffHandMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, despawnEntity, getBedrockRotation, getFlag, getMaxAir, interactAt, moveAbsolute, moveRelative, playEntityEvent, playEntityEvent, setAir, setBoundingBoxWidth, setFlag, setGravity, setInvisible, setSilent, teleport, testInteraction, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updatePassengerOffsets, updatePositionAndRotation, updateRotation
-
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
-
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(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) -
setBoundingBoxHeight
public boolean setBoundingBoxHeight(float height)- Overrides:
setBoundingBoxHeightin classEntity
-
setPose
public void setPose(com.github.steveice10.mc.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(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
-
hasShield
- Overrides:
hasShieldin classLivingEntity
-
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
-
setLastDeathPosition
public void setLastDeathPosition(@Nullable com.github.steveice10.mc.protocol.data.game.entity.metadata.GlobalPos pos)
-