本文整理汇总了Java中net.minecraft.tileentity.TileEntity.canRenderBreaking方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntity.canRenderBreaking方法的具体用法?Java TileEntity.canRenderBreaking怎么用?Java TileEntity.canRenderBreaking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntity
的用法示例。
在下文中一共展示了TileEntity.canRenderBreaking方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawBlockDamageTexture
import net.minecraft.tileentity.TileEntity; //导入方法依赖的package包/类
public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer worldRendererIn, Entity entityIn, float partialTicks)
{
double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
if (!this.damagedBlocks.isEmpty())
{
this.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
this.preRenderDamagedBlocks();
worldRendererIn.begin(7, DefaultVertexFormats.BLOCK);
worldRendererIn.setTranslation(-d0, -d1, -d2);
worldRendererIn.noColor();
Iterator<DestroyBlockProgress> iterator = this.damagedBlocks.values().iterator();
while (iterator.hasNext())
{
DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
BlockPos blockpos = destroyblockprogress.getPosition();
double d3 = (double)blockpos.getX() - d0;
double d4 = (double)blockpos.getY() - d1;
double d5 = (double)blockpos.getZ() - d2;
Block block = this.theWorld.getBlockState(blockpos).getBlock();
TileEntity te = this.theWorld.getTileEntity(blockpos);
boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
if (!hasBreak)
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{
iterator.remove();
}
else
{
IBlockState iblockstate = this.theWorld.getBlockState(blockpos);
if (iblockstate.getMaterial() != Material.AIR)
{
int i = destroyblockprogress.getPartialBlockDamage();
TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i];
BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.theWorld);
}
}
}
}
tessellatorIn.draw();
worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D);
this.postRenderDamagedBlocks();
}
}