本文整理汇总了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;
}
}
}
}
示例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;
}
}
}
}