Class BlockManager

java.lang.Object
com.chiefminingdad.autoplayer.blockmanager.BlockManager

public class BlockManager extends Object
BlockManager handles all getting and storing of BlockState data to find the best path.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(net.minecraft.world.level.block.state.BlockState a, net.minecraft.world.level.block.state.BlockState b)
     
    net.minecraft.world.level.block.state.BlockState
    getBlockState(net.minecraft.core.Vec3i location)
    Gets a BlockState at a location.
    static net.minecraft.world.level.block.state.BlockState
    getBlockState(net.minecraft.core.Vec3i location, net.minecraft.client.multiplayer.ClientLevel level)
    Gets the BlockState at a location in a level.
    float
    Returns the estimated amount of time to walk to that node from the previous node.
    void
    Resets the HashTable back to empty.
    boolean
     
    void
    setBlockState(net.minecraft.core.Vec3i vector)
    Gets the BlockState in a location and sets it in the HashTable
    void
    setNodeManager(NodeManager newNodeManager)
    Sets the nodeManager variable in this class for easier access in this class.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlockManager

      public BlockManager()
  • Method Details

    • setAllBlockStates

      public boolean setAllBlockStates()
      Returns:
      Boolean Whether 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 the BlockState in a location and sets it in the HashTable
      Parameters:
      vector - The location of the requested BlockState
    • 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 BlockState of the requested Block.
      Throws:
      RuntimeException - If this function is run while the Level has not been initialised.
    • setNodeManager

      public void setNodeManager(NodeManager newNodeManager)
      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

      public float getMovementWeight(Node node)
      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.