Class PathfinderMoveToBlock
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderMoveToBlock
- All Implemented Interfaces:
PathfinderInfo, Ranged, SpeedModifier
Represents a Pathfinder for an Entity to move to another block
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
FieldsFields inherited from class Pathfinder
entityFields inherited from interface Ranged
DEFAULT_ATTACK_INTERVAL, DEFAULT_ATTACK_RANGE, DEFAULT_LOOK_RANGEFields inherited from interface SpeedModifier
DEFAULT_SPEED_MODIFIER -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderMoveToBlock(@NotNull Creature c) Constructs a PathfinderMoveToBlock with the default Valid Block Predicate.PathfinderMoveToBlock(@NotNull Creature c, @Nullable Predicate<Location> validBlock) Constructs a PathfinderMoveToBlock with the Default Speed Modifier.PathfinderMoveToBlock(@NotNull Creature c, @Nullable Predicate<Location> validBlock, double speedMod) Constructs a PathfinderMoveToBlock with theDEFAULT_RANGE;PathfinderMoveToBlock(@NotNull Creature c, @Nullable Predicate<Location> validBlock, double speedMod, int range) Constructs a PathfinderMoveToBlock with horizontal and vertical ranges identical.PathfinderMoveToBlock(@NotNull Creature c, @Nullable Predicate<Location> validBlock, double speedMod, int range, int vrange) Constructs a PathfinderMoveToBlock. -
Method Summary
Modifier and TypeMethodDescription@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.floatgetRange()Gets the current Range.doubleGet the Speed Modifier of this Pathfinder.Fetches the function called when checking if this block is valid, or a default of true if not set.floatFetches the current vertical range of this Pathfinder.voidsetRange(float range) Sets the current Range.voidsetSpeedModifier(double mod) Sets the Speed Modifier of this Pathfinder.voidsetValidBlock(@Nullable Predicate<Location> valid) Sets the function called when checking if this block is valid, can be nullvoidsetVerticalRange(int vrange) Sets the vertical range of this Pathfinder.Methods inherited from class Pathfinder
getEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PathfinderInfo
getName
-
Field Details
-
DEFAULT_RANGE
public static final int DEFAULT_RANGEDefault Range to find Block (25)- See Also:
-
-
Constructor Details
-
PathfinderMoveToBlock
Constructs a PathfinderMoveToBlock with the default Valid Block Predicate.- Parameters:
c- Creature to use
-
PathfinderMoveToBlock
-
PathfinderMoveToBlock
public PathfinderMoveToBlock(@NotNull @NotNull Creature c, @Nullable @Nullable Predicate<Location> validBlock, double speedMod) Constructs a PathfinderMoveToBlock with theDEFAULT_RANGE;- Parameters:
c- Creature to usevalidBlock- Function to check if the location is validspeedMod- Speed Modifier while moving
-
PathfinderMoveToBlock
public PathfinderMoveToBlock(@NotNull @NotNull Creature c, @Nullable @Nullable Predicate<Location> validBlock, double speedMod, int range) Constructs a PathfinderMoveToBlock with horizontal and vertical ranges identical.- Parameters:
c- Creature to usevalidBlock- Function to check if the location is validspeedMod- Speed Modifier while movingrange- Range of blocks to look
-
PathfinderMoveToBlock
public PathfinderMoveToBlock(@NotNull @NotNull Creature c, @Nullable @Nullable Predicate<Location> validBlock, double speedMod, int range, int vrange) Constructs a PathfinderMoveToBlock.- Parameters:
c- Creature to usevalidBlock- Function to check if the location is validspeedMod- Speed Modifier while movingrange- Range of blocks to lookvrange- Vertical range of blocks to look
-
-
Method Details
-
getRange
-
getVerticalRange
public float getVerticalRange()Fetches the current vertical range of this Pathfinder.- Returns:
- Vertical Range
-
setVerticalRange
public void setVerticalRange(int vrange) Sets the vertical range of this Pathfinder.- Parameters:
vrange- Vertical Range
-
setRange
Description copied from interface:RangedSets the current Range.- Specified by:
setRangein interfaceRanged- Parameters:
range- Range to set- Throws:
IllegalArgumentException- if range is not an integer
-
getSpeedModifier
public double getSpeedModifier()Description copied from interface:SpeedModifierGet the Speed Modifier of this Pathfinder.- Specified by:
getSpeedModifierin interfaceSpeedModifier- Returns:
- Speed Modifier
-
setSpeedModifier
public void setSpeedModifier(double mod) Description copied from interface:SpeedModifierSets the Speed Modifier of this Pathfinder.- Specified by:
setSpeedModifierin interfaceSpeedModifier- Parameters:
mod- Modifier to set
-
getValidBlock
-
setValidBlock
-
getFlags
Description copied from class:PathfinderFetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlagsin classPathfinder- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfoReturns the pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.- Specified by:
getInternalNamein interfacePathfinderInfo- Returns:
- Internal Name
-