Record Class GeyserEntityType

java.lang.Object
java.lang.Record
org.geysermc.geyser.entity.GeyserEntityType
All Implemented Interfaces:
org.geysermc.geyser.api.entity.custom.CustomJavaEntityType, org.geysermc.geyser.api.entity.definition.JavaEntityType

public record GeyserEntityType(org.geysermc.geyser.api.util.Identifier identifier, int javaId) extends Record implements org.geysermc.geyser.api.entity.definition.JavaEntityType, org.geysermc.geyser.api.entity.custom.CustomJavaEntityType
  • Constructor Details

    • GeyserEntityType

      public GeyserEntityType(org.geysermc.geyser.api.util.Identifier identifier, int javaId)
      Creates an instance of a GeyserEntityType record class.
      Parameters:
      identifier - the value for the identifier record component
      javaId - the value for the javaId record component
  • Method Details

    • isUnregistered

      public boolean isUnregistered()
    • vanilla

      public boolean vanilla()
      Specified by:
      vanilla in interface org.geysermc.geyser.api.entity.custom.CustomJavaEntityType
      Specified by:
      vanilla in interface org.geysermc.geyser.api.entity.definition.JavaEntityType
    • width

      public float width()
      Specified by:
      width in interface org.geysermc.geyser.api.entity.definition.JavaEntityType
    • height

      public float height()
      Specified by:
      height in interface org.geysermc.geyser.api.entity.definition.JavaEntityType
    • defaultBedrockDefinition

      public @Nullable org.geysermc.geyser.api.entity.definition.GeyserEntityDefinition defaultBedrockDefinition()
      Specified by:
      defaultBedrockDefinition in interface org.geysermc.geyser.api.entity.definition.JavaEntityType
    • is

      public boolean is(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type)
    • ofVanilla

      public static GeyserEntityType ofVanilla(org.geysermc.mcprotocollib.protocol.data.game.entity.type.BuiltinEntityType builtin)
    • ofVanilla

      public static GeyserEntityType ofVanilla(org.geysermc.geyser.api.util.Identifier javaIdentifier)
      Throws:
      IllegalArgumentException - document this in API
    • of

      public static GeyserEntityType of(int javaId)
    • of

      public static @Nullable GeyserEntityType of(net.kyori.adventure.key.Key javaKey)
    • of

      public static GeyserEntityType of(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type)
    • createCustomAndRegister

      public static GeyserEntityType createCustomAndRegister(GeyserEntityType.Builder builder)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • identifier

      public org.geysermc.geyser.api.util.Identifier identifier()
      Returns the value of the identifier record component.
      Specified by:
      identifier in interface org.geysermc.geyser.api.entity.definition.JavaEntityType
      Returns:
      the value of the identifier record component
    • javaId

      public int javaId()
      Returns the value of the javaId record component.
      Specified by:
      javaId in interface org.geysermc.geyser.api.entity.definition.JavaEntityType
      Returns:
      the value of the javaId record component