Class BlockManager
java.lang.Object
com.chiefminingdad.autoplayer.blockmanager.BlockManager
BlockManager handles all getting and storing of BlockState data to find the best path.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(net.minecraft.world.level.block.state.BlockState a, net.minecraft.world.level.block.state.BlockState b) net.minecraft.world.level.block.state.BlockStategetBlockState(net.minecraft.core.Vec3i location) Gets a BlockState at a location.static net.minecraft.world.level.block.state.BlockStategetBlockState(net.minecraft.core.Vec3i location, net.minecraft.client.multiplayer.ClientLevel level) Gets the BlockState at a location in a level.floatgetMovementWeight(Node node) Returns the estimated amount of time to walk to that node from the previous node.voidreset()Resets the HashTable back to empty.booleanvoidsetBlockState(net.minecraft.core.Vec3i vector) Gets theBlockStatein a location and sets it in the HashTablevoidsetNodeManager(NodeManager newNodeManager) Sets the nodeManager variable in this class for easier access in this class.
-
Constructor Details
-
BlockManager
public BlockManager()
-
-
Method Details
-
setAllBlockStates
public boolean setAllBlockStates()- Returns:
BooleanWhether there was a change in value of the block states.
-
equals
public boolean equals(net.minecraft.world.level.block.state.BlockState a, net.minecraft.world.level.block.state.BlockState b) -
setBlockState
public void setBlockState(net.minecraft.core.Vec3i vector) Gets theBlockStatein a location and sets it in the HashTable- Parameters:
vector- The location of the requestedBlockState
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState(net.minecraft.core.Vec3i location) Gets a BlockState at a location.- Parameters:
location- The location of the block requested.- Returns:
- The BlockState of the requested Block.
-
getBlockState
public static net.minecraft.world.level.block.state.BlockState getBlockState(net.minecraft.core.Vec3i location, net.minecraft.client.multiplayer.ClientLevel level) throws RuntimeException Gets the BlockState at a location in a level.- Parameters:
location- The location of the block requested.level- The Level (World) Loaded- Returns:
- The
BlockStateof the requested Block. - Throws:
RuntimeException- If this function is run while the Level has not been initialised.
-
setNodeManager
Sets the nodeManager variable in this class for easier access in this class.- Parameters:
newNodeManager- The Main used NodeManager.
-
reset
public void reset()Resets the HashTable back to empty. -
getMovementWeight
Returns the estimated amount of time to walk to that node from the previous node.- Parameters:
node- The node for the estimation.- Returns:
- The movement weight.
-