Package org.geysermc.geyser.entity.spawn
Class EntitySpawnContext
java.lang.Object
org.geysermc.geyser.entity.spawn.EntitySpawnContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.cloudburstmc.protocol.common.util.TriFunction<GeyserSession,UUID, EntityTypeDefinition<?>, EntitySpawnContext> -
Constructor Summary
ConstructorsConstructorDescriptionEntitySpawnContext(GeyserSession session, EntityTypeDefinition<?> type, int entityId, long geyserId) EntitySpawnContext(GeyserSession session, EntityTypeDefinition<?> type, int javaId, UUID uuid) EntitySpawnContext(GeyserSession session, EntityTypeDefinition<?> definition, int javaId, UUID uuid, BedrockEntityDefinition bedrockEntityDefinition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.math.vector.Vector3f motion, float yaw, float pitch, float headYaw, @Nullable Long geyserId) -
Method Summary
Modifier and TypeMethodDescriptionbedrockEntityDefinition(BedrockEntityDefinition bedrockEntityDefinition) booleancallParrotEvent(PlayerEntity player, int variant, boolean right) boolean@Nullable Collection<Consumer<org.geysermc.geyser.api.entity.type.GeyserEntity>>consumers(@Nullable Collection<Consumer<org.geysermc.geyser.api.entity.type.GeyserEntity>> consumers) static EntitySpawnContextfromPacket(GeyserSession session, EntityTypeDefinition<?> definition, org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundAddEntityPacket packet) longgeyserId()floatheadYaw()headYaw(float headYaw) static EntitySpawnContextinherited(GeyserSession session, EntityTypeDefinition<?> definition, Entity base, org.cloudburstmc.math.vector.Vector3f position) intjavaId()javaId(int javaId) org.cloudburstmc.math.vector.Vector3fmotion()motion(org.cloudburstmc.math.vector.Vector3f motion) floatpitch()pitch(float pitch) org.cloudburstmc.math.vector.Vector3fposition()position(org.cloudburstmc.math.vector.Vector3f position) session()uuid()floatyaw()yaw(float yaw)
-
Field Details
-
DUMMY_CONTEXT
public static final org.cloudburstmc.protocol.common.util.TriFunction<GeyserSession,UUID, DUMMY_CONTEXTEntityTypeDefinition<?>, EntitySpawnContext>
-
-
Constructor Details
-
EntitySpawnContext
public EntitySpawnContext(GeyserSession session, EntityTypeDefinition<?> type, int javaId, UUID uuid) -
EntitySpawnContext
public EntitySpawnContext(GeyserSession session, EntityTypeDefinition<?> type, int entityId, long geyserId) -
EntitySpawnContext
public EntitySpawnContext(GeyserSession session, EntityTypeDefinition<?> definition, int javaId, UUID uuid, BedrockEntityDefinition bedrockEntityDefinition, org.cloudburstmc.math.vector.Vector3f position, org.cloudburstmc.math.vector.Vector3f motion, float yaw, float pitch, float headYaw, @Nullable Long geyserId)
-
-
Method Details
-
fromPacket
public static EntitySpawnContext fromPacket(GeyserSession session, EntityTypeDefinition<?> definition, org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundAddEntityPacket packet) -
inherited
public static EntitySpawnContext inherited(GeyserSession session, EntityTypeDefinition<?> definition, Entity base, org.cloudburstmc.math.vector.Vector3f position) -
callServerSpawnEvent
public boolean callServerSpawnEvent()- Returns:
- true if an entity should be spawned
-
callParrotEvent
- Returns:
- true if the parrot should be spawned
-
geyserId
public long geyserId() -
session
-
entityTypeDefinition
-
javaId
public int javaId() -
uuid
-
bedrockEntityDefinition
-
position
public org.cloudburstmc.math.vector.Vector3f position() -
motion
public org.cloudburstmc.math.vector.Vector3f motion() -
yaw
public float yaw() -
pitch
public float pitch() -
headYaw
public float headYaw() -
consumers
-
javaId
- Returns:
this.
-
bedrockEntityDefinition
- Returns:
this.
-
position
- Returns:
this.
-
motion
- Returns:
this.
-
yaw
- Returns:
this.
-
pitch
- Returns:
this.
-
headYaw
- Returns:
this.
-
geyserId
- Returns:
this.
-
consumers
public EntitySpawnContext consumers(@Nullable Collection<Consumer<org.geysermc.geyser.api.entity.type.GeyserEntity>> consumers) - Returns:
this.
-