java.lang.Object
com.minecolonies.core.entity.ai.workers.util.MinerLevel

public class MinerLevel extends Object
Miner Level Data StructureIterator.

A Level contains all the nodes for one level of the mine.

  • Constructor Details

    • MinerLevel

      public MinerLevel(@NotNull @NotNull BuildingMiner buildingMiner, int depth, net.minecraft.core.BlockPos levelSign)
      Create a new level model.
      Parameters:
      buildingMiner - reference to the miner building.
      depth - the depth of this level.
      levelSign - the position of the level sign.
    • MinerLevel

      public MinerLevel(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Create a level from nbt.
      Parameters:
      compound - compound to use.
  • Method Details

    • getRandomNode

      public MineNode getRandomNode(@Nullable @Nullable MineNode node)
      Getter for a random Node in the level.
      Parameters:
      node - the last node.
      Returns:
      any random node.
    • getRandomCompletedNode

      public net.minecraft.core.BlockPos getRandomCompletedNode(BuildingMiner buildingMiner)
    • closeNextNode

      public void closeNextNode(int rotation, MineNode node, net.minecraft.world.level.Level world)
      Closes a given node. Or close the first in the list if null. Then creates the new nodes connected to it.
      Parameters:
      rotation - the rotation of the node.
      node - the node to close.
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object
    • write

      public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Store the level to nbt.
      Parameters:
      compound - compound to use.
    • getNodes

      @NotNull public @NotNull Map<Vec2i,MineNode> getNodes()
    • getNumberOfNodes

      public int getNumberOfNodes()
    • getNumberOfBuiltNodes

      public int getNumberOfBuiltNodes()
    • getDepth

      public int getDepth()
    • getLadderNode

      @NotNull public @NotNull MineNode getLadderNode()
    • getNode

      public MineNode getNode(Vec2i key)
      Returns a node by its key from the map.
      Parameters:
      key - the Point2D key.
      Returns:
      the Node.
    • getOpenNode

      public MineNode getOpenNode(Vec2i key)
      Returns a node by its key from the map.
      Parameters:
      key - the Point2D key.
      Returns:
      the Node.
    • getLevelSign

      public net.minecraft.core.BlockPos getLevelSign()
      Returns position of level's levelSign
      Returns:
      levelSign