Class EntityDefinition.Builder<T extends Entity>

java.lang.Object
org.geysermc.geyser.entity.EntityDefinition.Builder<T>
Enclosing class:
EntityDefinition<T extends Entity>

public static class EntityDefinition.Builder<T extends Entity> extends Object
  • 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

      public EntityDefinition.Builder<T> heightAndWidth(float value)
      Sets the height and width as one value
    • offset

      public EntityDefinition.Builder<T> offset(float 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,​ ? 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

      public EntityDefinition.Builder<T> addTranslator(EntityMetadataTranslator<T,​?,​?> translator)
    • build

      public EntityDefinition<T> build()
    • build

      public EntityDefinition<T> build(boolean register)
      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

      public EntityDefinition.Builder<T> identifier(String identifier)
      Returns:
      this.
    • width

      public EntityDefinition.Builder<T> width(float width)
      Returns:
      this.
    • height

      public EntityDefinition.Builder<T> height(float height)
      Returns:
      this.