Class 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
  • Constructor Details

    • HerdingModule

      public HerdingModule()
  • Method Details

    • getRequiredItemsAndAmount

      public Map<Predicate<net.minecraft.world.item.ItemStack>,net.minecraft.util.Tuple<Integer,Boolean>> getRequiredItemsAndAmount()
      Description copied from interface: IHasRequiredItemsModule
      Override 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:
      getRequiredItemsAndAmount in interface IHasRequiredItemsModule
      Overrides:
      getRequiredItemsAndAmount in class AnimalHerdingModule
      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: AnimalHerdingModule
      Get 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:
      getRecipesForDisplayPurposesOnly in class AnimalHerdingModule
      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: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      compound - the compound.
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      compound - the nbt compound.
    • onWakeUp

      public void onWakeUp()
      Description copied from interface: IBuildingEventsModule
      Specific wakeup hook in modules.
      Specified by:
      onWakeUp in interface IBuildingEventsModule
    • 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.