Class BuildingEntry.Builder

java.lang.Object
com.minecolonies.api.colony.buildings.registry.BuildingEntry.Builder
Enclosing class:
BuildingEntry

public static final class BuildingEntry.Builder extends Object
A builder class for BuildingEntry.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setBuildingBlock

      public BuildingEntry.Builder setBuildingBlock(AbstractColonyBlock<?> buildingBlock)
      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 the IBuilding from the IColony and its position in the world.
      Parameters:
      buildingProducer - The callback used to create the IBuilding.
      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 the IBuildingView from the IColonyView and its position in the world.
      Parameters:
      buildingViewProducer - The callback used to create the IBuildingView.
      Returns:
      The builder.
    • setRegistryName

      public BuildingEntry.Builder setRegistryName(net.minecraft.resources.ResourceLocation registryName)
      Sets the registry name for the new building entry.
      Parameters:
      registryName - The name for the registry entry.
      Returns:
      The builder.
    • createBuildingEntry

      public BuildingEntry createBuildingEntry()
      Method used to create the entry.
      Returns:
      The entry.
    • addBuildingModuleProducer

      public BuildingEntry.Builder addBuildingModuleProducer(BuildingEntry.ModuleProducer moduleSet)
      Add a building module producer.
      Returns:
      the builder again.