Class AbstractWalkToProxy
java.lang.Object
com.minecolonies.core.entity.pathfinding.proxy.AbstractWalkToProxy
- All Implemented Interfaces:
IWalkToProxy
- Direct Known Subclasses:
EntityCitizenWalkToProxy,GeneralEntityWalkToProxy
Abstract class for the walkToProxy.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWalkToProxy(net.minecraft.world.entity.Mob entity) Creates a walkToProxy for a certain entity. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToProxyList(net.minecraft.core.BlockPos pos) Add an entry to the proxy list.net.minecraft.core.BlockPosGetter for the current proxy.net.minecraft.world.entity.MobGetter for the entity accociated with the proxy.protected @NotNull net.minecraft.core.BlockPosgetProxy(@NotNull net.minecraft.core.BlockPos target, @NotNull net.minecraft.core.BlockPos position, double distanceToPath) Returns a proxy point to the goal.List<net.minecraft.core.BlockPos> Getter for the proxyList.booleanisLivingAtSiteWithMove(net.minecraft.world.entity.Mob entity, int x, int y, int z, int range) Method to call to detect if an entity living is at site with move.voidreset()Reset the target of the proxy.booleanwalkToBlock(@NotNull net.minecraft.core.BlockPos target, int range) Leads the entity to a certain position due to proxies.booleanwalkToBlock(@NotNull net.minecraft.core.BlockPos target, int range, boolean onMove) Leads the entity to a certain position due to proxies.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.entity.pathfinding.proxy.IWalkToProxy
careAboutY, getSpecializedProxy, getWayPoints
-
Constructor Details
-
AbstractWalkToProxy
protected AbstractWalkToProxy(net.minecraft.world.entity.Mob entity) Creates a walkToProxy for a certain entity.- Parameters:
entity- the entity.
-
-
Method Details
-
walkToBlock
public boolean walkToBlock(@NotNull @NotNull net.minecraft.core.BlockPos target, int range) Leads the entity to a certain position due to proxies.- Specified by:
walkToBlockin interfaceIWalkToProxy- Parameters:
target- the position.range- the range.- Returns:
- true if arrived.
-
walkToBlock
public boolean walkToBlock(@NotNull @NotNull net.minecraft.core.BlockPos target, int range, boolean onMove) Leads the entity to a certain position due to proxies.- Specified by:
walkToBlockin interfaceIWalkToProxy- Parameters:
target- the target position.range- the range.onMove- entity on move or not?- Returns:
- true if arrived.
-
getProxyList
Getter for the proxyList.- Specified by:
getProxyListin interfaceIWalkToProxy- Returns:
- a copy of the list
-
addToProxyList
public void addToProxyList(net.minecraft.core.BlockPos pos) Add an entry to the proxy list.- Specified by:
addToProxyListin interfaceIWalkToProxy- Parameters:
pos- the position to add.
-
isLivingAtSiteWithMove
public boolean isLivingAtSiteWithMove(net.minecraft.world.entity.Mob entity, int x, int y, int z, int range) Method to call to detect if an entity living is at site with move.- Specified by:
isLivingAtSiteWithMovein interfaceIWalkToProxy- Parameters:
entity- the entity to check.x- the x value.y- the y value.z- the z value.range- the range.- Returns:
- true if so.
-
getEntity
public net.minecraft.world.entity.Mob getEntity()Getter for the entity accociated with the proxy.- Specified by:
getEntityin interfaceIWalkToProxy- Returns:
- the entity.
-
getProxy
@NotNull protected @NotNull net.minecraft.core.BlockPos getProxy(@NotNull @NotNull net.minecraft.core.BlockPos target, @NotNull @NotNull net.minecraft.core.BlockPos position, double distanceToPath) Returns a proxy point to the goal.- Parameters:
target- the target.position- the position.distanceToPath- the total distance.- Returns:
- a proxy or, if not applicable null.
-
getCurrentProxy
public net.minecraft.core.BlockPos getCurrentProxy()Description copied from interface:IWalkToProxyGetter for the current proxy.- Specified by:
getCurrentProxyin interfaceIWalkToProxy- Returns:
- the current proxy.
-
reset
public void reset()Description copied from interface:IWalkToProxyReset the target of the proxy.- Specified by:
resetin interfaceIWalkToProxy
-