Class BuildingDyer.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.BuildingDyer.CraftingModule
- All Implemented Interfaces:
IBuildingModule,ICraftingBuildingModule,ICreatesResolversModule,IHasRequiredItemsModule,IPersistentModule,ITickingModule,IHasDirty
- Enclosing class:
- BuildingDyer
-
Nested Class Summary
Nested classes/interfaces inherited from class com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule
AbstractCraftingBuildingModule.Brewing, AbstractCraftingBuildingModule.Crafting, AbstractCraftingBuildingModule.Custom, 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 List<IGenericRecipe>getAdditionalRecipesForDisplayPurposesOnly(@NotNull net.minecraft.world.level.Level world) Generates any additional special recipes supported by this crafter.getFirstFulfillableRecipe(Predicate<net.minecraft.world.item.ItemStack> stackPredicate, int count, boolean considerReservation) Get a fullfillable recipe to execute.getFirstRecipe(Predicate<net.minecraft.world.item.ItemStack> stackPredicate) Check if is the worker has the knowledge to craft something.@NotNull OptionalPredicate<net.minecraft.world.item.ItemStack>Gets a predicate for recipe ingredients that are explicitly allowed or banned at this building.booleanholdsRecipe(IToken<?> token) Check if the recipe it part of this module.voidimproveRecipe(IRecipeStorage recipe, int count, ICitizenData citizen) Randomly improve a certain recipe.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
getId, getSupportedCraftingTypesMethods inherited from class com.minecolonies.core.colony.buildings.modules.AbstractCraftingBuildingModule
addRecipe, addRecipeToList, canLearnManyRecipes, canRecipeBeAdded, checkForWorkerSpecificRecipes, clearRecipes, createResolvers, deserializeNBT, fullFillRecipe, getCraftingJob, getCraftingLuck, getCraftingTool, getCustomRecipeKey, getFirstRecipe, getMaxRecipes, getRecipes, getRequiredItemsAndAmount, getWarehouseCount, handleRecipeUpdate, 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.
-
improveRecipe
Description copied from interface:ICraftingBuildingModuleRandomly improve a certain recipe.- Specified by:
improveRecipein interfaceICraftingBuildingModule- Overrides:
improveRecipein classAbstractCraftingBuildingModule- Parameters:
recipe- the recipe to improve.count- the craft counter.citizen- the citizen running it.
-
getAdditionalRecipesForDisplayPurposesOnly
@NotNull public @NotNull List<IGenericRecipe> getAdditionalRecipesForDisplayPurposesOnly(@NotNull @NotNull net.minecraft.world.level.Level world) Description copied from interface:ICraftingBuildingModuleGenerates any additional special recipes supported by this crafter. Unlike the above, these are not added to the building's learned recipe list; they are only used for display purposes such as the JEI lookup. This is intended for things that the worker AI can do by itself without any explicit recipe (neither taught nor loaded).- Specified by:
getAdditionalRecipesForDisplayPurposesOnlyin interfaceICraftingBuildingModule- Overrides:
getAdditionalRecipesForDisplayPurposesOnlyin classAbstractCraftingBuildingModule- Returns:
- The list of additional recipes.
-
getFirstRecipe
Description copied from interface:ICraftingBuildingModuleCheck if is the worker has the knowledge to craft something.- Specified by:
getFirstRecipein interfaceICraftingBuildingModule- Overrides:
getFirstRecipein classAbstractCraftingBuildingModule- Parameters:
stackPredicate- the predicate to check for fullfillment.- Returns:
- the recipe storage if so.
-
holdsRecipe
Description copied from interface:ICraftingBuildingModuleCheck if the recipe it part of this module.- Specified by:
holdsRecipein interfaceICraftingBuildingModule- Overrides:
holdsRecipein classAbstractCraftingBuildingModule- Parameters:
token- the recipe token to check.- Returns:
- true if so.
-
getFirstFulfillableRecipe
public IRecipeStorage getFirstFulfillableRecipe(Predicate<net.minecraft.world.item.ItemStack> stackPredicate, int count, boolean considerReservation) Description copied from interface:ICraftingBuildingModuleGet a fullfillable recipe to execute.- Specified by:
getFirstFulfillableRecipein interfaceICraftingBuildingModule- Overrides:
getFirstFulfillableRecipein classAbstractCraftingBuildingModule- Parameters:
stackPredicate- the predicate to check for fullfillment.count- the count to produce.considerReservation- if reservations should be considered.- Returns:
- the recipe or null.
-