Class BuildingCook
java.lang.Object
com.minecolonies.core.colony.buildings.AbstractSchematicProvider
com.minecolonies.core.colony.buildings.AbstractBuildingContainer
com.minecolonies.core.colony.buildings.AbstractBuilding
com.minecolonies.core.colony.buildings.workerbuildings.BuildingCook
- All Implemented Interfaces:
IBuilding,IBuildingContainer,ICommonBuilding,ISchematicProvider,IBuildingModuleContainer,IModuleContainer<IBuildingModule>,IRequester,IRequestResolverProvider,net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Class of the cook building.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe client side representation of the building. -
Field Summary
FieldsFields inherited from class com.minecolonies.core.colony.buildings.AbstractBuilding
BREEDING, modules, modulesMap, USE_SHEARSFields inherited from class com.minecolonies.core.colony.buildings.AbstractBuildingContainer
containerList, keepX, tileEntityFields inherited from class com.minecolonies.core.colony.buildings.AbstractSchematicProvider
cachedRotation, colonyFields inherited from interface com.minecolonies.api.colony.buildings.IBuilding
WOOD_HUT_LEVEL -
Constructor Summary
ConstructorsConstructorDescriptionBuildingCook(IColony c, net.minecraft.core.BlockPos l) Instantiates a new cook building. -
Method Summary
Modifier and TypeMethodDescriptionintbuildingRequiresCertainAmountOfItem(net.minecraft.world.item.ItemStack stack, List<ItemStorage> localAlreadyKept, boolean inventory, JobEntry jobEntry) Check if the worker requires a certain amount of that item and the alreadykept list contains it.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) intChildren must return their max building level.net.minecraft.core.BlockPosGets 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.@NotNull StringChildren must return the name of their structure.protected booleankeepFood()If the worker should keep some food in the inventory/building.net.minecraft.nbt.CompoundTagvoidserializeToView(@NotNull net.minecraft.network.FriendlyByteBuf buf, boolean fullSync) Serializes to view.voidstoreCustomer(ICitizenData citizenData) Store a new customer of this restaurant.Methods inherited from class com.minecolonies.core.colony.buildings.AbstractBuilding
calculateCorners, calculatePrestige, canBeBuiltByBuilder, canBeGathered, cancelAllRequestsOfCitizenOrBuilding, canDeconstruct, clearDirty, createPickupRequest, createRequest, createRequest, createResolvers, deconstruct, destroy, forceTransferStack, getAllAssignedCitizen, getBuildingDisplayName, getCitizenForRequest, getClaimRadius, getClassType, getCompletedRequestsOfCitizenOrBuilding, getCompletedRequestsOfCitizenOrBuilding, getCompletedRequestsOfType, getCompletedRequestsOfTypeFiltered, getCraftingModuleForRecipe, getCustomName, getHandlers, getId, getLocation, getModule, getModule, getModules, getOpenRequests, getOpenRequestsByCitizen, getOpenRequestsByRequestableType, getOpenRequestsOfCitizenOrBuilding, getOpenRequestsOfType, getOpenRequestsOfTypeFiltered, getPrestige, getRequester, getRequesterDisplayName, getRequiredItemsAndAmount, getResolvers, getSetting, getSettingValueOrDefault, getTileEntity, hasCitizenCompletedRequests, hasCitizenCompletedRequestsToPickup, hasModule, hasOpenSyncRequest, hasWorkerOpenRequests, hasWorkerOpenRequestsFiltered, hasWorkerOpenRequestsOfType, isBuilt, isDirty, isGuardBuildingNear, isItemStackInRequest, isMatchingBlock, isPendingConstruction, markDirty, markRequestAsAccepted, moveToSyncCitizen, onCleanUp, onColonyTick, onDestroyed, onPlacement, onPlayerEnterBuilding, onPlayerEnterNearby, onRequestedRequestCancelled, onRequestedRequestComplete, onRestart, onUpgradeComplete, onWakeUp, overruleNextOpenRequestOfCitizenWithStack, overruleNextOpenRequestWithStack, pickUp, processOfflineTime, registerBlockPosition, registerModule, removeWorkOrder, requestRemoval, requestRepair, requestUpgrade, requestWorkOrder, reservedStacksExcluding, resetGuardBuildingNear, setCustomBuildingName, setupRsDataStore, writeRequestSystemToNBTMethods inherited from class com.minecolonies.core.colony.buildings.AbstractBuildingContainer
addContainerPosition, alterPickUpPriority, getCapability, getContainers, getFirstLocationFromTag, getLocationsFromTag, getPickUpPriority, registerBlockPosition, removeContainerPosition, setTileEntityMethods inherited from class com.minecolonies.core.colony.buildings.AbstractSchematicProvider
asyncPrestigeRecalc, equals, getBlueprintPath, getBuildingLevel, getBuildingType, getChildren, getColony, getCorners, getID, getParent, getPosition, getRotation, getStructurePack, hashCode, hasParent, isDeconstructed, isInBuilding, isMirrored, onUpgradeSchematicTo, safeUpdateTEDataFromSchematic, setBlueprintPath, setBuildingLevel, setBuildingType, setCorners, setDeconstructed, setIsMirrored, setParent, setStructurePack, upgradeBuildingLevelToSchematicDataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.IBuilding
buildingRequiresCertainAmountOfItem, canAssignCitizens, canEat, canSort, getMaxEquipmentLevel, sortMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface com.minecolonies.api.colony.buildings.ICommonBuilding
getBuildingLevelEquivalentMethods inherited from interface com.minecolonies.api.colony.modules.IModuleContainer
getFirstModuleOccurance, getModule, getModule, getModule, getModuleMatching, getModules, getModules, getModules, getModulesByType, hasModule, hasModule, hasModuleMethods inherited from interface com.minecolonies.api.colony.buildings.ISchematicProvider
getBlueprintPath, getChildren, getCorners, getID, getParent, getRotation, getStructurePack, hasParent, isDeconstructed, isMirrored, onUpgradeSchematicTo, setBlueprintPath, setBuildingLevel, setCorners, setDeconstructed, setIsMirrored, setParent, setStructurePack
-
Field Details
-
FOOD_EXCLUSION_LIST
Exclusion list id.- See Also:
-
-
Constructor Details
-
BuildingCook
Instantiates a new cook building.- Parameters:
c- the colony.l- the location
-
-
Method Details
-
keepFood
protected boolean keepFood()Description copied from class:AbstractBuildingIf the worker should keep some food in the inventory/building.- Overrides:
keepFoodin classAbstractBuilding- 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
Description copied from interface:ISchematicProviderChildren must return the name of their structure.- Returns:
- StructureProxy name.
-
getMaxBuildingLevel
public int getMaxBuildingLevel()Description copied from interface:ISchematicProviderChildren must return their max building level.- Specified by:
getMaxBuildingLevelin interfaceISchematicProvider- Overrides:
getMaxBuildingLevelin classAbstractBuilding- 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:IBuildingCheck 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:
buildingRequiresCertainAmountOfItemin interfaceIBuilding- Overrides:
buildingRequiresCertainAmountOfItemin classAbstractBuilding- 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.FriendlyByteBuf buf, boolean fullSync) Description copied from class:AbstractBuildingSerializes to view.- Specified by:
serializeToViewin interfaceIBuilding- Overrides:
serializeToViewin classAbstractBuilding- Parameters:
buf- FriendlyByteBuf to write to.fullSync- Whether it's a full sync
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfaceIBuildingContainer- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractBuilding
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfaceIBuildingContainer- Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractBuilding
-
storeCustomer
Store a new customer of this restaurant.- Parameters:
citizenData- the new customer citizen data.
-