public class WanderGoal extends BehaviorGoalAdapter implements org.bukkit.event.Listener
Modifier and Type | Method and Description |
---|---|
static WanderGoal |
createWithNPC(NPC npc) |
static WanderGoal |
createWithNPCAndRange(NPC npc,
int xrange,
int yrange) |
static WanderGoal |
createWithNPCAndRangeAndTree(NPC npc,
int xrange,
int yrange,
com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>> tree) |
static WanderGoal |
createWithNPCAndRangeAndTreeAndFallback(NPC npc,
int xrange,
int yrange,
com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>> tree,
com.google.common.base.Function<NPC,org.bukkit.Location> fallback) |
static WanderGoal |
createWithNPCAndRangeAndTreeAndFallbackAndRegion(NPC npc,
int xrange,
int yrange,
com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>> tree,
com.google.common.base.Function<NPC,org.bukkit.Location> fallback,
Object worldguardRegion)
The full builder method.
|
void |
onFinish(NavigationCompleteEvent event) |
void |
pause() |
void |
reset()
Resets the goal and any resources or state it is holding.
|
BehaviorStatus |
run()
Ticks the behavior, optionally changing the state that it is in.
|
void |
setDelay(int delay) |
void |
setWorldGuardRegion(Object region) |
void |
setXYRange(int xrange,
int yrange) |
boolean |
shouldExecute() |
void |
unpause() |
create, run, shouldExecute
public void onFinish(NavigationCompleteEvent event)
public void pause()
public void reset()
Goal
public BehaviorStatus run()
Behavior
public void setDelay(int delay)
public void setWorldGuardRegion(Object region)
public void setXYRange(int xrange, int yrange)
public boolean shouldExecute()
shouldExecute
in interface Behavior
public void unpause()
public static WanderGoal createWithNPC(NPC npc)
public static WanderGoal createWithNPCAndRange(NPC npc, int xrange, int yrange)
public static WanderGoal createWithNPCAndRangeAndTree(NPC npc, int xrange, int yrange, com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>> tree)
public static WanderGoal createWithNPCAndRangeAndTreeAndFallback(NPC npc, int xrange, int yrange, com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>> tree, com.google.common.base.Function<NPC,org.bukkit.Location> fallback)
public static WanderGoal createWithNPCAndRangeAndTreeAndFallbackAndRegion(NPC npc, int xrange, int yrange, com.google.common.base.Supplier<ch.ethz.globis.phtree.PhTreeSolid<Boolean>> tree, com.google.common.base.Function<NPC,org.bukkit.Location> fallback, Object worldguardRegion)
npc
- the NPC to wanderxrange
- x/z range, in blocksyrange
- y range, in blockstree
- an optional PhTreeSolid
supplier to allow only wandering within a certain PhTreeSolid
fallback
- an optional fallback locationworldguardRegion
- the optional regionCopyright © 2021. All rights reserved.