Class BuildingPlantation
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.BuildingPlantation
- 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 plantation building. Worker will grow sugarcane/bamboo/cactus + craft paper and books.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classField module implementation for the plantation.static classField module view implementation for the plantation. -
Field Summary
Fields 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
ConstructorsConstructorDescriptionBuildingPlantation(IColony c, net.minecraft.core.BlockPos l) Instantiates a new plantation building. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEat(net.minecraft.world.item.ItemStack stack) Check if the assigned citizens are allowed to eat the following stack.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) TODO: future Legacy code, can be removed when plantations will no longer have to support fields directly from the hut building.Override this method if you want to keep an amount of items in inventory.@NotNull StringChildren must return the name of their structure.voidOn setting down the building.voidonUpgradeComplete(@Nullable com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, int newLevel) Called upon completion of an upgrade process.voidTODO: future Legacy code, can be removed when plantations will no longer have to support fields directly from the hut building.Methods inherited from class com.minecolonies.core.colony.buildings.AbstractBuilding
buildingRequiresCertainAmountOfItem, 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, getMaxBuildingLevel, 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, onPlayerEnterBuilding, onPlayerEnterNearby, onRequestedRequestCancelled, onRequestedRequestComplete, onRestart, onWakeUp, overruleNextOpenRequestOfCitizenWithStack, overruleNextOpenRequestWithStack, pickUp, processOfflineTime, registerBlockPosition, registerModule, removeWorkOrder, requestRemoval, requestRepair, requestUpgrade, requestWorkOrder, reservedStacksExcluding, resetGuardBuildingNear, serializeNBT, serializeToView, setCustomBuildingName, setupRsDataStore, writeRequestSystemToNBTMethods inherited from class com.minecolonies.core.colony.buildings.AbstractBuildingContainer
addContainerPosition, alterPickUpPriority, getCapability, getContainers, getFirstLocationFromTag, getLocationsFromTag, getPickUpPriority, registerBlockPosition, removeContainerPositionMethods 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
-
Constructor Details
-
BuildingPlantation
Instantiates a new plantation building.- Parameters:
c- the colony.l- the location
-
-
Method Details
-
onPlacement
public void onPlacement()Description copied from class:AbstractBuildingOn setting down the building.- Specified by:
onPlacementin interfaceIBuilding- Overrides:
onPlacementin classAbstractBuilding
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) TODO: future Legacy code, can be removed when plantations will no longer have to support fields directly from the hut building.This is used for initial migration to the new plantation field system. This will register the fields on colony load, only when the building still contains old NBT data.
- Specified by:
deserializeNBTin interfaceIBuildingContainer- Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractBuilding
-
onUpgradeComplete
public void onUpgradeComplete(@Nullable @Nullable com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, int newLevel) Description copied from interface:IBuildingCalled upon completion of an upgrade process. We suppress this warning since this parameter will be used in child classes which override this method.- Specified by:
onUpgradeCompletein interfaceIBuilding- Overrides:
onUpgradeCompletein classAbstractBuildingnewLevel- The new level.
-
getRequiredItemsAndAmount
public Map<Predicate<net.minecraft.world.item.ItemStack>,net.minecraft.util.Tuple<Integer, getRequiredItemsAndAmount()Boolean>> Description copied from class:AbstractBuildingOverride 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 list of objects which should be kept.
-
canEat
public boolean canEat(net.minecraft.world.item.ItemStack stack) Check if the assigned citizens are allowed to eat the following stack. Additionally, if the stack is even edible in the first place, then it also checks if the fields aren't producing these items. If this item is being produced here, the planter is not allowed to eat his own products in that case. (Although most items the planter produces won't be edible to begin with).- Parameters:
stack- the stack to test.- Returns:
- true if so.
-
setTileEntity
TODO: future Legacy code, can be removed when plantations will no longer have to support fields directly from the hut building.- Specified by:
setTileEntityin interfaceIBuildingContainer- Overrides:
setTileEntityin classAbstractBuildingContainer- Parameters:
te- The tileentity
-
getSchematicName
Description copied from interface:ISchematicProviderChildren must return the name of their structure.- Returns:
- StructureProxy name.
-