Package net.minecraftforge.common
Record Class ToolAction
java.lang.Object
java.lang.Record
net.minecraftforge.common.ToolAction
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Map
<String, ToolAction> static final com.mojang.serialization.Codec
<ToolAction> private final String
The field for thename
record component. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static ToolAction
Gets or creates a new ToolAction for the given name.static Collection
<ToolAction> Returns all registered actions.final int
hashCode()
Returns a hash code value for this object.name()
Returns the name of this tool actionfinal String
toString()
Returns a string representation of this record class.
-
Field Details
-
name
The field for thename
record 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)
.
-