Package org.geysermc.geyser.entity
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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.geysermc.geyser.api.entity.custom.CustomJavaEntityType
org.geysermc.geyser.api.entity.custom.CustomJavaEntityType.Builder -
Constructor Summary
ConstructorsConstructorDescriptionGeyserEntityType(org.geysermc.geyser.api.util.Identifier identifier, int javaId) Creates an instance of aGeyserEntityTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic GeyserEntityType@Nullable org.geysermc.geyser.api.entity.definition.GeyserEntityDefinitionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheight()org.geysermc.geyser.api.util.IdentifierReturns the value of theidentifierrecord component.booleanis(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type) booleanintjavaId()Returns the value of thejavaIdrecord component.static GeyserEntityTypeof(int javaId) static @Nullable GeyserEntityTypeof(net.kyori.adventure.key.Key javaKey) static GeyserEntityTypeof(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type) static GeyserEntityTypeofVanilla(org.geysermc.geyser.api.util.Identifier javaIdentifier) static GeyserEntityTypeofVanilla(org.geysermc.mcprotocollib.protocol.data.game.entity.type.BuiltinEntityType builtin) final StringtoString()Returns a string representation of this record class.booleanvanilla()floatwidth()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.geysermc.geyser.api.entity.definition.JavaEntityType
is
-
Constructor Details
-
GeyserEntityType
public GeyserEntityType(org.geysermc.geyser.api.util.Identifier identifier, int javaId) Creates an instance of aGeyserEntityTyperecord class.- Parameters:
identifier- the value for theidentifierrecord componentjavaId- the value for thejavaIdrecord component
-
-
Method Details
-
isUnregistered
public boolean isUnregistered() -
vanilla
public boolean vanilla()- Specified by:
vanillain interfaceorg.geysermc.geyser.api.entity.custom.CustomJavaEntityType- Specified by:
vanillain interfaceorg.geysermc.geyser.api.entity.definition.JavaEntityType
-
width
public float width()- Specified by:
widthin interfaceorg.geysermc.geyser.api.entity.definition.JavaEntityType
-
height
public float height()- Specified by:
heightin interfaceorg.geysermc.geyser.api.entity.definition.JavaEntityType
-
defaultBedrockDefinition
public @Nullable org.geysermc.geyser.api.entity.definition.GeyserEntityDefinition defaultBedrockDefinition()- Specified by:
defaultBedrockDefinitionin interfaceorg.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
- Throws:
IllegalArgumentException- document this in API
-
of
-
of
-
of
public static GeyserEntityType of(org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType type) -
createCustomAndRegister
public static GeyserEntityType createCustomAndRegister(GeyserEntityType.GeyserJavaEntityTypeBuild builder) -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
identifier
public org.geysermc.geyser.api.util.Identifier identifier()Returns the value of theidentifierrecord component.- Specified by:
identifierin interfaceorg.geysermc.geyser.api.entity.definition.JavaEntityType- Returns:
- the value of the
identifierrecord component
-
javaId
public int javaId()Returns the value of thejavaIdrecord component.- Specified by:
javaIdin interfaceorg.geysermc.geyser.api.entity.definition.JavaEntityType- Returns:
- the value of the
javaIdrecord component
-