Class PathfinderTempt
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderTempt
- All Implemented Interfaces:
PathfinderInfo, SpeedModifier
Represents a Pathfinder for the logic of this Creature getting tempted to move to another entity, for when they hold a specific item.
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
Fields inherited from class Pathfinder
entityFields inherited from interface SpeedModifier
DEFAULT_SPEED_MODIFIER -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderTempt(@NotNull Creature m, double speedMod, @NotNull Iterable<? extends ItemStack> items) Constructs a PathfinderTempt.PathfinderTempt(@NotNull Creature m, double speedMod, @NotNull Predicate<ItemStack> predicate) Constructs a PathfinderTemptPathfinderTempt(@NotNull Creature m, double speedMod, @NotNull ItemStack... items) Constructs a PathfinderTempt with an array of Items.PathfinderTempt(@NotNull Creature m, @NotNull ItemStack... items) Constructs a PathfinderTempt with the default speed modifier. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a Collection of ItemStacks to this PathfinderTempt.voidAdds an Array of ItemStacks to this PathfinderTempt.@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.getItems()Gets the Set of ItemStack belonging to this PathfinderTempt.Gets the Predicate for this PathfinderTempt.doubleGet the Speed Modifier of this Pathfinder.voidremoveItems(@NotNull Iterable<? extends ItemStack> items) Removes a Collection of ItemStacks from this PathfinderTempt.voidremoveItems(@NotNull ItemStack... items) Removes an Array of ItemStacks from this PathfinderTempt.voidSets the ItemStacks for this PathfinderTempt.voidSets the ItemStacks for this PathfinderTempt/voidsetPredicate(Predicate<ItemStack> predicate) Sets the Predicate for this PathfinderTemptvoidsetSpeedModifier(double mod) Sets the Speed Modifier 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
-
Constructor Details
-
PathfinderTempt
public PathfinderTempt(@NotNull @NotNull Creature m, @NotNull @NotNull ItemStack... items) throws IllegalArgumentException Constructs a PathfinderTempt with the default speed modifier.- Parameters:
m- Creature to useitems- ItemStacks to be tempted by- Throws:
IllegalArgumentException- if item is null
-
PathfinderTempt
public PathfinderTempt(@NotNull @NotNull Creature m, double speedMod, @NotNull @NotNull ItemStack... items) throws IllegalArgumentException Constructs a PathfinderTempt with an array of Items.- Parameters:
m- Creature to usespeedMod- Speed Modifier while moving to target holding itemitems- Array of ItemStacks to be tempted by- Throws:
IllegalArgumentException- if items are null or empty
-
PathfinderTempt
public PathfinderTempt(@NotNull @NotNull Creature m, double speedMod, @NotNull @NotNull Iterable<? extends ItemStack> items) throws IllegalArgumentException Constructs a PathfinderTempt.- Parameters:
m- Creature to usespeedMod- Speed Modifier while moving to target holding itemitems- Collection of ItemStacks to be tempted by- Throws:
IllegalArgumentException- if items are null or empty
-
PathfinderTempt
public PathfinderTempt(@NotNull @NotNull Creature m, double speedMod, @NotNull @NotNull Predicate<ItemStack> predicate) Constructs a PathfinderTempt- Parameters:
m- Creature to usespeedMod- Speed Modifier while moving to target holding itempredicate- Predicate that matches ItemStacks to be tempted by
-
-
Method Details
-
getItems
-
getPredicate
-
setPredicate
-
addItems
Adds an Array of ItemStacks to this PathfinderTempt.- Parameters:
items- Items to add- Throws:
IllegalArgumentException- if items are null
-
addItems
public void addItems(@NotNull @NotNull Iterable<? extends ItemStack> items) throws IllegalArgumentException Adds a Collection of ItemStacks to this PathfinderTempt.- Parameters:
items- Items to add- Throws:
IllegalArgumentException- if items are null
-
removeItems
Removes an Array of ItemStacks from this PathfinderTempt.- Parameters:
items- Items to remove- Throws:
IllegalArgumentException- if items are null
-
removeItems
public void removeItems(@NotNull @NotNull Iterable<? extends ItemStack> items) throws IllegalArgumentException Removes a Collection of ItemStacks from this PathfinderTempt.- Parameters:
items- Items to remove- Throws:
IllegalArgumentException- if items are null
-
setItems
public void setItems(@NotNull @NotNull Iterable<? extends ItemStack> items) throws IllegalArgumentException Sets the ItemStacks for this PathfinderTempt.- Parameters:
items- Collection of Items to use- Throws:
IllegalArgumentException- if Items are null or empty
-
setItems
Sets the ItemStacks for this PathfinderTempt/- Parameters:
items- Array of Items to use- Throws:
IllegalArgumentException- if Items are null or empty
-
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
-
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
-