use of com.minecolonies.coremod.colony.buildings.moduleviews.CraftingModuleView in project minecolonies by ldtteam.
the class AbstractTeachingGuiHandler method getRecipeCategory.
@Nullable
protected JobBasedRecipeCategory<?> getRecipeCategory(@NotNull final AbstractBuildingView view) {
for (final CraftingModuleView moduleView : view.getModuleViews(CraftingModuleView.class)) {
if (!isSupportedCraftingModule(moduleView))
continue;
final JobEntry jobEntry = moduleView.getJobEntry();
if (jobEntry != null) {
final ResourceLocation uid = ICraftingBuildingModule.getUid(jobEntry, moduleView.getId());
final JobBasedRecipeCategory<?> category = this.categories.get(uid);
if (category != null) {
return category;
}
}
}
return null;
}
use of com.minecolonies.coremod.colony.buildings.moduleviews.CraftingModuleView in project minecolonies by Minecolonies.
the class AbstractTeachingGuiHandler method getRecipeCategory.
@Nullable
protected JobBasedRecipeCategory<?> getRecipeCategory(@NotNull final AbstractBuildingView view) {
for (final CraftingModuleView moduleView : view.getModuleViews(CraftingModuleView.class)) {
if (!isSupportedCraftingModule(moduleView))
continue;
final JobEntry jobEntry = moduleView.getJobEntry();
if (jobEntry != null) {
final ResourceLocation uid = ICraftingBuildingModule.getUid(jobEntry, moduleView.getId());
final JobBasedRecipeCategory<?> category = this.categories.get(uid);
if (category != null) {
return category;
}
}
}
return null;
}
use of com.minecolonies.coremod.colony.buildings.moduleviews.CraftingModuleView in project minecolonies by Minecolonies.
the class RecipeSetting method getValue.
@Override
public IRecipeStorage getValue(final IBuildingView building) {
final CraftingModuleView craftingModule = building.getModuleViewMatching(CraftingModuleView.class, m -> m.getId().equals(craftingModuleId));
for (final IRecipeStorage recipe : craftingModule.getRecipes()) {
if (recipe.getToken().equals(currentIndex)) {
return recipe;
}
}
currentIndex = craftingModule.getRecipes().get(0).getToken();
return craftingModule.getRecipes().get(0);
}
Aggregations