本文整理匯總了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;
}
}
}
}