public void drawBlockDamageTexture(Tessellator tessellatorIn, BufferBuilder bufferIn, Entity entityIn, float partialTicks, World world, List<BlockPos> blocks) {
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;
TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
int progress = (int) (Minecraft.getMinecraft().playerController.curBlockDamageMP * 10.0F) - 1;
if (progress < 0) {
return;
}
renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
preRenderDamagedBlocks();
bufferIn.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
bufferIn.setTranslation(-d0, -d1, -d2);
bufferIn.noColor();
for (BlockPos blockpos : blocks) {
TileEntity tile = world.getTileEntity(blockpos);
boolean hasBreak = tile != null && tile.canRenderBreaking();
if (!hasBreak) {
IBlockState state = world.getBlockState(blockpos);
if (state.getMaterial() != Material.AIR) {
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockDamage(state, blockpos, blockDamageIcons[progress], world);
}
}
}
tessellatorIn.draw();
bufferIn.setTranslation(0.0D, 0.0D, 0.0D);
postRenderDamagedBlocks();
}