All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.entity.ai.route.posevaluator.IPosEvaluator Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.entity.ai.route.posevaluator;

import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;
import cn.nukkit.block.Block;
import cn.nukkit.entity.EntityIntelligent;
import cn.nukkit.math.Vector3;
import org.jetbrains.annotations.NotNull;

/**
 * 坐标评估器用于寻路器评估坐标 
* 通过编写特定的坐标评估器,可以自定义寻路器的寻路策略 *

* {@link IPosEvaluator} are used by {@link cn.nukkit.entity.ai.route.finder.IRouteFinder IRouteFinder} to evaluate coordinates
* By writing specific coordinate {@link IPosEvaluator}, {@link cn.nukkit.entity.ai.route.finder.IRouteFinder IRouteFinder}'s pathfinding strategy can be customized */ @PowerNukkitXOnly @Since("1.6.0.0-PNX") public interface IPosEvaluator { /** * 返回目标坐标是否可以作为路径点,通常用于返回非整数坐标点(飞行和游泳)的实体
* 如果此使用此评估器的寻路器返回非整数坐标点,才需要实现此方法。 *

* Returns whether the target coordinates can be used as a waypoint, usually used for entities that return non-integer coordinates (flying and swimming)
* Only need to implement this method if the pathfinder using this evaluator returns non-integer coordinates. * * @param entity 目标实体 * @param pos 评估坐标 * @return 是否可以作为路径点 */ default boolean evalPos(@NotNull EntityIntelligent entity, @NotNull Vector3 pos) { return true; } /** * 返回此方块是否可以作为脚下站立的方块,通常用于返回整数坐标点(行走)的实体
* 如果此使用此评估器的寻路器只返回整数坐标点,才需要实现此方块。 *

* Returns whether this block can be used as a standing block, typically used for entities that return integer coordinates (walking)
* Only need to implement this if the pathfinder using this evaluator only returns integer coordinates. * * @param entity 目标实体 * @param block 评估方块 * @return 是否可以作为脚下站立的方块 */ default boolean evalStandingBlock(@NotNull EntityIntelligent entity, @NotNull Block block) { return true; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy