Class BuildingAlternatesResearchRequirement
java.lang.Object
com.minecolonies.api.research.requirements.BuildingAlternatesResearchRequirement
- All Implemented Interfaces:
IResearchRequirement
Requires one out of a list of buildings to be present.
-
Constructor Summary
ConstructorsConstructorDescriptionBuildingAlternatesResearchRequirement(com.google.gson.JsonObject json) Create an alternate building research requirement.BuildingAlternatesResearchRequirement(net.minecraft.nbt.CompoundTag nbt) Create an alternate building research requirement. -
Method Summary
Modifier and TypeMethodDescriptionintSet<net.minecraft.resources.ResourceLocation>Get the set of required buildings.net.minecraft.network.chat.MutableComponentgetDesc()Get a human-readable description of the requirement, or a translation key.Get theModResearchRequirements.ResearchRequirementEntryfor this Research Requirement.booleanisFulfilled(IColony colony) Check if this requirement is fulfilled for a certain colony.net.minecraft.nbt.CompoundTagWrite the ResearchRequirement's traits to NBT, to simplify serialization for client-viewable data.
-
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
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:IResearchRequirementGet theModResearchRequirements.ResearchRequirementEntryfor this Research Requirement.- Specified by:
getRegistryEntryin interfaceIResearchRequirement- Returns:
- a registry entry.
-
getDesc
public net.minecraft.network.chat.MutableComponent getDesc()Description copied from interface:IResearchRequirementGet a human-readable description of the requirement, or a translation key.- Specified by:
getDescin interfaceIResearchRequirement- Returns:
- translation text component.
-
isFulfilled
Description copied from interface:IResearchRequirementCheck if this requirement is fulfilled for a certain colony.- Specified by:
isFulfilledin interfaceIResearchRequirement- Parameters:
colony- the colony to check.- Returns:
- true if so.
-
writeToNBT
public net.minecraft.nbt.CompoundTag writeToNBT()Description copied from interface:IResearchRequirementWrite the ResearchRequirement's traits to NBT, to simplify serialization for client-viewable data.- Specified by:
writeToNBTin interfaceIResearchRequirement- Returns:
- an NBT file which must, at minimum, contain the necessary traits to reassemble the effect.
-