Class BuildingEntry.Builder
java.lang.Object
com.minecolonies.api.colony.buildings.registry.BuildingEntry.Builder
- Enclosing class:
- BuildingEntry
A builder class for
BuildingEntry.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a building module producer.Method used to create the entry.setBuildingBlock(AbstractColonyBlock<?> buildingBlock) Sets the block that represents this building.setBuildingProducer(BiFunction<IColony, net.minecraft.core.BlockPos, IBuilding> buildingProducer) setBuildingViewProducer(Supplier<BiFunction<IColonyView, net.minecraft.core.BlockPos, IBuildingView>> buildingViewProducer) Sets the callback that is used to create theIBuildingViewfrom theIColonyViewand its position in the world.setRegistryName(net.minecraft.resources.ResourceLocation registryName) Sets the registry name for the new building entry.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setBuildingBlock
Sets the block that represents this building.- Parameters:
buildingBlock- The block.- Returns:
- The builder.
-
setBuildingProducer
public BuildingEntry.Builder setBuildingProducer(BiFunction<IColony, net.minecraft.core.BlockPos, IBuilding> buildingProducer) Sets the callback that is used to create theIBuildingfrom theIColonyand its position in the world.- Parameters:
buildingProducer- The callback used to create theIBuilding.- Returns:
- The builder.
-
setBuildingViewProducer
public BuildingEntry.Builder setBuildingViewProducer(Supplier<BiFunction<IColonyView, net.minecraft.core.BlockPos, IBuildingView>> buildingViewProducer) Sets the callback that is used to create theIBuildingViewfrom theIColonyViewand its position in the world.- Parameters:
buildingViewProducer- The callback used to create theIBuildingView.- Returns:
- The builder.
-
setRegistryName
Sets the registry name for the new building entry.- Parameters:
registryName- The name for the registry entry.- Returns:
- The builder.
-
createBuildingEntry
Method used to create the entry.- Returns:
- The entry.
-
addBuildingModuleProducer
Add a building module producer.- Returns:
- the builder again.
-