Class TagItemCost

java.lang.Object
com.minecolonies.api.research.costs.TagItemCost
All Implemented Interfaces:
IResearchCost

public class TagItemCost extends Object implements IResearchCost
A plain item cost that takes a list of several items that have to be fulfilled.
  • Constructor Details

    • TagItemCost

      public TagItemCost(net.minecraft.nbt.CompoundTag compound)
      Create a simple item cost.
      Parameters:
      compound - the nbt containing the relevant data.
    • TagItemCost

      public TagItemCost(com.google.gson.JsonObject json)
      Create a simple item cost.
      Parameters:
      json - the nbt containing the relevant data.
  • Method Details

    • getType

      Description copied from interface: IResearchCost
      The type for this cost.
      Specified by:
      getType in interface IResearchCost
      Returns:
      the type.
    • getItems

      public List<net.minecraft.world.item.Item> getItems()
      Description copied from interface: IResearchCost
      Get the list of items for this cost.
      Specified by:
      getItems in interface IResearchCost
      Returns:
      the list of items.
    • getCount

      public int getCount()
      Description copied from interface: IResearchCost
      Get the count for this cost.
      Specified by:
      getCount in interface IResearchCost
      Returns:
      the count.
    • getTranslatedName

      public net.minecraft.network.chat.Component getTranslatedName()
      Description copied from interface: IResearchCost
      Get the translated text for this research cost.
      Specified by:
      getTranslatedName in interface IResearchCost
      Returns:
      the translated text.
    • writeToNBT

      public net.minecraft.nbt.CompoundTag writeToNBT()
      Description copied from interface: IResearchCost
      Write the research cost to nbt data.
      Specified by:
      writeToNBT in interface IResearchCost
      Returns:
      the nbt data.