Class BuildingLumberjack
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.BuildingLumberjack
- All Implemented Interfaces:
IBuilding,IBuildingContainer,ICommonBuilding,ISchematicProvider,IBuildingModuleContainer,IModuleContainer<IBuildingModule>,IRequester,IRequestResolverProvider,IItemHandlerCapProvider,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The lumberjacks building.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThe client side representation of the building. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ISettingKey<BoolSetting> static final ISettingKey<DynamicTreesSetting> static final ISettingKey<BoolSetting> Replant setting.static final ISettingKey<BoolSetting> 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
colonyFields inherited from interface com.minecolonies.api.colony.buildings.IBuilding
WOOD_HUT_LEVEL -
Constructor Summary
ConstructorsConstructorDescriptionBuildingLumberjack(IColony c, net.minecraft.core.BlockPos l) Public constructor of the building, creates an object of the building. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNetherTree(net.minecraft.core.BlockPos pos) Adds a position to the nether treesbooleanCheck if the building should be gathered by the dman.voiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) net.minecraft.core.BlockPosintChildren must return their max building level.Set<net.minecraft.core.BlockPos> Returns a list of the registered nether trees to grow.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.BlockPosvoidonColonyTick(@NotNull IColony colony) Regularly tick this building and check if we got the minimum stock(like once a minute is still fine) - If not: Check if there is a request for this already.voidremoveNetherTree(net.minecraft.core.BlockPos pos) Removes a position from the nether treesnet.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidserializeToView(@NotNull net.minecraft.network.RegistryFriendlyByteBuf buf, boolean fullSync) Serializes to view.voidsetRestrictedArea(net.minecraft.core.BlockPos startPosition, net.minecraft.core.BlockPos endPosition) booleanWhether or not the LJ should break all the leaves, not just the ones directly in the way.booleanWhether or not the LJ should replant saplings.booleanWhether or not the LJ should be restricted.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, 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, getContainers, getFirstLocationFromTag, getItemHandlerCap, 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, getRotationMirror, getStructurePack, hashCode, hasParent, isDeconstructed, isInBuilding, onUpgradeSchematicTo, safeUpdateTEDataFromSchematic, setBlueprintPath, setBuildingLevel, setBuildingType, setCorners, setDeconstructed, setParent, setRotationMirror, 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, sort, writeToItemStackMethods inherited from interface com.minecolonies.api.colony.buildings.ICommonBuilding
getBuildingLevelEquivalentMethods inherited from interface com.minecolonies.api.util.IItemHandlerCapProvider
getItemHandlerCap, getItemHandlerCapMethods 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, getRotationMirror, getStructurePack, hasParent, isDeconstructed, onUpgradeSchematicTo, setBlueprintPath, setBuildingLevel, setCorners, setDeconstructed, setParent, setRotationMirror, setStructurePack
-
Field Details
-
REPLANT
Replant setting. -
RESTRICT
-
DEFOLIATE
-
DYNAMIC_TREES_SIZE
-
-
Constructor Details
-
BuildingLumberjack
Public constructor of the building, creates an object of the building.- Parameters:
c- the colony.l- the position.
-
-
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>> 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.
-
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.
-
deserializeNBT
public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfaceIBuildingContainer- Specified by:
deserializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractBuilding
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfaceIBuildingContainer- Specified by:
serializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractBuilding
-
shouldReplant
public boolean shouldReplant()Whether or not the LJ should replant saplings.- Returns:
- true if so.
-
shouldDefoliate
public boolean shouldDefoliate()Whether or not the LJ should break all the leaves, not just the ones directly in the way.- Returns:
- true if so.
-
shouldRestrict
public boolean shouldRestrict()Whether or not the LJ should be restricted.- Returns:
- true if it should restrict.
-
setRestrictedArea
public void setRestrictedArea(net.minecraft.core.BlockPos startPosition, net.minecraft.core.BlockPos endPosition) -
getStartRestriction
public net.minecraft.core.BlockPos getStartRestriction() -
getEndRestriction
public net.minecraft.core.BlockPos getEndRestriction() -
getNetherTrees
Returns a list of the registered nether trees to grow.- Returns:
- a copy of the list
-
removeNetherTree
public void removeNetherTree(net.minecraft.core.BlockPos pos) Removes a position from the nether trees- Parameters:
pos- the position
-
addNetherTree
public void addNetherTree(net.minecraft.core.BlockPos pos) Adds a position to the nether trees- Parameters:
pos- the position
-
onColonyTick
Description copied from class:AbstractBuildingRegularly tick this building and check if we got the minimum stock(like once a minute is still fine) - If not: Check if there is a request for this already. -- If not: Create a request. - If so: Check if there is a request for this still. -- If so: cancel it.- Specified by:
onColonyTickin interfaceIBuilding- Overrides:
onColonyTickin classAbstractBuilding
-
serializeToView
public void serializeToView(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf, boolean fullSync) Description copied from class:AbstractBuildingSerializes to view.- Specified by:
serializeToViewin interfaceIBuilding- Overrides:
serializeToViewin classAbstractBuilding- Parameters:
buf- RegistryFriendlyByteBuf to write to.fullSync- Whether it's a full sync
-