Package org.geysermc.geyser.entity
Class EntityDefinition.Builder<T extends Entity>
java.lang.Object
org.geysermc.geyser.entity.EntityDefinition.Builder<T>
- Enclosing class:
- EntityDefinition<T extends Entity>
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(EntityFactory<T> factory, com.github.steveice10.mc.protocol.data.game.entity.type.EntityType type, String identifier, float width, float height, float offset, List<EntityMetadataTranslator<? super T, ?, ?>> translators) -
Method Summary
Modifier and TypeMethodDescription<U,EM extends com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<U, ? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<U>>>
EntityDefinition.Builder<T>addTranslator(com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<U> type, BiConsumer<T, EM> translateFunction) addTranslator(EntityMetadataTranslator<T, ?, ?> translator) build()build(boolean register) height(float height) heightAndWidth(float value) Sets the height and width as one valueidentifier(String identifier) offset(float offset) type(com.github.steveice10.mc.protocol.data.game.entity.type.EntityType type) Resets the identifier as wellwidth(float width)
-
Constructor Details
-
Builder
public Builder(EntityFactory<T> factory, com.github.steveice10.mc.protocol.data.game.entity.type.EntityType type, String identifier, float width, float height, float offset, List<EntityMetadataTranslator<? super T, ?, ?>> translators)
-
-
Method Details
-
heightAndWidth
Sets the height and width as one value -
offset
-
type
public EntityDefinition.Builder<T> type(com.github.steveice10.mc.protocol.data.game.entity.type.EntityType type) Resets the identifier as well -
addTranslator
public <U,EM extends com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<U, EntityDefinition.Builder<T> addTranslator? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<U>>> (com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<U> type, BiConsumer<T, EM> translateFunction) -
addTranslator
-
build
-
build
- Parameters:
register- whether to register this entity in the Registries for entity types. Generally this should be set to false if we're not expecting this entity to spawn from the network.
-
identifier
- Returns:
this.
-
width
- Returns:
this.
-
height
- Returns:
this.
-