Class BuildingCowboy.HerdingModule
java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.AnimalHerdingModule
com.minecolonies.core.colony.buildings.workerbuildings.BuildingCowboy.HerdingModule
- All Implemented Interfaces:
IBuildingEventsModule,IBuildingModule,IHasRequiredItemsModule,IPersistentModule,IHasDirty
- Enclosing class:
- BuildingCowboy
public static class BuildingCowboy.HerdingModule
extends AnimalHerdingModule
implements IBuildingEventsModule, IPersistentModule
Cow (and Mooshroom) herding module
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
building, isDirty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) Deserialize the module.@NotNull List<IGenericRecipe>getRecipesForDisplayPurposesOnly(@NotNull net.minecraft.world.entity.animal.Animal animal) Get a list of "recipes" for items obtainable by herding the given animal.Override this method if you want to keep an amount of items in inventory.voidonMilked()Called to record successful milking.voidonStewed()Called to record successful stewing.voidonWakeUp()Specific wakeup hook in modules.voidserializeNBT(@NotNull net.minecraft.nbt.CompoundTag compound) Serialize the module from a compound.Methods inherited from class com.minecolonies.core.colony.buildings.modules.AnimalHerdingModule
getBreedingItems, getHerdingJob, getLootTables, isCompatible, reservedStacksExcludingMethods inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
checkDirty, clearDirty, getBuilding, getProducer, markDirty, setBuilding, 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.IBuildingEventsModule
onDestroyed, onPlayerEnterBuilding, onUpgradeCompleteMethods inherited from interface com.minecolonies.api.colony.buildings.modules.IBuildingModule
getBuilding, getProducer, serializeToView, serializeToView, setBuilding, setProducerMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirtyMethods inherited from interface com.minecolonies.api.colony.buildings.modules.IHasRequiredItemsModule
reservedStacks
-
Constructor Details
-
HerdingModule
public HerdingModule()
-
-
Method Details
-
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 classAnimalHerdingModule- Returns:
- a list of objects which should be kept.
-
getRecipesForDisplayPurposesOnly
@NotNull public @NotNull List<IGenericRecipe> getRecipesForDisplayPurposesOnly(@NotNull @NotNull net.minecraft.world.entity.animal.Animal animal) Description copied from class:AnimalHerdingModuleGet a list of "recipes" for items obtainable by herding the given animal. This can include loot drops for killing the animal as well as anything else acquired through other means. These are purely for JEI display purposes and don't have to represent actual crafting recipes.- Overrides:
getRecipesForDisplayPurposesOnlyin classAnimalHerdingModule- Parameters:
animal- An example animal. (Don't use specific properties of this; it's only for checking type.)- Returns:
- the list of additional display recipes.
-
serializeNBT
public void serializeNBT(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Description copied from interface:IPersistentModuleSerialize the module from a compound.- Specified by:
serializeNBTin interfaceIPersistentModule- Parameters:
compound- the compound.
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) Description copied from interface:IPersistentModuleDeserialize the module.- Specified by:
deserializeNBTin interfaceIPersistentModule- Parameters:
compound- the nbt compound.
-
onWakeUp
public void onWakeUp()Description copied from interface:IBuildingEventsModuleSpecific wakeup hook in modules.- Specified by:
onWakeUpin interfaceIBuildingEventsModule
-
canTryToMilk
public boolean canTryToMilk()- Returns:
- true if the cowboy should be allowed to try to milk (not yet reached limit)
-
canTryToStew
public boolean canTryToStew()- Returns:
- true if the cowboy should be allowed to try to collect stew (not yet reached limit)
-
onMilked
public void onMilked()Called to record successful milking. -
onStewed
public void onStewed()Called to record successful stewing.
-