Package net.minecraftforge.common
Record Class ToolAction
java.lang.Object
java.lang.Record
net.minecraftforge.common.ToolAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<String, ToolAction> static final com.mojang.serialization.Codec<ToolAction> private final StringThe field for thenamerecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
name
The field for thenamerecord component. -
CODEC
-
ACTIONS
-
-
Constructor Details
-
ToolAction
Useget(String)to get or create a ToolAction
-
-
Method Details
-
getActions
Returns all registered actions. This collection can be kept around, and will update itself in response to changes to the map. SeeConcurrentHashMap.values()for details. -
get
Gets or creates a new ToolAction for the given name. -
name
Returns the name of this tool action -
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).
-