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


Java Blocks.CAULDRON属性代码示例

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


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

示例1: removeSunnyPath

/**
 * Trims path data from the end to the first sun covered block
 */
protected void removeSunnyPath()
{
    super.removeSunnyPath();

    for (int i = 0; i < this.currentPath.getCurrentPathLength(); ++i)
    {
        PathPoint pathpoint = this.currentPath.getPathPointFromIndex(i);
        PathPoint pathpoint1 = i + 1 < this.currentPath.getCurrentPathLength() ? this.currentPath.getPathPointFromIndex(i + 1) : null;
        IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord));
        Block block = iblockstate.getBlock();

        if (block == Blocks.CAULDRON)
        {
            this.currentPath.setPoint(i, pathpoint.cloneMove(pathpoint.xCoord, pathpoint.yCoord + 1, pathpoint.zCoord));

            if (pathpoint1 != null && pathpoint.yCoord >= pathpoint1.yCoord)
            {
                this.currentPath.setPoint(i + 1, pathpoint1.cloneMove(pathpoint1.xCoord, pathpoint.yCoord + 1, pathpoint1.zCoord));
            }
        }
    }

    if (this.shouldAvoidSun)
    {
        if (this.worldObj.canSeeSky(new BlockPos(MathHelper.floor(this.theEntity.posX), (int)(this.theEntity.getEntityBoundingBox().minY + 0.5D), MathHelper.floor(this.theEntity.posZ))))
        {
            return;
        }

        for (int j = 0; j < this.currentPath.getCurrentPathLength(); ++j)
        {
            PathPoint pathpoint2 = this.currentPath.getPathPointFromIndex(j);

            if (this.worldObj.canSeeSky(new BlockPos(pathpoint2.xCoord, pathpoint2.yCoord, pathpoint2.zCoord)))
            {
                this.currentPath.setCurrentPathLength(j - 1);
                return;
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:44,代码来源:PathNavigateGround.java

示例2: removeSunnyPath

/**
 * Trims path data from the end to the first sun covered block
 */
protected void removeSunnyPath()
{
    super.removeSunnyPath();

    for (int i = 0; i < this.currentPath.getCurrentPathLength(); ++i)
    {
        PathPoint pathpoint = this.currentPath.getPathPointFromIndex(i);
        PathPoint pathpoint1 = i + 1 < this.currentPath.getCurrentPathLength() ? this.currentPath.getPathPointFromIndex(i + 1) : null;
        IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord));
        Block block = iblockstate.getBlock();

        if (block == Blocks.CAULDRON)
        {
            this.currentPath.setPoint(i, pathpoint.cloneMove(pathpoint.xCoord, pathpoint.yCoord + 1, pathpoint.zCoord));

            if (pathpoint1 != null && pathpoint.yCoord >= pathpoint1.yCoord)
            {
                this.currentPath.setPoint(i + 1, pathpoint1.cloneMove(pathpoint1.xCoord, pathpoint.yCoord + 1, pathpoint1.zCoord));
            }
        }
    }

    if (this.shouldAvoidSun)
    {
        if (this.worldObj.canSeeSky(new BlockPos(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.getEntityBoundingBox().minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))))
        {
            return;
        }

        for (int j = 0; j < this.currentPath.getCurrentPathLength(); ++j)
        {
            PathPoint pathpoint2 = this.currentPath.getPathPointFromIndex(j);

            if (this.worldObj.canSeeSky(new BlockPos(pathpoint2.xCoord, pathpoint2.yCoord, pathpoint2.zCoord)))
            {
                this.currentPath.setCurrentPathLength(j - 1);
                return;
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:PathNavigateGround.java


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