Package dev.jaxydog.astral.utility
Record Class CurrencyHelper.Skeleton
java.lang.Object
java.lang.Record
dev.jaxydog.astral.utility.CurrencyHelper.Skeleton
- Record Components:
itemId- The representing item's identifier.requires- A list of required rewards to create this skeleton.
- All Implemented Interfaces:
CurrencyHelper.ItemRepresentable
- Enclosing interface:
CurrencyHelper
public static record CurrencyHelper.Skeleton(net.minecraft.util.Identifier itemId, List<net.minecraft.util.Identifier> requires)
extends Record
implements CurrencyHelper.ItemRepresentable
An item created using multiple reward items.
- Since:
- 2.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CurrencyHelper.CurrencyMap<CurrencyHelper.Skeleton> A map containing all currently active currency skeletons. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.util.IdentifierReturns the associated item identifier, orminecraft:airif the referenced identifier is invalid.Returns a list of required reward entries.final inthashCode()Returns a hash code value for this object.booleanhasRequirements(Map<CurrencyHelper.Reward, Integer> rewardCounts) Returns whether the provided count map contains the required number of rewards to craft this skeleton.net.minecraft.util.IdentifieritemId()Returns the value of theitemIdrecord component.static CurrencyHelper.Skeletonparse(net.minecraft.util.Identifier itemId, com.google.gson.JsonObject object) Parses a JSON object and creates a newCurrencyHelper.Skeletonfrom the resolved data.List<net.minecraft.util.Identifier> requires()Returns the value of therequiresrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.utility.CurrencyHelper.ItemRepresentable
getItem
-
Field Details
-
SKELETONS
A map containing all currently active currency skeletons.- Since:
- 2.0.0
-
-
Constructor Details
-
Method Details
-
parse
public static CurrencyHelper.Skeleton parse(net.minecraft.util.Identifier itemId, com.google.gson.JsonObject object) throws com.google.gson.JsonSyntaxException Parses a JSON object and creates a newCurrencyHelper.Skeletonfrom the resolved data.- Parameters:
itemId- The representing item's identifier.object- The JSON object.- Returns:
- A new reward.
- Throws:
com.google.gson.JsonSyntaxException- If a field is invalid or missing from the given object.- Since:
- 2.0.0
-
getRequirements
Returns a list of required reward entries.If a requirement's identifier is not found it will be ignored.
- Returns:
- A list of required rewards.
- Since:
- 2.0.0
-
hasRequirements
Returns whether the provided count map contains the required number of rewards to craft this skeleton.- Parameters:
rewardCounts- A map containing the number of each held reward.- Returns:
- Whether the provided count map contains the required number of rewards to craft this skeleton.
- Since:
- 2.0.0
-
getItemId
public net.minecraft.util.Identifier getItemId()Description copied from interface:CurrencyHelper.ItemRepresentableReturns the associated item identifier, orminecraft:airif the referenced identifier is invalid.- Specified by:
getItemIdin interfaceCurrencyHelper.ItemRepresentable- Returns:
- The associated item identifier, or
minecraft:airif the referenced identifier is invalid.
-
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). -
itemId
public net.minecraft.util.Identifier itemId()Returns the value of theitemIdrecord component.- Returns:
- the value of the
itemIdrecord component
-
requires
Returns the value of therequiresrecord component.- Returns:
- the value of the
requiresrecord component
-