Record Class SlotListPropertyWrapper
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.config.wrapper.SlotListPropertyWrapper
- Record Components:
property- The live configurationPropertyholding the list of equipment slot groups.description- TheConfigDescriptionmetadata identifying the configuration property.fallback- The fallback list ofEquipmentSlotGroupvalues parsed from the datapack JSON definition.
public record SlotListPropertyWrapper(johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property, johnsmith.configoverhauled.api.data.ConfigDescription description, List<net.minecraft.world.entity.EquipmentSlotGroup> fallback)
extends Record
Binds a dynamic configuration property containing a list of
EquipmentSlotGroup values to an
enchantment's slots definition.-
Constructor Summary
ConstructorsConstructorDescriptionSlotListPropertyWrapper(johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property, johnsmith.configoverhauled.api.data.ConfigDescription description, List<net.minecraft.world.entity.EquipmentSlotGroup> fallback) Creates an instance of aSlotListPropertyWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionjohnsmith.configoverhauled.api.data.ConfigDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.List<net.minecraft.world.entity.EquipmentSlotGroup> fallback()Returns the value of thefallbackrecord component.final inthashCode()Returns a hash code value for this object.booleanDetermines whether a valid configuration property is bound to this wrapper.johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property()Returns the value of thepropertyrecord component.List<net.minecraft.world.entity.EquipmentSlotGroup> Resolves the active list ofEquipmentSlotGroupvalues from the bound configuration property.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SlotListPropertyWrapper
public SlotListPropertyWrapper(johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property, johnsmith.configoverhauled.api.data.ConfigDescription description, List<net.minecraft.world.entity.EquipmentSlotGroup> fallback) Creates an instance of aSlotListPropertyWrapperrecord class.- Parameters:
property- the value for thepropertyrecord componentdescription- the value for thedescriptionrecord componentfallback- the value for thefallbackrecord component
-
-
Method Details
-
isConfigured
public boolean isConfigured()Determines whether a valid configuration property is bound to this wrapper.- Returns:
trueifproperty()is non-null,falseotherwise.
-
resolve
public List<net.minecraft.world.entity.EquipmentSlotGroup> resolve(List<net.minecraft.world.entity.EquipmentSlotGroup> vanillaFallback) Resolves the active list ofEquipmentSlotGroupvalues from the bound configuration property.Falls back to
fallback()orvanillaFallbackif the property is unconfigured or empty.- Parameters:
vanillaFallback- The baseline equipment slot group list from the enchantment definition.- Returns:
- The resolved list of
EquipmentSlotGroupinstances.
-
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). -
property
public johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property()Returns the value of thepropertyrecord component.- Returns:
- the value of the
propertyrecord component
-
description
public johnsmith.configoverhauled.api.data.ConfigDescription description()Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
fallback
Returns the value of thefallbackrecord component.- Returns:
- the value of the
fallbackrecord component
-