Record Class LootTableModification
java.lang.Object
java.lang.Record
com.petrolpark.core.data.loot.modifier.LootTableModification
- All Implemented Interfaces:
Comparable<LootTableModification>
public record LootTableModification(List<net.neoforged.neoforge.common.conditions.ICondition> conditions, net.minecraft.resources.ResourceLocation target, int priority, List<ILootTableModifier> modifiers)
extends Record
implements Comparable<LootTableModification>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<LootTableModification> -
Constructor Summary
ConstructorsConstructorDescriptionLootTableModification(List<net.neoforged.neoforge.common.conditions.ICondition> conditions, net.minecraft.resources.ResourceLocation target, int priority, List<ILootTableModifier> modifiers) Creates an instance of aLootTableModificationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintList<net.neoforged.neoforge.common.conditions.ICondition> Returns the value of theconditionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodifiersrecord component.intpriority()Returns the value of thepriorityrecord component.net.minecraft.resources.ResourceLocationtarget()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DIRECT_CODEC
-
-
Constructor Details
-
LootTableModification
public LootTableModification(List<net.neoforged.neoforge.common.conditions.ICondition> conditions, net.minecraft.resources.ResourceLocation target, int priority, List<ILootTableModifier> modifiers) Creates an instance of aLootTableModificationrecord class.- Parameters:
conditions- the value for theconditionsrecord componenttarget- the value for thetargetrecord componentpriority- the value for thepriorityrecord componentmodifiers- the value for themodifiersrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<LootTableModification>
-
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 '=='. -
conditions
Returns the value of theconditionsrecord component.- Returns:
- the value of the
conditionsrecord component
-
target
public net.minecraft.resources.ResourceLocation target()Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-