this.profiler.endSection();
}
public void renderBlocks(int renderPass, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
IBlockAccess mcWorld = this.settings.mcWorldCache;
RenderBlocks renderBlocks = this.settings.renderBlocks;
int x, y, z;
int blockId = 0, mcBlockId = 0;
int sides = 0;
Block block = null;
String lastTexture = "";
Vector3i tmp;
boolean ambientOcclusion = this.settings.minecraft.gameSettings.ambientOcclusion;
this.settings.minecraft.gameSettings.ambientOcclusion = false;
Tessellator.instance.startDrawingQuads();
for (y = minY; y < maxY; y++) {
for (z = minZ; z < maxZ; z++) {
for (x = minX; x < maxX; x++) {
try {
blockId = this.schematic.getBlockId(x, y, z);
block = Block.blocksList[blockId];
mcBlockId = mcWorld.getBlockId(x + this.settings.offset.x, y + this.settings.offset.y, z + this.settings.offset.z);
sides = 0;
if (block != null) {
if (block.shouldSideBeRendered(this.schematic, x, y - 1, z, 0)) {
sides |= 0x01;
}
if (block.shouldSideBeRendered(this.schematic, x, y + 1, z, 1)) {
sides |= 0x02;
}
if (block.shouldSideBeRendered(this.schematic, x, y, z - 1, 2)) {
sides |= 0x04;
}
if (block.shouldSideBeRendered(this.schematic, x, y, z + 1, 3)) {
sides |= 0x08;
}
if (block.shouldSideBeRendered(this.schematic, x - 1, y, z, 4)) {
sides |= 0x10;
}
if (block.shouldSideBeRendered(this.schematic, x + 1, y, z, 5)) {
sides |= 0x20;
}
}
if (mcBlockId != 0) {
if (this.settings.highlight && renderPass == 2) {
if (blockId == 0 && this.settings.highlightAir) {
tmp = new Vector3i(x, y, z);
drawCuboidSurface(tmp, tmp.clone().add(1), 0x3F, 0.75f, 0.0f, 0.75f, 0.25f);
drawCuboidOutline(tmp, tmp.clone().add(1), 0x3F, 0.75f, 0.0f, 0.75f, 0.25f);
} else if (blockId != mcBlockId) {
tmp = new Vector3i(x, y, z);
drawCuboidSurface(tmp, tmp.clone().add(1), sides, 1.0f, 0.0f, 0.0f, 0.25f);
drawCuboidOutline(tmp, tmp.clone().add(1), sides, 1.0f, 0.0f, 0.0f, 0.25f);
} else if (this.schematic.getBlockMetadata(x, y, z) != mcWorld.getBlockMetadata(x + this.settings.offset.x, y + this.settings.offset.y, z + this.settings.offset.z)) {
tmp = new Vector3i(x, y, z);
drawCuboidSurface(tmp, tmp.clone().add(1), sides, 0.75f, 0.35f, 0.0f, 0.25f);
drawCuboidOutline(tmp, tmp.clone().add(1), sides, 0.75f, 0.35f, 0.0f, 0.25f);
}
}
} else if (mcBlockId == 0 && blockId > 0 && blockId < 0x1000) {
if (this.settings.highlight && renderPass == 2) {
tmp = new Vector3i(x, y, z);
drawCuboidSurface(tmp, tmp.clone().add(1), sides, 0.0f, 0.75f, 1.0f, 0.25f);
drawCuboidOutline(tmp, tmp.clone().add(1), sides, 0.0f, 0.75f, 1.0f, 0.25f);
}
if (block != null) {
if (!lastTexture.equals(block.getTextureFile())) {
ForgeHooksClient.bindTexture(getTextureName(block.getTextureFile()), 0);
lastTexture = block.getTextureFile();
}
if (block.canRenderInPass(renderPass)) {
renderBlocks.renderBlockByRenderType(block, x, y, z);
}
}
}
} catch (Exception e) {
Settings.logger.log(e);