Record Class VillagerMeta.VillagerData
java.lang.Object
java.lang.Record
net.minestom.server.entity.metadata.villager.VillagerMeta.VillagerData
- Enclosing class:
VillagerMeta
public static record VillagerMeta.VillagerData(@NotNull VillagerType type, @NotNull VillagerProfession profession, @NotNull VillagerMeta.Level level)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VillagerMeta.VillagerDatastatic final NetworkBuffer.Type<VillagerMeta.VillagerData> -
Constructor Summary
ConstructorsConstructorDescriptionVillagerData(@NotNull VillagerType type, @NotNull VillagerProfession profession, @NotNull VillagerMeta.Level level) Creates an instance of aVillagerDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull VillagerMeta.Levellevel()Returns the value of thelevelrecord component.@NotNull VillagerProfessionReturns the value of theprofessionrecord component.final StringtoString()Returns a string representation of this record class.@NotNull VillagerTypetype()Returns the value of thetyperecord component.@NotNull VillagerMeta.VillagerDatawithLevel(@NotNull VillagerMeta.Level level) @NotNull VillagerMeta.VillagerDatawithProfession(@NotNull VillagerProfession profession) @NotNull VillagerMeta.VillagerDatawithType(@NotNull VillagerType type)
-
Field Details
-
DEFAULT
-
NETWORK_TYPE
-
-
Constructor Details
-
VillagerData
public VillagerData(@NotNull @NotNull VillagerType type, @NotNull @NotNull VillagerProfession profession, @NotNull @NotNull VillagerMeta.Level level) Creates an instance of aVillagerDatarecord class.- Parameters:
type- the value for thetyperecord componentprofession- the value for theprofessionrecord componentlevel- the value for thelevelrecord component
-
-
Method Details
-
withType
-
withProfession
@NotNull public @NotNull VillagerMeta.VillagerData withProfession(@NotNull @NotNull VillagerProfession profession) -
withLevel
@NotNull public @NotNull VillagerMeta.VillagerData withLevel(@NotNull @NotNull VillagerMeta.Level level) -
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
profession
Returns the value of theprofessionrecord component.- Returns:
- the value of the
professionrecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-