All Implemented Interfaces:
IBuilding, IBuildingContainer, ICommonBuilding, ISchematicProvider, IBuildingModuleContainer, IModuleContainer<IBuildingModule>, IRequester, IRequestResolverProvider, IItemHandlerCapProvider, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class BuildingCook extends AbstractBuilding
Class of the cook building.
  • Field Details

  • Constructor Details

    • BuildingCook

      public BuildingCook(IColony c, net.minecraft.core.BlockPos l)
      Instantiates a new cook building.
      Parameters:
      c - the colony.
      l - the location
  • Method Details

    • keepFood

      protected boolean keepFood()
      Description copied from class: AbstractBuilding
      If the worker should keep some food in the inventory/building.
      Overrides:
      keepFood in class AbstractBuilding
      Returns:
      true if so.
    • getNextSittingPosition

      public net.minecraft.core.BlockPos getNextSittingPosition()
      Gets the next sitting position to use for eating, just keeps iterating the aviable positions, so we do not have to keep track of who is where.
      Returns:
      eating position to sit at
    • getSchematicName

      @NotNull public @NotNull String getSchematicName()
      Description copied from interface: ISchematicProvider
      Children must return the name of their structure.
      Returns:
      StructureProxy name.
    • getMaxBuildingLevel

      public int getMaxBuildingLevel()
      Description copied from interface: ISchematicProvider
      Children must return their max building level.
      Specified by:
      getMaxBuildingLevel in interface ISchematicProvider
      Overrides:
      getMaxBuildingLevel in class AbstractBuilding
      Returns:
      Max building level.
    • buildingRequiresCertainAmountOfItem

      public int buildingRequiresCertainAmountOfItem(net.minecraft.world.item.ItemStack stack, List<ItemStorage> localAlreadyKept, boolean inventory, JobEntry jobEntry)
      Description copied from interface: IBuilding
      Check if the worker requires a certain amount of that item and the alreadykept list contains it. Always leave one stack behind if the worker requires a certain amount of it. Just to be sure.
      Specified by:
      buildingRequiresCertainAmountOfItem in interface IBuilding
      Overrides:
      buildingRequiresCertainAmountOfItem in class AbstractBuilding
      Parameters:
      stack - the stack to check it with.
      localAlreadyKept - already kept items.
      inventory - if it should be in the inventory or in the building.
      jobEntry - the job entry trying to dump.
      Returns:
      the amount which can get dumped or 0 if not.
    • serializeToView

      public void serializeToView(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf, boolean fullSync)
      Description copied from class: AbstractBuilding
      Serializes to view.
      Specified by:
      serializeToView in interface IBuilding
      Overrides:
      serializeToView in class AbstractBuilding
      Parameters:
      buf - RegistryFriendlyByteBuf to write to.
      fullSync - Whether it's a full sync
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface IBuildingContainer
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractBuilding
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface IBuildingContainer
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractBuilding
    • storeCustomer

      public void storeCustomer(ICitizenData citizenData)
      Store a new customer of this restaurant.
      Parameters:
      citizenData - the new customer citizen data.