Class EquipmentTypeEntry

java.lang.Object
com.minecolonies.api.equipment.registry.EquipmentTypeEntry

public final class EquipmentTypeEntry extends Object
An entry in the EquipmentType registry that defines the types of equipment within the colony.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A builder that can construct new EquipmentTypeEntries.
    static class 
    The comparator used to compare two EquipmentTypeEntries.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkIsEquipment(net.minecraft.world.item.ItemStack itemStack)
    Determine whether an item stack works as this equipment.
    net.minecraft.network.chat.Component
    Get the display name of the equipment type
    int
    getMiningLevel(net.minecraft.world.item.ItemStack itemStack)
    Get the item level for this equipment type for a given item stack
    net.minecraft.resources.ResourceLocation
    Get the name of the forge registry location for the equipment type
    static net.minecraft.resources.ResourceLocation
    Parse a resource location from a serialized version for EquipmentTypes.
    static net.minecraft.resources.ResourceLocation
    parseResourceLocation(net.minecraft.resources.ResourceLocation serialized)
    Parse a resource location from a serialized version for EquipmentTypes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parseResourceLocation

      public static net.minecraft.resources.ResourceLocation parseResourceLocation(String 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 - 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