Record Class ToolUsage
java.lang.Object
java.lang.Record
com.minecolonies.core.colony.crafting.ToolUsage
- Record Components:
tool- the tool typetoolLevels- basic items accepted at each building level.enchantedToolLevels- (some) enchanted items accepted at each building level.
public record ToolUsage(@NotNull EquipmentTypeEntry tool, @NotNull List<List<net.minecraft.world.item.ItemStack>> toolLevels, @NotNull List<List<net.minecraft.world.item.ItemStack>> enchantedToolLevels)
extends Record
Describes a tool and its level compatibility.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ToolUsagecreate(@NotNull EquipmentTypeEntry tool) Returns the value of theenchantedToolLevelsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull EquipmentTypeEntrytool()Returns the value of thetoolrecord component.Returns the value of thetoolLevelsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ToolUsage
public ToolUsage(@NotNull @NotNull EquipmentTypeEntry tool, @NotNull @NotNull List<List<net.minecraft.world.item.ItemStack>> toolLevels, @NotNull @NotNull List<List<net.minecraft.world.item.ItemStack>> enchantedToolLevels) Creates an instance of aToolUsagerecord class.- Parameters:
tool- the value for thetoolrecord componenttoolLevels- the value for thetoolLevelsrecord componentenchantedToolLevels- the value for theenchantedToolLevelsrecord component
-
-
Method Details
-
create
-
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). -
tool
Returns the value of thetoolrecord component.- Returns:
- the value of the
toolrecord component
-
toolLevels
Returns the value of thetoolLevelsrecord component.- Returns:
- the value of the
toolLevelsrecord component
-
enchantedToolLevels
Returns the value of theenchantedToolLevelsrecord component.- Returns:
- the value of the
enchantedToolLevelsrecord component
-