Class BuildingLumberjack

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>

public class BuildingLumberjack extends AbstractBuilding
The lumberjacks building.
  • Field Details

  • Constructor Details

    • BuildingLumberjack

      public BuildingLumberjack(IColony c, net.minecraft.core.BlockPos l)
      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: AbstractBuilding
      Check if the building should be gathered by the dman.
      Specified by:
      canBeGathered in interface IBuilding
      Overrides:
      canBeGathered in class AbstractBuilding
      Returns:
      true if so.
    • getRequiredItemsAndAmount

      public Map<Predicate<net.minecraft.world.item.ItemStack>,net.minecraft.util.Tuple<Integer,Boolean>> getRequiredItemsAndAmount()
      Description copied from class: AbstractBuilding
      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:
      getRequiredItemsAndAmount in interface IBuilding
      Overrides:
      getRequiredItemsAndAmount in class AbstractBuilding
      Returns:
      a list of objects which should be kept.
    • 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.
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface IBuildingContainer
      Specified by:
      deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractBuilding
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT()
      Specified by:
      serializeNBT in interface IBuildingContainer
      Specified by:
      serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractBuilding
    • 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

      public Set<net.minecraft.core.BlockPos> 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

      public void onColonyTick(@NotNull @NotNull IColony colony)
      Description copied from class: AbstractBuilding
      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. -- If not: Create a request. - If so: Check if there is a request for this still. -- If so: cancel it.
      Specified by:
      onColonyTick in interface IBuilding
      Overrides:
      onColonyTick in class AbstractBuilding
    • serializeToView

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