Package net.citizensnpcs.trait.waypoint
Class WanderWaypointProvider
java.lang.Object
net.citizensnpcs.trait.waypoint.WanderWaypointProvider
- All Implemented Interfaces:
com.google.common.base.Function<NPC,,Location> com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>>,Function<NPC,,Location> Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>>,Persistable,WaypointProvider
public class WanderWaypointProvider
extends Object
implements WaypointProvider, com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>>, com.google.common.base.Function<NPC,Location>
A wandering waypoint provider that wanders between either a box centered at the current location or inside a region
defined by a list of boxes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.citizensnpcs.trait.waypoint.WaypointProvider
WaypointProvider.EnumerableWaypointProvider -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegionCentre(Location centre) voidaddRegionCentres(Collection<Location> centre) createEditor(CommandSender sender, CommandContext args) Creates anWaypointEditorwith the givenCommandSender.ch.ethz.globis.phtree.PhTreeSolid<Boolean>get()booleanisPaused()Returns whether this provider has paused execution of waypoints.voidvoidonRemove()Called when the provider is removed from the NPC.voidCalled when theNPCattached to this provider is spawned.voidremoveRegionCentre(Location centre) voidremoveRegionCentres(Collection<Location> centre) voidvoidsetPaused(boolean paused) Pauses waypoint execution.voidsetXYRange(int xrange, int yrange) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
delay
public int delay -
xrange
public int xrange -
yrange
public int yrange
-
-
Constructor Details
-
WanderWaypointProvider
public WanderWaypointProvider()
-
-
Method Details
-
addRegionCentre
-
addRegionCentres
-
apply
-
createEditor
Description copied from interface:WaypointProviderCreates anWaypointEditorwith the givenCommandSender.- Specified by:
createEditorin interfaceWaypointProvider- Parameters:
sender- The player to link the editor with- Returns:
- The editor
-
get
-
getRegionCentres
-
getWorldGuardRegion
-
isPaused
public boolean isPaused()Description copied from interface:WaypointProviderReturns whether this provider has paused execution of waypoints.- Specified by:
isPausedin interfaceWaypointProvider- Returns:
- Whether the provider is paused.
-
load
- Specified by:
loadin interfacePersistable
-
onRemove
public void onRemove()Description copied from interface:WaypointProviderCalled when the provider is removed from the NPC.- Specified by:
onRemovein interfaceWaypointProvider
-
onSpawn
Description copied from interface:WaypointProviderCalled when theNPCattached to this provider is spawned.- Specified by:
onSpawnin interfaceWaypointProvider- Parameters:
npc- The attached NPC
-
removeRegionCentre
-
removeRegionCentres
-
save
- Specified by:
savein interfacePersistable
-
setPaused
public void setPaused(boolean paused) Description copied from interface:WaypointProviderPauses waypoint execution.- Specified by:
setPausedin interfaceWaypointProvider- Parameters:
paused- Whether to pause waypoint execution.
-
setXYRange
public void setXYRange(int xrange, int yrange)
-