Class MinerLevel
java.lang.Object
com.minecolonies.core.entity.ai.workers.util.MinerLevel
Miner Level Data StructureIterator.
A Level contains all the nodes for one level of the mine.
-
Constructor Summary
ConstructorsConstructorDescriptionMinerLevel(@NotNull BuildingMiner buildingMiner, int depth, net.minecraft.core.BlockPos levelSign) Create a new level model.MinerLevel(@NotNull net.minecraft.nbt.CompoundTag compound) Create a level from nbt. -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseNextNode(com.ldtteam.structurize.api.RotationMirror rotation, MineNode node, net.minecraft.world.level.Level world) Closes a given node.intgetDepth()@NotNull MineNodenet.minecraft.core.BlockPosReturns position of level's levelSignReturns a node by its key from the map.getNodes()intintgetOpenNode(Vec2i key) Returns a node by its key from the map.net.minecraft.core.BlockPosgetRandomCompletedNode(BuildingMiner buildingMiner) getRandomNode(@Nullable MineNode node) Getter for a random Node in the level.@NotNull StringtoString()voidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Store the level to nbt.
-
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
Getter for a random Node in the level.- Parameters:
node- the last node.- Returns:
- any random node.
-
getRandomCompletedNode
-
closeNextNode
public void closeNextNode(com.ldtteam.structurize.api.RotationMirror 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
-
write
public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Store the level to nbt.- Parameters:
compound- compound to use.
-
getNodes
-
getNumberOfNodes
public int getNumberOfNodes() -
getNumberOfBuiltNodes
public int getNumberOfBuiltNodes() -
getDepth
public int getDepth() -
getLadderNode
-
getNode
Returns a node by its key from the map.- Parameters:
key- the Point2D key.- Returns:
- the Node.
-
getOpenNode
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
-