Class MinerLevelManagementModule

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.MinerLevelManagementModule
All Implemented Interfaces:
IBuildingModule, IPersistentModule, IHasDirty

public class MinerLevelManagementModule extends AbstractBuildingModule implements IPersistentModule
Module containing miner level management.
  • Constructor Details

    • MinerLevelManagementModule

      public MinerLevelManagementModule()
  • Method Details

    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      compound - the nbt compound.
    • serializeNBT

      public void serializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      compound - the compound.
    • serializeToView

      public void serializeToView(net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: IBuildingModule
      Serialization method to send the module data to the client side.
      Specified by:
      serializeToView in interface IBuildingModule
      Parameters:
      buf - the buffer to write it to.
    • addLevel

      public void addLevel(MinerLevel currentLevel)
      Adds a level to the levels list.
      Parameters:
      currentLevel - MinerLevel to add.
    • getNumberOfLevels

      public int getNumberOfLevels()
      The number of levels in the mine.
      Returns:
      levels size.
    • getCurrentLevel

      @Nullable public @Nullable MinerLevel getCurrentLevel()
      Returns the current level.
      Returns:
      Current level.
    • getLevelId

      public int getLevelId(MinerLevel level)
      Find given level in the levels array.
      Parameters:
      level - the level.
      Returns:
      position in the levels array.
    • setCurrentLevel

      public void setCurrentLevel(int currentLevel)
      Sets the current level the miner is at.
      Parameters:
      currentLevel - the level to set.
    • getStartingLevelShaft

      public int getStartingLevelShaft()
      Getter of the starting level of the shaft. (Y position).
      Returns:
      the start level.
    • getActiveNode

      @Nullable public @Nullable MineNode getActiveNode()
      Getter for the active node.
      Returns:
      the int id of the active node.
    • setActiveNode

      public void setActiveNode(@Nullable @Nullable MineNode activeNode)
      Setter for the active node.
      Parameters:
      activeNode - the int id of the active node.
    • setOldNode

      public void setOldNode(@Nullable @Nullable MineNode oldNode)
      Setter for the old node.
      Parameters:
      oldNode - the int id of the old node.
    • setStartingLevelShaft

      public void setStartingLevelShaft(int level)
      Resets the starting level of the shaft to 0.
      Parameters:
      level - the level o set it to.
    • repairLevel

      public void repairLevel(int level)
      Repair the level.
      Parameters:
      level - the level to repair.
    • getLevels

      public List<MinerLevel> getLevels()
      Get the list of levels.
      Returns:
      the list.