Class EquipmentTypeEntry
java.lang.Object
com.minecolonies.api.equipment.registry.EquipmentTypeEntry
An entry in the EquipmentType registry that defines the types of
equipment within the colony.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder that can construct new EquipmentTypeEntries.static classThe comparator used to compare two EquipmentTypeEntries. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIsEquipment(net.minecraft.world.item.ItemStack itemStack) Determine whether an item stack works as this equipment.net.minecraft.network.chat.ComponentGet the display name of the equipment typeintgetMiningLevel(net.minecraft.world.item.ItemStack itemStack) Get the item level for this equipment type for a given item stacknet.minecraft.resources.ResourceLocationGet the name of the forge registry location for the equipment typestatic net.minecraft.resources.ResourceLocationparseResourceLocation(String serialized) Parse a resource location from a serialized version for EquipmentTypes.static net.minecraft.resources.ResourceLocationparseResourceLocation(net.minecraft.resources.ResourceLocation serialized) Parse a resource location from a serialized version for EquipmentTypes.
-
Method Details
-
parseResourceLocation
Parse a resource location from a serialized version for EquipmentTypes. This is to help migrate to the new EquipmentType serialization which originally used names and now uses resource locations.- Parameters:
serialized- the string representation of the equipment type- Returns:
- the correct resource location
-
parseResourceLocation
public static net.minecraft.resources.ResourceLocation parseResourceLocation(net.minecraft.resources.ResourceLocation serialized) Parse a resource location from a serialized version for EquipmentTypes. This is to help migrate to the new EquipmentType serialization which originally used names and now uses resource locations.- Parameters:
serialized- A resource location read from nbt- Returns:
- the correct resource location
-
getRegistryName
public net.minecraft.resources.ResourceLocation getRegistryName()Get the name of the forge registry location for the equipment type- Returns:
- the resource location
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName()Get the display name of the equipment type- Returns:
- the component for the human-readable name.
-
checkIsEquipment
public boolean checkIsEquipment(net.minecraft.world.item.ItemStack itemStack) Determine whether an item stack works as this equipment.- Parameters:
itemStack- to test- Returns:
- whether the item stack can act as the equipment.
-
getMiningLevel
public int getMiningLevel(net.minecraft.world.item.ItemStack itemStack) Get the item level for this equipment type for a given item stack- Parameters:
itemStack- to test- Returns:
- the item level
-