Class PathfinderRemoveBlock

java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderRemoveBlock
All Implemented Interfaces:
PathfinderInfo, SpeedModifier

public final class PathfinderRemoveBlock extends Pathfinder implements SpeedModifier
Represents a Pathfinder for a Creature to remove a block
  • Constructor Details

    • PathfinderRemoveBlock

      public PathfinderRemoveBlock(@NotNull @NotNull Creature c, @NotNull @NotNull Block remove)
      Constructs a PathfinderRemoveBlock.
      Parameters:
      c - Creature to use
      remove - Block to remove
    • PathfinderRemoveBlock

      public PathfinderRemoveBlock(@NotNull @NotNull Creature c, @NotNull @NotNull Block remove, double speedMod)
      Constructs a PathfinderRemoveBlock with a vertical search range of 1.
      Parameters:
      c - Creature to use
      remove - Block to remove
      speedMod - Speed Modifier while moving
      Throws:
      IllegalArgumentException - if block data is null
    • PathfinderRemoveBlock

      public PathfinderRemoveBlock(@NotNull @NotNull Creature c, @NotNull @NotNull Block remove, double speedMod, int verticalSearchRange)
      Constructs a PathfinderRemoveBlock.
      Parameters:
      c - Creature to use
      remove - Block to remove
      speedMod - Speed Modifier while moving
      verticalSearchRange - Vertical search range
      Throws:
      IllegalArgumentException - if block is null, differing worlds, or range is not positive
    • PathfinderRemoveBlock

      public PathfinderRemoveBlock(@NotNull @NotNull Creature c, @NotNull @NotNull Material remove) throws IllegalArgumentException
      Constructs a PathfinderRemoveBlock
      Parameters:
      c - Creature to use
      remove - Material to remove
      Throws:
      IllegalArgumentException - if block is null or differing worlds
    • PathfinderRemoveBlock

      public PathfinderRemoveBlock(@NotNull @NotNull Creature c, @NotNull @NotNull Material remove, double speedMod) throws IllegalArgumentException
      Constructs a PathfinderRemoveBlock with a vertical search range of 1.
      Parameters:
      c - Creature to use
      remove - Material to remove
      speedMod - Speed Modifier while moving
      Throws:
      IllegalArgumentException - if material is null
    • PathfinderRemoveBlock

      public PathfinderRemoveBlock(@NotNull @NotNull Creature c, @NotNull @NotNull Material remove, double speedMod, int verticalSearchRange) throws IllegalArgumentException
      Constructs a PathfinderRemoveBlock.
      Parameters:
      c - Creature to use
      remove - Material to remove
      speedMod - Speed Modifier while moving
      verticalSearchRange - Vertical search range
      Throws:
      IllegalArgumentException - if material is null or range is not positive
  • Method Details

    • getBlock

      @NotNull public @NotNull Material getBlock()
      Gets the Material to remove.
      Returns:
      Material to remove
    • setBlock

      public void setBlock(@NotNull @NotNull Block remove) throws IllegalArgumentException
      Sets the Block to remove.
      Parameters:
      remove - Block to remove
      Throws:
      IllegalArgumentException - if block is null or differing worlds
    • setBlock

      public void setBlock(@NotNull @NotNull Material remove) throws IllegalArgumentException
      Sets the Material to remove.
      Parameters:
      remove - Material to remove
      Throws:
      IllegalArgumentException - if block data is null
      Since:
      1.9.1
    • getSpeedModifier

      public double getSpeedModifier()
      Description copied from interface: SpeedModifier
      Get the Speed Modifier of this Pathfinder.
      Specified by:
      getSpeedModifier in interface SpeedModifier
      Returns:
      Speed Modifier
    • setSpeedModifier

      public void setSpeedModifier(double mod)
      Description copied from interface: SpeedModifier
      Sets the Speed Modifier of this Pathfinder.
      Specified by:
      setSpeedModifier in interface SpeedModifier
      Parameters:
      mod - Modifier to set
    • getVerticalSearchRange

      public int getVerticalSearchRange()
      Gets the vertical search range for looking for the specified Material.
      Returns:
      Vertical search range
      Since:
      1.9.1
    • setVerticalSearchRange

      public void setVerticalSearchRange(int verticalSearchRange)
      Sets the vertical search range for looking for the specified Material.
      Parameters:
      verticalSearchRange - Vertical search range
      Since:
      1.9.1
    • getFlags

      @NotNull public @NotNull Pathfinder.PathfinderFlag[] getFlags()
      Description copied from class: Pathfinder

      Fetches an Array of Flags that this Pathfinder has.

      Specified by:
      getFlags in class Pathfinder
      Returns:
      Array of Pathfinder Flags
    • getInternalName

      public String getInternalName()
      Description copied from interface: PathfinderInfo
      Returns the pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.
      Specified by:
      getInternalName in interface PathfinderInfo
      Returns:
      Internal Name