Package me.gamercoder215.mobchip.ai.goal
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 me.gamercoder215.mobchip.ai.goal.Pathfinder
Pathfinder.PathfinderFlag
-
Field Summary
Fields inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
entity
Fields inherited from interface me.gamercoder215.mobchip.ai.SpeedModifier
DEFAULT_SPEED_MODIFIER
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PathfinderTempt.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 TypeMethodDescriptionvoid
Adds a Collection of ItemStacks to this PathfinderTempt.void
Adds an Array of ItemStacks to this PathfinderTempt.getFlags()
Fetches an Array of Flags that this Pathfinder has.Returns the NMS Internal Name.getItems()
Gets the Set of ItemStack belonging to this PathfinderTempt.Gets the Predicate for this PathfinderTempt.double
Get the Speed Modifier of this Pathfinder.void
removeItems
(@NotNull Iterable<? extends ItemStack> items) Removes a Collection of ItemStacks from this PathfinderTempt.void
removeItems
(@NotNull ItemStack... items) Removes an Array of ItemStacks from this PathfinderTempt.void
Sets the ItemStacks for this PathfinderTempt.void
Sets the ItemStacks for this PathfinderTempt/void
setPredicate
(Predicate<ItemStack> predicate) Sets the Predicate for this PathfinderTemptvoid
setSpeedModifier
(double mod) Sets the Speed Modifier of this Pathfinder.Methods inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.gamercoder215.mobchip.ai.goal.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
Gets the Set of ItemStack belonging to this PathfinderTempt.- Returns:
- Set of ItemStacks found
-
getPredicate
Gets the Predicate for this PathfinderTempt. Accepts any items that are in getItems()- Returns:
- Predicate for this PathfinderTempt
-
setPredicate
Sets the Predicate for this PathfinderTempt- Parameters:
predicate
- the predicate to set it to
-
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:SpeedModifier
Get the Speed Modifier of this Pathfinder.- Specified by:
getSpeedModifier
in interfaceSpeedModifier
- 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 interfaceSpeedModifier
- Parameters:
mod
- Modifier to set
-
getFlags
Description copied from class:Pathfinder
Fetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlags
in classPathfinder
- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfo
Returns the NMS Internal Name.- Specified by:
getInternalName
in interfacePathfinderInfo
- Returns:
- Internal Name
-