Class BuildingBaker.CraftingModule
java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule
com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule.Crafting
com.minecolonies.core.colony.buildings.workerbuildings.BuildingBaker.CraftingModule
- All Implemented Interfaces:
IBuildingModule,ICraftingBuildingModule,ICreatesResolversModule,IHasRequiredItemsModule,IPersistentModule,ITickingModule,IHasDirty
- Enclosing class:
BuildingBaker
-
Nested Class Summary
Nested classes/interfaces inherited from class com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule
AbstractCraftingBuildingModule.Brewing, AbstractCraftingBuildingModule.Crafting, AbstractCraftingBuildingModule.Custom, AbstractCraftingBuildingModule.Domum, AbstractCraftingBuildingModule.Smelting -
Field Summary
Fields inherited from class com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule
building, disabledRecipes, jobEntry, RECIPE_MODE, recipesFields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
isDirty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull OptionalPredicate<net.minecraft.world.item.ItemStack> Gets a predicate for recipe ingredients that are explicitly allowed or banned at this building.Override this method if you want to keep an amount of items in inventory.Get the supported crafting types.booleanisRecipeCompatible(@NotNull IGenericRecipe recipe) Checks if this particular recipe is *possible* to be learned by this building (or otherwise possible to be crafted there).Methods inherited from class com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule.Crafting
getIdMethods inherited from class com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule
addRecipe, addRecipeToList, canLearnManyRecipes, canRecipeBeAdded, checkForWorkerSpecificRecipes, clearRecipes, createResolvers, deserializeNBT, fullFillRecipe, getAdditionalRecipesForDisplayPurposesOnly, getCraftingJob, getCraftingLuck, getCraftingTool, getCustomRecipeKey, getFirstFulfillableRecipe, getFirstRecipe, getFirstRecipe, getMaxRecipes, getRecipes, getWarehouseCount, handleRecipeUpdate, holdsRecipe, improveRecipe, isDisabled, isPreTaughtRecipe, isRecipeCompatibleWithCraftingModule, isVisible, onColonyTick, removeRecipe, replaceRecipe, reservedStacksExcluding, serializeNBT, serializeToView, setBuilding, switchOrder, toggle, updateWorkerAvailableForRecipesMethods inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
checkDirty, clearDirty, getBuilding, getProducer, markDirty, setProducerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.modules.IBuildingModule
getBuilding, getProducer, serializeToView, setProducerMethods inherited from interface com.minecolonies.api.colony.buildings.modules.ICraftingBuildingModule
canLearn, getAdditionalLootTables, getUidMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirtyMethods inherited from interface com.minecolonies.api.colony.buildings.modules.IHasRequiredItemsModule
reservedStacks
-
Constructor Details
-
CraftingModule
Create a new module.- Parameters:
jobEntry- the entry of the job.
-
-
Method Details
-
getIngredientValidator
@NotNull public @NotNull OptionalPredicate<net.minecraft.world.item.ItemStack> getIngredientValidator()Description copied from interface:ICraftingBuildingModuleGets a predicate for recipe ingredients that are explicitly allowed or banned at this building. Used to reduce false negatives fromICraftingBuildingModule.isRecipeCompatible(com.minecolonies.api.crafting.IGenericRecipe)when alternatives are available.- Specified by:
getIngredientValidatorin interfaceICraftingBuildingModule- Overrides:
getIngredientValidatorin classAbstractCraftingBuildingModule- Returns:
- A predicate that returns true when the ingredient is definitely allowed, false when definitely banned, or empty when undecided.
-
isRecipeCompatible
Description copied from interface:ICraftingBuildingModuleChecks if this particular recipe is *possible* to be learned by this building (or otherwise possible to be crafted there). This is checked without regard to specific colony or level of building, or whether there are spare recipe slots or not.- Specified by:
isRecipeCompatiblein interfaceICraftingBuildingModule- Overrides:
isRecipeCompatiblein classAbstractCraftingBuildingModule.Crafting- Parameters:
recipe- The recipe to check.- Returns:
- True if this recipe could be produced/taught.
-
getSupportedCraftingTypes
Description copied from interface:ICraftingBuildingModuleGet the supported crafting types.- Specified by:
getSupportedCraftingTypesin interfaceICraftingBuildingModule- Overrides:
getSupportedCraftingTypesin classAbstractCraftingBuildingModule.Crafting- Returns:
- a set of types.
-
getRequiredItemsAndAmount
public Map<Predicate<net.minecraft.world.item.ItemStack>,net.minecraft.util.Tuple<Integer, getRequiredItemsAndAmount()Boolean>> Description copied from interface:IHasRequiredItemsModuleOverride this method if you want to keep an amount of items in inventory. When the inventory is full, everything get's dumped into the building chest. But you can use this method to hold some stacks back.- Specified by:
getRequiredItemsAndAmountin interfaceIHasRequiredItemsModule- Overrides:
getRequiredItemsAndAmountin classAbstractCraftingBuildingModule- Returns:
- a list of objects which should be kept.
-