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 TypeMethodDescriptionvoid
addRegionCentre
(Location centre) void
addRegionCentres
(Collection<Location> centre) createEditor
(CommandSender sender, CommandContext args) Creates anWaypointEditor
with the givenCommandSender
.ch.ethz.globis.phtree.PhTreeSolid<Boolean>
get()
boolean
isPaused()
Returns whether this provider has paused execution of waypoints.void
void
onRemove()
Called when the provider is removed from the NPC.void
Called when theNPC
attached to this provider is spawned.void
removeRegionCentre
(Location centre) void
removeRegionCentres
(Collection<Location> centre) void
void
setPaused
(boolean paused) Pauses waypoint execution.void
setXYRange
(int xrange, int yrange) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:WaypointProvider
Creates anWaypointEditor
with the givenCommandSender
.- Specified by:
createEditor
in interfaceWaypointProvider
- Parameters:
sender
- The player to link the editor with- Returns:
- The editor
-
get
-
getRegionCentres
-
getWorldGuardRegion
-
isPaused
public boolean isPaused()Description copied from interface:WaypointProvider
Returns whether this provider has paused execution of waypoints.- Specified by:
isPaused
in interfaceWaypointProvider
- Returns:
- Whether the provider is paused.
-
load
- Specified by:
load
in interfacePersistable
-
onRemove
public void onRemove()Description copied from interface:WaypointProvider
Called when the provider is removed from the NPC.- Specified by:
onRemove
in interfaceWaypointProvider
-
onSpawn
Description copied from interface:WaypointProvider
Called when theNPC
attached to this provider is spawned.- Specified by:
onSpawn
in interfaceWaypointProvider
- Parameters:
npc
- The attached NPC
-
removeRegionCentre
-
removeRegionCentres
-
save
- Specified by:
save
in interfacePersistable
-
setPaused
public void setPaused(boolean paused) Description copied from interface:WaypointProvider
Pauses waypoint execution.- Specified by:
setPaused
in interfaceWaypointProvider
- Parameters:
paused
- Whether to pause waypoint execution.
-
setXYRange
public void setXYRange(int xrange, int yrange)
-