Record Class VanillaItemCodecs.Tool
java.lang.Object
java.lang.Record
net.rebel459.unified.api.registry.VanillaItemCodecs.Tool
- Enclosing class:
VanillaItemCodecs
public static record VanillaItemCodecs.Tool(net.minecraft.world.item.ToolMaterial material, float damageBaseline, float speedBaseline)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<VanillaItemCodecs.Tool> -
Constructor Summary
ConstructorsConstructorDescriptionTool(net.minecraft.world.item.ToolMaterial material, float damageBaseline, float speedBaseline) Creates an instance of aToolrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thedamageBaselinerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ToolMaterialmaterial()Returns the value of thematerialrecord component.floatReturns the value of thespeedBaselinerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Tool
public Tool(net.minecraft.world.item.ToolMaterial material, float damageBaseline, float speedBaseline) Creates an instance of aToolrecord class.- Parameters:
material- the value for thematerialrecord componentdamageBaseline- the value for thedamageBaselinerecord componentspeedBaseline- the value for thespeedBaselinerecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
material
public net.minecraft.world.item.ToolMaterial material()Returns the value of thematerialrecord component.- Returns:
- the value of the
materialrecord component
-
damageBaseline
public float damageBaseline()Returns the value of thedamageBaselinerecord component.- Returns:
- the value of the
damageBaselinerecord component
-
speedBaseline
public float speedBaseline()Returns the value of thespeedBaselinerecord component.- Returns:
- the value of the
speedBaselinerecord component
-