Record Class ConditionAddAction
java.lang.Object
java.lang.Record
top.offsetmonkey538.loottablemodifier.common.api.resource.action.condition.ConditionAddAction
- Record Components:
conditions- the conditions to addincludePools- whether the conditions should be added to matched poolsincludeEntries- whether the conditions should be added to matched pools
- All Implemented Interfaces:
LootModifierAction
public record ConditionAddAction(List<LootCondition> conditions, boolean includePools, boolean includeEntries)
extends Record
implements LootModifierAction
Adds the provided conditions to matched pools/entries
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ConditionAddAction>Fields inherited from interface top.offsetmonkey538.loottablemodifier.common.api.resource.action.LootModifierAction
MODIFIED_ENTRY, MODIFIED_NONE, MODIFIED_POOL, MODIFIED_TABLE -
Constructor Summary
ConstructorsConstructorDescriptionConditionAddAction(List<LootCondition> conditions, boolean includePools, boolean includeEntries) Creates an instance of aConditionAddActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintapply(@NotNull LootModifierContext context) Applies this action to the provided contextstatic ConditionAddAction.Builderbuilder()Creates a builder forConditionAddActionReturns the value of theconditionsrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()Returns the type of this action.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theincludeEntriesrecord component.booleanReturns the value of theincludePoolsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ConditionAddAction
public ConditionAddAction(List<LootCondition> conditions, boolean includePools, boolean includeEntries) Creates an instance of aConditionAddActionrecord class.- Parameters:
conditions- the value for theconditionsrecord componentincludePools- the value for theincludePoolsrecord componentincludeEntries- the value for theincludeEntriesrecord component
-
-
Method Details
-
getType
Description copied from interface:LootModifierActionReturns the type of this action.- Specified by:
getTypein interfaceLootModifierAction- Returns:
- the
typeof this action.
-
apply
Description copied from interface:LootModifierActionApplies this action to the provided context- Specified by:
applyin interfaceLootModifierAction- Parameters:
context- the context to apply to- Returns:
- the applied modification level
- See Also:
-
builder
Creates a builder forConditionAddAction- Returns:
- a new
ConditionAddAction.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 '=='. -
conditions
Returns the value of theconditionsrecord component.- Returns:
- the value of the
conditionsrecord component
-
includePools
public boolean includePools()Returns the value of theincludePoolsrecord component.- Returns:
- the value of the
includePoolsrecord component
-
includeEntries
public boolean includeEntries()Returns the value of theincludeEntriesrecord component.- Returns:
- the value of the
includeEntriesrecord component
-