Class BuildingAlternatesResearchRequirement

java.lang.Object
com.minecolonies.api.research.requirements.BuildingAlternatesResearchRequirement
All Implemented Interfaces:
IResearchRequirement

public class BuildingAlternatesResearchRequirement extends Object implements IResearchRequirement
Requires one out of a list of buildings to be present.
  • Constructor Details

    • BuildingAlternatesResearchRequirement

      public BuildingAlternatesResearchRequirement(net.minecraft.nbt.CompoundTag nbt)
      Create an alternate building research requirement.
      Parameters:
      nbt - the nbt containing the relevant data.
    • BuildingAlternatesResearchRequirement

      public BuildingAlternatesResearchRequirement(com.google.gson.JsonObject json)
      Create an alternate building research requirement.
      Parameters:
      json - the json containing the relevant data.
  • Method Details

    • getBuildings

      public Set<net.minecraft.resources.ResourceLocation> getBuildings()
      Get the set of required buildings. Only one must be met to unlock the research.
      Returns:
      the building description
    • getBuildingLevel

      public int getBuildingLevel()
      Returns:
      the building level
    • getRegistryEntry

      Description copied from interface: IResearchRequirement
      Get the ModResearchRequirements.ResearchRequirementEntry for this Research Requirement.
      Specified by:
      getRegistryEntry in interface IResearchRequirement
      Returns:
      a registry entry.
    • getDesc

      public net.minecraft.network.chat.MutableComponent getDesc()
      Description copied from interface: IResearchRequirement
      Get a human-readable description of the requirement, or a translation key.
      Specified by:
      getDesc in interface IResearchRequirement
      Returns:
      translation text component.
    • isFulfilled

      public boolean isFulfilled(IColony colony)
      Description copied from interface: IResearchRequirement
      Check if this requirement is fulfilled for a certain colony.
      Specified by:
      isFulfilled in interface IResearchRequirement
      Parameters:
      colony - the colony to check.
      Returns:
      true if so.
    • writeToNBT

      public net.minecraft.nbt.CompoundTag writeToNBT()
      Description copied from interface: IResearchRequirement
      Write the ResearchRequirement's traits to NBT, to simplify serialization for client-viewable data.
      Specified by:
      writeToNBT in interface IResearchRequirement
      Returns:
      an NBT file which must, at minimum, contain the necessary traits to reassemble the effect.