Record Class GeyserItemDefinition
java.lang.Object
java.lang.Record
org.geysermc.geyser.registry.type.GeyserItemDefinition
- All Implemented Interfaces:
org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition,org.cloudburstmc.protocol.common.Definition,org.cloudburstmc.protocol.common.NamedDefinition
public record GeyserItemDefinition(Item javaItem, String identifier, boolean componentBased, int runtimeId)
extends Record
implements org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition
Implements ItemDefinition while also providing a reference to our item mappings.
-
Field Summary
Fields inherited from interface org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition
AIR, LEGACY_FIREWORK -
Constructor Summary
ConstructorsConstructorDescriptionGeyserItemDefinition(Item javaItem, String identifier, boolean componentBased, int runtimeId)Creates an instance of aGeyserItemDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecomponentBasedrecord component.booleanIndicates whether some other object is "equal to" this one.intinthashCode()Returns a hash code value for this object.Returns the value of theidentifierrecord component.booleanjavaItem()Returns the value of thejavaItemrecord component.intReturns the value of theruntimeIdrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
GeyserItemDefinition
public GeyserItemDefinition(Item javaItem, String identifier, boolean componentBased, int runtimeId)Creates an instance of aGeyserItemDefinitionrecord class.- Parameters:
javaItem- the value for thejavaItemrecord componentidentifier- the value for theidentifierrecord componentcomponentBased- the value for thecomponentBasedrecord componentruntimeId- the value for theruntimeIdrecord component
-
-
Method Details
-
getIdentifier
- Specified by:
getIdentifierin interfaceorg.cloudburstmc.protocol.common.NamedDefinition
-
isComponentBased
public boolean isComponentBased()- Specified by:
isComponentBasedin interfaceorg.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition
-
getRuntimeId
public int getRuntimeId()- Specified by:
getRuntimeIdin interfaceorg.cloudburstmc.protocol.common.Definition
-
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 '=='. -
javaItem
Returns the value of thejavaItemrecord component.- Returns:
- the value of the
javaItemrecord component
-
identifier
Returns the value of theidentifierrecord component.- Returns:
- the value of the
identifierrecord component
-
componentBased
public boolean componentBased()Returns the value of thecomponentBasedrecord component.- Returns:
- the value of the
componentBasedrecord component
-
runtimeId
public int runtimeId()Returns the value of theruntimeIdrecord component.- Returns:
- the value of the
runtimeIdrecord component
-