Package net.citizensnpcs.trait.waypoint
Class WanderWaypointProvider
java.lang.Object
net.citizensnpcs.trait.waypoint.WanderWaypointProvider
- All Implemented Interfaces:
Persistable
,WaypointProvider
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRegionCentre
(Location centre) void
addRegionCentres
(Collection<Location> centre) createEditor
(CommandSender sender, CommandContext args) Creates anWaypointEditor
with the givenCommandSender
.int
getDelay()
int
int
boolean
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
setDelay
(int delay) void
setPathfind
(boolean pathfind) void
setPaused
(boolean paused) Pauses waypoint execution.void
setWorldGuardRegion
(String region) void
setXYRange
(int xrange, int yrange)
-
Constructor Details
-
WanderWaypointProvider
public WanderWaypointProvider()
-
-
Method Details
-
addRegionCentre
-
addRegionCentres
-
createEditor
Description copied from interface:WaypointProvider
Creates anWaypointEditor
with the givenCommandSender
.- Specified by:
createEditor
in interfaceWaypointProvider
- Parameters:
sender
- The player to link the editor withargs
-- Returns:
- The editor
-
getDelay
public int getDelay() -
getRegionCentres
-
getWorldGuardRegion
-
getXRange
public int getXRange() -
getYRange
public int getYRange() -
isPathfind
public boolean isPathfind() -
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
-
setDelay
public void setDelay(int delay) -
setPathfind
public void setPathfind(boolean pathfind) -
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.
-
setWorldGuardRegion
-
setXYRange
public void setXYRange(int xrange, int yrange)
-