Package forgottentowns.mod.api
Record Class TradeProductionRules
java.lang.Object
java.lang.Record
forgottentowns.mod.api.TradeProductionRules
- Record Components:
woodcutting- whether present woodcuttable features supply their basic drops freelygathering- whether present gatherable features supply their basic drops freelydigging- whether biome digging drops are free inputscollections- ordered infrastructure rules granting free collection inputs
public record TradeProductionRules(boolean woodcutting, boolean gathering, boolean digging, List<TradeProductionRules.CollectionInput> collections)
extends Record
Legacy production assumptions retained for compiled mod-core compatibility.
Settlement supply now uses completed packing records and ignores these assumptions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordInfrastructure that supplies a basic collection input without simulating fuel or containers. -
Constructor Summary
ConstructorsConstructorDescriptionTradeProductionRules(boolean woodcutting, boolean gathering, boolean digging, List<TradeProductionRules.CollectionInput> collections) Copies and bounds the authored collection rules. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecollectionsrecord component.booleandigging()Returns the value of thediggingrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thegatheringrecord component.final inthashCode()Returns a hash code value for this object.static TradeProductionRulesParses a manifest-captured JSON object, rejecting misspelled fields.final StringtoString()Returns a string representation of this record class.voidvalidate(RegistryAccess registries) Validates resource and placeable references against the composed registries.booleanReturns the value of thewoodcuttingrecord component.
-
Constructor Details
-
TradeProductionRules
public TradeProductionRules(boolean woodcutting, boolean gathering, boolean digging, List<TradeProductionRules.CollectionInput> collections) Copies and bounds the authored collection rules.- Parameters:
woodcutting- allow naturally present woodcutting dropsgathering- allow naturally present gathering dropsdigging- allow biome digging dropscollections- ordered infrastructure rules- Throws:
IllegalArgumentException- if more than 64 rules are provided or resources repeatNullPointerException- if the list or an entry is null
-
-
Method Details
-
read
Parses a manifest-captured JSON object, rejecting misspelled fields.- Parameters:
value- captured table returned by the mod context- Returns:
- validated estimation policy
- Throws:
IllegalArgumentException- if the table is malformedNullPointerException- if an entry contains a null identifier
-
validate
Validates resource and placeable references against the composed registries.- Parameters:
registries- published content snapshot- Throws:
IllegalArgumentException- if a referenced definition is missing
-
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 '=='. -
woodcutting
public boolean woodcutting()Returns the value of thewoodcuttingrecord component.- Returns:
- the value of the
woodcuttingrecord component
-
gathering
public boolean gathering()Returns the value of thegatheringrecord component.- Returns:
- the value of the
gatheringrecord component
-
digging
public boolean digging()Returns the value of thediggingrecord component.- Returns:
- the value of the
diggingrecord component
-
collections
Returns the value of thecollectionsrecord component.- Returns:
- the value of the
collectionsrecord component
-