Package org.geysermc.connector.entity
Class ItemEntity
java.lang.Object
org.geysermc.connector.entity.Entity
org.geysermc.connector.entity.ThrowableEntity
org.geysermc.connector.entity.ItemEntity
- All Implemented Interfaces:
Tickable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.nukkitx.protocol.bedrock.data.inventory.ItemDataFields inherited from class org.geysermc.connector.entity.ThrowableEntity
lastJavaPosition -
Constructor Summary
ConstructorsConstructorDescriptionItemEntity(long entityId, long geyserId, EntityType entityType, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation) -
Method Summary
Modifier and TypeMethodDescriptionprotected floatgetDrag(GeyserSession session)protected floatgetGravity(GeyserSession session)Get the gravity of this entity type.protected booleanisInWater(GeyserSession session)protected voidmoveAbsoluteImmediate(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)voidspawnEntity(GeyserSession session)voidtick(GeyserSession session)Updates the position for the Bedrock client.voidupdateBedrockMetadata(com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata entityMetadata, GeyserSession session)Applies the Java metadata to the local Bedrock metadata copyMethods inherited from class org.geysermc.connector.entity.ThrowableEntity
despawnEntity, moveAbsolute, moveRelativeMethods inherited from class org.geysermc.connector.entity.Entity
addAdditionalSpawnData, as, getBedrockRotation, getMaxAir, is, isShaking, moveAbsolute, moveRelative, setAir, setDimensions, setDisplayName, setDisplayNameVisible, setFreezing, setInvisible, teleport, updateBedrockMetadata, updateHeadLookRotation, updatePositionAndRotation, updateRotation
-
Field Details
-
item
protected com.nukkitx.protocol.bedrock.data.inventory.ItemData item
-
-
Constructor Details
-
ItemEntity
public ItemEntity(long entityId, long geyserId, EntityType entityType, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, com.nukkitx.math.vector.Vector3f rotation)
-
-
Method Details
-
spawnEntity
- Overrides:
spawnEntityin classEntity
-
tick
Description copied from class:ThrowableEntityUpdates the position for the Bedrock client. Java clients assume the next positions of moving items. Bedrock needs to be explicitly told positions- Specified by:
tickin interfaceTickable- Overrides:
tickin classThrowableEntity
-
moveAbsoluteImmediate
protected void moveAbsoluteImmediate(GeyserSession session, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f rotation, boolean isOnGround, boolean teleported)- Overrides:
moveAbsoluteImmediatein classThrowableEntity
-
getGravity
Description copied from class:ThrowableEntityGet the gravity of this entity type. Used for applying gravity while the entity is in motion.- Overrides:
getGravityin classThrowableEntity- Parameters:
session- the session of the Bedrock client.- Returns:
- the amount of gravity to apply to this entity while in motion.
-
getDrag
- Overrides:
getDragin classThrowableEntity- Parameters:
session- the session of the Bedrock client.- Returns:
- the drag that should be multiplied to the entity's motion
-
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 classEntity- Parameters:
entityMetadata- the Java entity metadatasession- GeyserSession
-
isInWater
- Overrides:
isInWaterin classThrowableEntity- Parameters:
session- the session of the Bedrock client.- Returns:
- true if this entity is currently in water.
-