Class BuildingFarmer
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.BuildingFarmer
- 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 which handles the farmer building.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classField module implementation for the farmer.static classField module view implementation for the farmer. -
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
ConstructorsConstructorDescriptionBuildingFarmer(IColony c, net.minecraft.core.BlockPos l) Public constructor which instantiates the building. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the building should be gathered by the dman.booleancanEat(net.minecraft.world.item.ItemStack stack) Check if the assigned citizens are allowed to eat the following stack.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) intgetCell()Get the current index within the current fieldintChildren must return their max building level.net.minecraft.core.BlockPosGet the previous position which has been worked at.Override this method if you want to keep an amount of items in inventory.@NotNull StringChildren must return the name of their structure.net.minecraft.core.BlockPosGet the offset to work at relative to the scarecrow.booleanGetter for request fertilizernet.minecraft.nbt.CompoundTagintsetCell(int i) Set the current index within the current fieldvoidsetPrevPos(net.minecraft.core.BlockPos position) Set the previous position which has been worked at.voidsetWorkingOffset(net.minecraft.core.BlockPos blockPos) Set the offset to work at relative to the scarecrow.Methods inherited from class com.minecolonies.core.colony.buildings.AbstractBuilding
buildingRequiresCertainAmountOfItem, calculateCorners, calculatePrestige, canBeBuiltByBuilder, 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, getResolvers, getSetting, getSettingValueOrDefault, getTileEntity, hasCitizenCompletedRequests, hasCitizenCompletedRequestsToPickup, hasModule, hasOpenSyncRequest, hasWorkerOpenRequests, hasWorkerOpenRequestsFiltered, hasWorkerOpenRequestsOfType, isBuilt, isDirty, isGuardBuildingNear, isItemStackInRequest, isMatchingBlock, isPendingConstruction, keepFood, 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, serializeToView, 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, 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
-
FERTILIZE
The beekeeper mode.
-
-
Constructor Details
-
BuildingFarmer
Public constructor which instantiates the building.- Parameters:
c- the colony the building is in.l- the position it has been placed (it's id).
-
-
Method Details
-
canBeGathered
public boolean canBeGathered()Description copied from class:AbstractBuildingCheck if the building should be gathered by the dman.- Specified by:
canBeGatheredin interfaceIBuilding- Overrides:
canBeGatheredin classAbstractBuilding- Returns:
- true if so.
-
getRequiredItemsAndAmount
public Map<Predicate<net.minecraft.world.item.ItemStack>,net.minecraft.util.Tuple<Integer, getRequiredItemsAndAmount()Boolean>> 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:
getRequiredItemsAndAmountin interfaceIBuilding- Overrides:
getRequiredItemsAndAmountin classAbstractBuilding- Returns:
- a map of objects which should be kept.
-
canEat
public boolean canEat(net.minecraft.world.item.ItemStack stack) Description copied from interface:IBuildingCheck if the assigned citizens are allowed to eat the following stack.- Parameters:
stack- the stack to test.- Returns:
- true if so.
-
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.
-
getSchematicName
Description copied from interface:ISchematicProviderChildren must return the name of their structure.- Returns:
- StructureProxy name.
-
requestFertilizer
public boolean requestFertilizer()Getter for request fertilizer -
getWorkingOffset
public net.minecraft.core.BlockPos getWorkingOffset()Get the offset to work at relative to the scarecrow.- Returns:
- the blockpos.
-
setCell
public int setCell(int i) Set the current index within the current field- Parameters:
i- the value to set.- Returns:
- current value.
-
getCell
public int getCell()Get the current index within the current field- Returns:
- current value.
-
setPrevPos
public void setPrevPos(net.minecraft.core.BlockPos position) Set the previous position which has been worked at.- Parameters:
position- to set.
-
setWorkingOffset
public void setWorkingOffset(net.minecraft.core.BlockPos blockPos) Set the offset to work at relative to the scarecrow.- Parameters:
blockPos- the pos to set.
-
getPrevPos
public net.minecraft.core.BlockPos getPrevPos()Get the previous position which has been worked at.- Returns:
- current prev pos.
-
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
-