Class AbstractWalkToProxy

java.lang.Object
com.minecolonies.core.entity.pathfinding.proxy.AbstractWalkToProxy
All Implemented Interfaces:
IWalkToProxy
Direct Known Subclasses:
EntityCitizenWalkToProxy, GeneralEntityWalkToProxy

public abstract class AbstractWalkToProxy extends Object implements IWalkToProxy
Abstract class for the walkToProxy.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractWalkToProxy(net.minecraft.world.entity.Mob entity)
    Creates a walkToProxy for a certain entity.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToProxyList(net.minecraft.core.BlockPos pos)
    Add an entry to the proxy list.
    net.minecraft.core.BlockPos
    Getter for the current proxy.
    net.minecraft.world.entity.Mob
    Getter for the entity accociated with the proxy.
    protected @NotNull net.minecraft.core.BlockPos
    getProxy(@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.
    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.
    void
    Reset the target of the proxy.
    boolean
    walkToBlock(@NotNull net.minecraft.core.BlockPos target, int range)
    Leads the entity to a certain position due to proxies.
    boolean
    walkToBlock(@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, wait

    Methods 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:
      walkToBlock in interface IWalkToProxy
      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:
      walkToBlock in interface IWalkToProxy
      Parameters:
      target - the target position.
      range - the range.
      onMove - entity on move or not?
      Returns:
      true if arrived.
    • getProxyList

      public List<net.minecraft.core.BlockPos> getProxyList()
      Getter for the proxyList.
      Specified by:
      getProxyList in interface IWalkToProxy
      Returns:
      a copy of the list
    • addToProxyList

      public void addToProxyList(net.minecraft.core.BlockPos pos)
      Add an entry to the proxy list.
      Specified by:
      addToProxyList in interface IWalkToProxy
      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:
      isLivingAtSiteWithMove in interface IWalkToProxy
      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:
      getEntity in interface IWalkToProxy
      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: IWalkToProxy
      Getter for the current proxy.
      Specified by:
      getCurrentProxy in interface IWalkToProxy
      Returns:
      the current proxy.
    • reset

      public void reset()
      Description copied from interface: IWalkToProxy
      Reset the target of the proxy.
      Specified by:
      reset in interface IWalkToProxy