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
Module containing miner level management.
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
building, isDirty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLevel(MinerLevel currentLevel) Adds a level to the levels list.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) Deserialize the module.@Nullable MineNodeGetter for the active node.@Nullable MinerLevelReturns the current level.intgetLevelId(MinerLevel level) Find given level in the levels array.Get the list of levels.intThe number of levels in the mine.intGetter of the starting level of the shaft.voidrepairLevel(int level) Repair the level.voidserializeNBT(net.minecraft.nbt.CompoundTag compound) Serialize the module from a compound.voidserializeToView(net.minecraft.network.FriendlyByteBuf buf) Serialization method to send the module data to the client side.voidsetActiveNode(@Nullable MineNode activeNode) Setter for the active node.voidsetCurrentLevel(int currentLevel) Sets the current level the miner is at.voidsetOldNode(@Nullable MineNode oldNode) Setter for the old node.voidsetStartingLevelShaft(int level) Resets the starting level of the shaft to 0.Methods inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
checkDirty, clearDirty, getBuilding, getProducer, markDirty, setBuilding, setProducerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.modules.IBuildingModule
getBuilding, getProducer, serializeToView, setBuilding, setProducerMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirty
-
Constructor Details
-
MinerLevelManagementModule
public MinerLevelManagementModule()
-
-
Method Details
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) Description copied from interface:IPersistentModuleDeserialize the module.- Specified by:
deserializeNBTin interfaceIPersistentModule- Parameters:
compound- the nbt compound.
-
serializeNBT
public void serializeNBT(net.minecraft.nbt.CompoundTag compound) Description copied from interface:IPersistentModuleSerialize the module from a compound.- Specified by:
serializeNBTin interfaceIPersistentModule- Parameters:
compound- the compound.
-
serializeToView
public void serializeToView(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IBuildingModuleSerialization method to send the module data to the client side.- Specified by:
serializeToViewin interfaceIBuildingModule- Parameters:
buf- the buffer to write it to.
-
addLevel
Adds a level to the levels list.- Parameters:
currentLevel-MinerLevelto add.
-
getNumberOfLevels
public int getNumberOfLevels()The number of levels in the mine.- Returns:
- levels size.
-
getCurrentLevel
Returns the current level.- Returns:
- Current level.
-
getLevelId
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
Getter for the active node.- Returns:
- the int id of the active node.
-
setActiveNode
Setter for the active node.- Parameters:
activeNode- the int id of the active node.
-
setOldNode
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
Get the list of levels.- Returns:
- the list.
-