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


Java PathEntity.getPathPointFromIndex方法代码示例

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


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

示例1: shouldExecute

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    if (!this.theEntity.isCollidedHorizontally)
    {
        return false;
    }
    else
    {
        PathNavigateGround pathnavigateground = (PathNavigateGround)this.theEntity.getNavigator();
        PathEntity pathentity = pathnavigateground.getPath();

        if (pathentity != null && !pathentity.isFinished() && pathnavigateground.getEnterDoors())
        {
            for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i)
            {
                PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
                this.doorPosition = new BlockPos(pathpoint.xCoord, pathpoint.yCoord + 1, pathpoint.zCoord);

                if (this.theEntity.getDistanceSq((double)this.doorPosition.getX(), this.theEntity.posY, (double)this.doorPosition.getZ()) <= 2.25D)
                {
                    this.doorBlock = this.getBlockDoor(this.doorPosition);

                    if (this.doorBlock != null)
                    {
                        return true;
                    }
                }
            }

            this.doorPosition = (new BlockPos(this.theEntity)).up();
            this.doorBlock = this.getBlockDoor(this.doorPosition);
            return this.doorBlock != null;
        }
        else
        {
            return false;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:EntityAIDoorInteract.java

示例2: shouldExecute

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
@Override
public boolean shouldExecute() {
	if (!theEntity.isCollidedHorizontally)
		return false;
	else {
		PathNavigate pathnavigate = theEntity.getNavigator();
		PathEntity pathentity = pathnavigate.getPath();

		if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors()) {
			for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i) {
				PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
				entityPosX = pathpoint.xCoord;
				entityPosY = pathpoint.yCoord + 1;
				entityPosZ = pathpoint.zCoord;

				if (theEntity.getDistanceSq(entityPosX, theEntity.posY, entityPosZ) <= 2.25D) {
					field_151504_e = func_151503_a(entityPosX, entityPosY, entityPosZ);

					if (field_151504_e != null)
						return true;
				}
			}

			entityPosX = MathHelper.floor_double(theEntity.posX);
			entityPosY = MathHelper.floor_double(theEntity.posY + 1.0D);
			entityPosZ = MathHelper.floor_double(theEntity.posZ);
			field_151504_e = func_151503_a(entityPosX, entityPosY, entityPosZ);
			return field_151504_e != null;
		} else
			return false;
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:33,代码来源:EntityAICustomDoorInteract.java

示例3: updateTask

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
public void updateTask()
    {
//        float f = (float)((double)((float)this.entityPosX + 0.5F) - this.entity.posX);
//        float f1 = (float)((double)((float)this.entityPosZ + 0.5F) - this.entity.posZ);
//        float f2 = this.entityPositionX * f + this.entityPositionZ * f1;
//
//        if (f2 < 0.0F)
//        {
//            this.hasStoppedDoorInteraction = true;
//        }
    	
    	PathNavigate pathnavigate = this.entity.getNavigator();
        PathEntity pathentity = pathnavigate.getPath();

        if (pathentity != null && !pathentity.isFinished())
        {
            for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i)
            {
                PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
                this.doorPosX = pathpoint.xCoord;
                this.doorPosY = pathpoint.yCoord + 1;
                this.doorPosZ = pathpoint.zCoord;

                if (this.entity.getDistanceSq((double)this.doorPosX, this.entity.posY, (double)this.doorPosZ) <= 2.25D)
                {
                    this.door = this.getDoorObject(this.doorPosX, this.doorPosY, this.doorPosZ);
                }
            }

            this.doorPosX = MathHelper.floor_double(this.entity.posX);
            this.doorPosY = MathHelper.floor_double(this.entity.posY + 1.0D);
            this.doorPosZ = MathHelper.floor_double(this.entity.posZ);
            this.door = this.getDoorObject(this.doorPosX, this.doorPosY, this.doorPosZ);
        }
    	
    	if (door != null)
    	{
    		entity.worldObj.playAuxSFX(2001, doorPosX, doorPosY, doorPosZ, Block.getIdFromBlock(door));
    		entity.worldObj.setBlockToAir(doorPosX, doorPosY, doorPosZ);
    		door = null;
    	}
    }
 
开发者ID:Link1234Gamer,项目名称:FiveNightsAtFreddysUniverseMod,代码行数:43,代码来源:EntityCandyAIBreakDoor.java

示例4: shouldExecute

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    if (!this.theEntity.isCollidedHorizontally)
    {
        return false;
    }
    else
    {
        PathNavigate var1 = this.theEntity.getNavigator();
        PathEntity var2 = var1.getPath();

        if (var2 != null && !var2.isFinished() && var1.getCanBreakDoors())
        {
            for (int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3)
            {
                PathPoint var4 = var2.getPathPointFromIndex(var3);
                this.entityPosX = var4.xCoord;
                this.entityPosY = var4.yCoord + 1;
                this.entityPosZ = var4.zCoord;

                if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D)
                {
                    this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);

                    if (this.field_151504_e != null)
                    {
                        return true;
                    }
                }
            }

            this.entityPosX = MathHelper.floor_double(this.theEntity.posX);
            this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D);
            this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ);
            this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);
            return this.field_151504_e != null;
        }
        else
        {
            return false;
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:47,代码来源:EntityAIDoorInteract.java

示例5: shouldExecute

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    if (!this.theEntity.isCollidedHorizontally)
    {
        return false;
    }
    else
    {
        PathNavigate pathnavigate = this.theEntity.getNavigator();
        PathEntity pathentity = pathnavigate.getPath();

        if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors())
        {
            for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i)
            {
                PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
                this.entityPosX = pathpoint.xCoord;
                this.entityPosY = pathpoint.yCoord + 1;
                this.entityPosZ = pathpoint.zCoord;

                if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D)
                {
                    this.targetDoor = this.findUsableDoor(this.entityPosX, this.entityPosY, this.entityPosZ);

                    if (this.targetDoor != null)
                    {
                        return true;
                    }
                }
            }

            this.entityPosX = MathHelper.floor_double(this.theEntity.posX);
            this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D);
            this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ);
            this.targetDoor = this.findUsableDoor(this.entityPosX, this.entityPosY, this.entityPosZ);
            return this.targetDoor != null;
        }
        else
        {
            return false;
        }
    }
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:47,代码来源:EntityAIUseDoorMF.java

示例6: shouldExecute

import net.minecraft.pathfinding.PathEntity; //导入方法依赖的package包/类
public boolean shouldExecute()
{
    if (!this.theEntity.isCollidedHorizontally)
    {
        return false;
    }
    else
    {
        PathNavigate pathnavigate = this.theEntity.getNavigator();
        PathEntity pathentity = pathnavigate.getPath();

        if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors())
        {
            for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i)
            {
                PathPoint pathpoint = pathentity.getPathPointFromIndex(i);
                this.entityPosX = pathpoint.xCoord;
                this.entityPosY = pathpoint.yCoord + 1;
                this.entityPosZ = pathpoint.zCoord;

                if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D)
                {
                    this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);

                    if (this.field_151504_e != null)
                    {
                        return true;
                    }
                }
            }

            this.entityPosX = MathHelper.floor_double(this.theEntity.posX);
            this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D);
            this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ);
            this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ);
            return this.field_151504_e != null;
        }
        else
        {
            return false;
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:44,代码来源:EntityAIDoorInteract.java


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