当前位置: 首页>>代码示例>>Java>>正文


Java PathEntity.getFinalPathPoint方法代码示例

本文整理汇总了Java中net.minecraft.pathfinding.PathEntity.getFinalPathPoint方法的典型用法代码示例。如果您正苦于以下问题:Java PathEntity.getFinalPathPoint方法的具体用法?Java PathEntity.getFinalPathPoint怎么用?Java PathEntity.getFinalPathPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.pathfinding.PathEntity的用法示例。


在下文中一共展示了PathEntity.getFinalPathPoint方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canEasilyReach

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
/**
 * Checks to see if this entity can find a short path to the given target.
 */
private boolean canEasilyReach(EntityLivingBase p_75295_1_)
{
    this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5);
    PathEntity pathentity = this.taskOwner.getNavigator().getPathToEntityLiving(p_75295_1_);

    if (pathentity == null)
    {
        return false;
    }
    else
    {
        PathPoint pathpoint = pathentity.getFinalPathPoint();

        if (pathpoint == null)
        {
            return false;
        }
        else
        {
            int i = pathpoint.xCoord - MathHelper.floor_double(p_75295_1_.posX);
            int j = pathpoint.zCoord - MathHelper.floor_double(p_75295_1_.posZ);
            return (double)(i * i + j * j) <= 2.25D;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:EntityAITarget.java

示例2: canEasilyReach

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
private boolean canEasilyReach(EntityLivingBase p_75295_1_)
{
    this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5);
    PathEntity pathentity = this.taskOwner.getNavigator().getPathToEntityLiving(p_75295_1_);

    if (pathentity == null)
    {
        return false;
    }
    else
    {
        PathPoint pathpoint = pathentity.getFinalPathPoint();

        if (pathpoint == null)
        {
            return false;
        }
        else
        {
            int i = pathpoint.xCoord - MathHelper.floor_double(p_75295_1_.posX);
            int j = pathpoint.zCoord - MathHelper.floor_double(p_75295_1_.posZ);
            return (double)(i * i + j * j) <= 2.25D;
        }
    }
}
 
开发者ID:Link1234Gamer,项目名称:FiveNightsAtFreddysUniverseMod,代码行数:26,代码来源:EntityBonnieAITarget.java

示例3: canEasilyReach

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
/**
 * Checks to see if this entity can find a short path to the given target.
 */
private boolean canEasilyReach(EntityLivingBase par1EntityLivingBase)
{
    this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5);
    PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLivingBase);

    if (var2 == null)
    {
        return false;
    }
    else
    {
        PathPoint var3 = var2.getFinalPathPoint();

        if (var3 == null)
        {
            return false;
        }
        else
        {
            int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLivingBase.posX);
            int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLivingBase.posZ);
            return (double)(var4 * var4 + var5 * var5) <= 2.25D;
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:29,代码来源:EntityAITarget.java

示例4: func_75295_a

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
private boolean func_75295_a(EntityLivingBase par1EntityLiving) {
    this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5);
    PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving);

    if (var2 == null) {
        return false;
    } else {
        PathPoint var3 = var2.getFinalPathPoint();

        if (var3 == null) {
            return false;
        } else {
            int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX);
            int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ);
            return (double) (var4 * var4 + var5 * var5) <= 2.25D;
        }
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:19,代码来源:EntityAITarget.java

示例5: canEasilyReach

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
/**
 * Checks to see if this entity can find a short path to the given target.
 */
private boolean canEasilyReach(EntityLivingBase par1EntityLivingBase)
{
    this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5);
    PathEntity pathentity = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLivingBase);

    if (pathentity == null)
    {
        return false;
    }
    else
    {
        PathPoint pathpoint = pathentity.getFinalPathPoint();

        if (pathpoint == null)
        {
            return false;
        }
        else
        {
            int i = pathpoint.xCoord - MathHelper.floor_double(par1EntityLivingBase.posX);
            int j = pathpoint.zCoord - MathHelper.floor_double(par1EntityLivingBase.posZ);
            return (double)(i * i + j * j) <= 2.25D;
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:EntityAITarget.java

示例6: getEntityPathToXYZ

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
public PathEntity getEntityPathToXYZ(EntityDrone par1Entity, int par2, int par3, int par4, float par5, boolean par6, boolean par7, boolean par8, boolean par9){
    if(!par1Entity.isBlockValidPathfindBlock(par2, par3, par4)) return null;
    PathEntity pathentity = null;
    int l = MathHelper.floor_double(par1Entity.posX);
    int i1 = MathHelper.floor_double(par1Entity.posY);
    int j1 = MathHelper.floor_double(par1Entity.posZ);
    if(!forceTeleport || l == par2 && i1 == par3 && j1 == par4) {
        int k1 = (int)(par5 + 8.0F);
        int l1 = l - k1;
        int i2 = i1 - k1;
        int j2 = j1 - k1;
        int k2 = l + k1;
        int l2 = i1 + k1;
        int i3 = j1 + k1;
        ChunkCache chunkcache = new ChunkCache(par1Entity.worldObj, l1, i2, j2, k2, l2, i3, 0);
        pathentity = new PathFinderDrone(par1Entity, chunkcache, par6, par7, pathThroughLiquid, par9).createEntityPathTo(par1Entity, par2, par3, par4, par5);
        if(pathentity != null) {
            PathPoint finalPoint = pathentity.getFinalPathPoint();
            if(finalPoint == null || finalPoint.xCoord != par2 || finalPoint.yCoord != par3 || finalPoint.zCoord != par4) pathentity = null;
        }
    }
    teleportCounter = pathentity != null ? -1 : 0;
    telX = par2;
    telY = par3;
    telZ = par4;
    par1Entity.setStandby(false);
    return pathentity;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:29,代码来源:EntityPathNavigateDrone.java

示例7: shouldExecute

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
public boolean shouldExecute() {
    if (!this.miner.isTamed()) return false;

    if (this.miner.getNavigator().getPath() == null) {
        if (this.currentProspectingTime > 0) {
            this.currentProspectingTime--;
            return false;
        }
        else {
            this.currentProspectingTime = this.maxProspectingTime;
        }

        System.out.println("Miner " + this.miner.getEntityId() + " prospecting for ore");
        int minX = MathHelper.floor_double(this.miner.posX - maxSearchDistance);
        int minY = MathHelper.floor_double(this.miner.posY - maxSearchDistance);
        int minZ = MathHelper.floor_double(this.miner.posZ - maxSearchDistance);
        int maxX = MathHelper.floor_double(this.miner.posX + maxSearchDistance);
        int maxY = MathHelper.floor_double(this.miner.posY + maxSearchDistance);
        int maxZ = MathHelper.floor_double(this.miner.posZ + maxSearchDistance);

        PathEntity shortestPath = null;
        Vector3Int oreLocation = null;
        for (int x = minX; x <= maxX; ++x) {
            for (int y = minY; y <= maxY; ++y) {
                for (int z = minZ; z <= maxZ; ++z) {
                    Block block = this.miner.worldObj.getBlock(x, y, z);
                    if (shouldMineBlock(block, x, y, z)) {
                        PathEntity path = this.miner.getNavigator().getPathToXYZ((double) x, (double) y, (double) z);
                        if (path != null) {
                            if (path.getFinalPathPoint().xCoord <= x+1 && path.getFinalPathPoint().xCoord >= x-1
                                    && path.getFinalPathPoint().yCoord <= y+1 && path.getFinalPathPoint().yCoord >= y-1
                                    && path.getFinalPathPoint().zCoord <= z+1 && path.getFinalPathPoint().zCoord >= z-1) {
                                if (shortestPath == null || path.getCurrentPathLength() < shortestPath.getCurrentPathLength()) {
                                    shortestPath = path;
                                    oreLocation = new Vector3Int(x, y, z);
                                }
                            }
                        }
                    }
                }
            }
        }

        if (shortestPath != null) {
            System.out.println("Miner " + this.miner.getEntityId() + " found path to ore");
            this.oreLocation = oreLocation;
            this.miner.getNavigator().setPath(shortestPath, this.movementSpeed);
            return true;
        }
    }

    return false;
}
 
开发者ID:civilframe,项目名称:TameHumans,代码行数:54,代码来源:EntityAIMineOre.java


注:本文中的net.minecraft.pathfinding.PathEntity.getFinalPathPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。