use of com.minecolonies.api.colony.buildings.modules.IBuildingModule in project minecolonies by ldtteam.
the class BuildingEntry method produceBuilding.
public IBuilding produceBuilding(final BlockPos position, final IColony colony) {
final IBuilding building = buildingProducer.apply(colony, position);
for (final Supplier<IBuildingModule> module : buildingModuleProducers) {
building.registerModule(module.get().setBuilding(building));
}
building.setBuildingType(this);
return building;
}
use of com.minecolonies.api.colony.buildings.modules.IBuildingModule in project minecolonies by ldtteam.
the class JEIPlugin method registerCategories.
@Override
public void registerCategories(@NotNull final IRecipeCategoryRegistration registration) {
final IJeiHelpers jeiHelpers = registration.getJeiHelpers();
final IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
registration.addRecipeCategories(new CompostRecipeCategory(guiHelper));
registration.addRecipeCategories(new FishermanRecipeCategory(guiHelper));
categories.clear();
for (final BuildingEntry building : IMinecoloniesAPI.getInstance().getBuildingRegistry()) {
for (final Supplier<IBuildingModule> producer : building.getModuleProducers()) {
final IBuildingModule module = producer.get();
if (module instanceof ICraftingBuildingModule) {
final ICraftingBuildingModule crafting = (ICraftingBuildingModule) module;
final IJob<?> job = crafting.getCraftingJob();
if (job != null) {
registerCategory(registration, new GenericRecipeCategory(building, job, crafting, guiHelper));
}
}
if (module instanceof AnimalHerdingModule) {
final AnimalHerdingModule herding = (AnimalHerdingModule) module;
registerCategory(registration, new HerderRecipeCategory(building, herding.getHerdingJob(), herding, guiHelper));
}
}
}
}
use of com.minecolonies.api.colony.buildings.modules.IBuildingModule in project minecolonies by Minecolonies.
the class BuildingEntry method produceBuilding.
public IBuilding produceBuilding(final BlockPos position, final IColony colony) {
final IBuilding building = buildingProducer.apply(colony, position);
for (final Supplier<IBuildingModule> module : buildingModuleProducers) {
building.registerModule(module.get().setBuilding(building));
}
building.setBuildingType(this);
return building;
}
use of com.minecolonies.api.colony.buildings.modules.IBuildingModule in project minecolonies by Minecolonies.
the class JEIPlugin method registerCategories.
@Override
public void registerCategories(@NotNull final IRecipeCategoryRegistration registration) {
final IJeiHelpers jeiHelpers = registration.getJeiHelpers();
final IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
final IModIdHelper modIdHelper = jeiHelpers.getModIdHelper();
registration.addRecipeCategories(new CompostRecipeCategory(guiHelper));
registration.addRecipeCategories(new FishermanRecipeCategory(guiHelper));
categories.clear();
for (final BuildingEntry building : IMinecoloniesAPI.getInstance().getBuildingRegistry()) {
for (final Supplier<IBuildingModule> producer : building.getModuleProducers()) {
final IBuildingModule module = producer.get();
if (module instanceof ICraftingBuildingModule) {
final ICraftingBuildingModule crafting = (ICraftingBuildingModule) module;
final IJob<?> job = crafting.getCraftingJob();
if (job != null) {
registerCategory(registration, new GenericRecipeCategory(building, job, crafting, guiHelper, modIdHelper));
}
}
if (module instanceof AnimalHerdingModule) {
final AnimalHerdingModule herding = (AnimalHerdingModule) module;
registerCategory(registration, new HerderRecipeCategory(building, herding.getHerdingJob(), herding, guiHelper));
}
}
}
}
Aggregations