Package net.minecraftforge.common
Record Class ToolAction
java.lang.Object
java.lang.Record
net.minecraftforge.common.ToolAction
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final Map<String, ToolAction> static final com.mojang.serialization.Codec<ToolAction> private final StringThe field for thenamerecord component.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ToolActionGets or creates a new ToolAction for the given name.static Collection<ToolAction> Returns all registered actions.final inthashCode()Returns a hash code value for this object.name()Returns the name of this tool actionfinal StringtoString()Returns a string representation of this record class.
- 
Field Details- 
nameThe field for thenamerecord component.
- 
CODEC
- 
ACTIONS
 
- 
- 
Constructor Details- 
ToolActionUseget(String)to get or create a ToolAction
 
- 
- 
Method Details- 
getActionsReturns all registered actions. This collection can be kept around, and will update itself in response to changes to the map. SeeConcurrentHashMap.values()for details.
- 
getGets or creates a new ToolAction for the given name.
- 
nameReturns the name of this tool action
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
 
-