Jump to content

[1.7.10]ISBRH won't render if no other blocks exist in the same chunk.


Recommended Posts

Posted

So someone requested I downgraded my post-1.8 mod to 1.7.10. Unfortunately, block models didn't exist in 1.7.10, so I decided to use ISimpleBlockRenderingHadler (ISBRH) to render my custom block. I got the whole model working in all 16 states it can be in (each state changes the blocks appearance), but then a new problem arose: the block would stop rendering if there where no other blocks present in the same chunk. I suspect it might have something to do with that I never use

RenderBlocks#renderStandardBlock

, instead I render each face individually. Problem is that I can't use

RenderBlocks#renderStandardBlock

for this because I have more textures than faces and they are designed for a 1.8 block model, where you can choose what part of the UV you want where on the model, and not for a

RenderBlocks#renderStandardBlock

where it fits the texture on the model in a very specific way.

 

Here's the code for the ISBRH:

package themattyboy.gadgetsngoodies.blocks.renders;

import net.minecraft.block.Block;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import themattyboy.gadgetsngoodies.blocks.BlockPlacedTNTCannon;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;

public class RenderPlacedTNTCannon implements ISimpleBlockRenderingHandler {

@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {

}

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	return this.renderBlockTNTCannon(world, x, y, z, (BlockPlacedTNTCannon)block, modelId, renderer);
}

public boolean renderBlockTNTCannon(IBlockAccess world, int x, int y, int z, BlockPlacedTNTCannon block, int modelId, RenderBlocks renderer) {
	int meta = world.getBlockMetadata(x, y, z);

	boolean flag;

	float f = 0.125F;
	float f1 = 0.0625F;

	Tessellator tessellator = Tessellator.instance;
	IIcon iicon = renderer.getBlockIconFromSideAndMetadata(block, 1, meta);
	double d0 = iicon.getInterpolatedU(6);
	double d1 = iicon.getMinV();
	double d2 = iicon.getInterpolatedU(10);
	double d3 = iicon.getInterpolatedV(;
        tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
        int l = block.colorMultiplier(world, x, y, z);
        float f2 = (float)(l >> 16 & 255) / 255.0F;
        float f3 = (float)(l >> 8 & 255) / 255.0F;
        float f4 = (float)(l & 255) / 255.0F;

        if (EntityRenderer.anaglyphEnable)
        {
            float f5 = (f2 * 30.0F + f3 * 59.0F + f4 * 11.0F) / 100.0F;
            float f6 = (f2 * 30.0F + f3 * 70.0F) / 100.0F;
            float f7 = (f2 * 30.0F + f4 * 70.0F) / 100.0F;
            f2 = f5;
            f3 = f6;
            f4 = f7;
        }

        tessellator.setColorOpaque_F(f2, f3, f4);

	if(meta >= 0 && meta <= 3) {
		renderer.setRenderBounds(0.5 + f, 0, 0.0F, 1.0F - f, 0.25F + f1, 1.0F - f1);
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f, 0, 0.0F, 0.5F - f, 0.25 + f1, 1.0F - f1);
		renderer.flipTexture = true;
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
		renderer.flipTexture = false;
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f, 0, 0, 1 - f, f1, 1 - f1);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 3;
		renderer.uvRotateWest = 3;
		renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 0;
		renderer.uvRotateWest = 0;

		renderer.setRenderBounds(f, 0, 0, 1 - f, 1.5 * f, 1 - f1);
		renderer.uvRotateNorth = 2;
		renderer.uvRotateSouth = 1;
		renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateNorth = 0;
		renderer.uvRotateSouth = 0;

		renderer.setRenderBounds(0.5F - f, f1, 0.75F, 0.5F + f, 0.25F + f1, 1 - f1);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));

		renderer.setRenderBounds(0.5F - f, f1, 0.5F, 0.5F + f, 0.25F, 0.75F);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(0.5 - f1, f1, f1, 0.5 + f1, 1.5 * f, 1.5 * f);
		renderer.renderFaceXPos(block, x, y, z, block.iconWood);
		renderer.renderFaceXNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceZPos(block, x, y, z, block.iconWood);
		renderer.renderFaceZNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(0.5 - f, 1.5 * f, 0, 0.5 + f, 0.25F, 0.25);
		renderer.renderFaceYPos(block, x, y, z, block.iconWood);
		renderer.renderFaceYNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceZPos(block, x, y, z, block.iconWood);
		renderer.renderFaceZNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(5 * f, f1, 1 - f1, 1 - 3 * f1, 0.25F - f1, 1);
		renderer.flipTexture = true;
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
		renderer.flipTexture = false;
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
		renderer.renderFaceYPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceYNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));

		renderer.setRenderBounds(f, 0.0F, 0.0F, 1.0F - f, 0.25F + f1, 1.0F - f1);
		renderer.flipTexture = true;
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
		renderer.flipTexture = false;
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
		renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));

		if(meta == 0) {
			tessellator.addVertexWithUV(x + (0.5 - f), y + f1, z, d0, d1);
			tessellator.addVertexWithUV(x + (0.5 - f), y + 0.25, z + 0.5, d0, d3);
			tessellator.addVertexWithUV(x + (0.5 + f), y + 0.25, z + 0.5, d2, d3);
			tessellator.addVertexWithUV(x + (0.5 + f), y + f1, z, d2, d1);
		}
		if(meta >= 1 && meta <= 2) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.5 + f, y + f1, z - f, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.5 - f, y + f1, z - f, block.iconTNTSide);
			renderer.renderFaceYPos(block, x, y - 0.75 + f1, z - f, block.iconTNTTop);
			renderer.renderFaceZPos(block, x, y + f1, z - 0.5, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x, y + f1, z + 0.25, block.iconTNTSide);
		}
		if(meta >= 2 && meta <= 3) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.5 + f, y + 0.25, z - 0.25 - f, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.5 - f, y + 0.25, z - 0.25 - f, block.iconTNTSide);
			renderer.renderFaceYPos(block, x, y - 0.5, z - 0.25 - f, block.iconTNTTop);
			renderer.renderFaceZPos(block, x, y + 0.25, z - 0.75, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x, y + 0.25, z, block.iconTNTSide);
		}
		flag = true;
	}
	else if (meta >= 4 && meta <= 7) {
            renderer.uvRotateTop = 1;
            renderer.uvRotateBottom = 2;
            renderer.setRenderBounds(f1, 0, 0.5 + f, 1.0F, 0.25F + f, 1.0F - f);
		renderer.flipTexture = true;
		renderer.uvRotateEast = 2;
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 0;
		renderer.flipTexture = false;
		renderer.renderFaceYPos(block, x, y - f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f1, 0, f, 1.0F, 0.25 + f, 0.5F - f);
		renderer.uvRotateWest = 1;
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateWest = 0;
		renderer.renderFaceYPos(block, x, y - f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f1, 0, f, 1, f1, 1 - f);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateNorth = 3;
		renderer.uvRotateSouth = 3;
		renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateNorth = 0;
		renderer.uvRotateSouth = 0;

		renderer.setRenderBounds(f1, 0, f, 1, 1.5 * f, 1 - f);
		renderer.uvRotateEast = 2;
		renderer.uvRotateWest = 1;
		renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 0;
		renderer.uvRotateWest = 0;

		renderer.setRenderBounds(f1, f1, 0.5F - f, 0.25, 0.25F + f1, 0.5F + f);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));

		renderer.setRenderBounds(0.25F, f1, 0.5F - f, 0.5F, 0.25F, 0.5F + f);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(0.75 + f1, f1, 0.5 - f1, 1 - f1, 1.5 * f, 0.5 + f1);
		renderer.renderFaceZPos(block, x, y, z, block.iconWood);
		renderer.renderFaceZNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceXPos(block, x, y, z, block.iconWood);
		renderer.renderFaceXNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(0.75, 1.5 * f, 0.5 - f, 1, 0.25F, 0.5 + f);
		renderer.renderFaceYPos(block, x, y, z, block.iconWood);
		renderer.renderFaceYNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceXPos(block, x, y, z, block.iconWood);
		renderer.renderFaceXNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(0, f1, 5 * f, f1, 0.25F - f1, 1 - 3 * f1);
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(Blocks.stone, 0, meta));
		renderer.flipTexture = true;
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(Blocks.stone, 0, meta));
		renderer.flipTexture = false;
		renderer.renderFaceYPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceYNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));

		renderer.setRenderBounds(f1, 0.0F, f, 1.0F, 0.25F + f, 1.0F - f);
		renderer.flipTexture = true;
		renderer.uvRotateEast = 2;
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 0;
		renderer.flipTexture = false;
		renderer.uvRotateWest = 1;
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateWest = 0;
		renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));

		if(meta == 4) {
			tessellator.addVertexWithUV(x + 1, y + f1, z + (0.5 - f), d0, d1);
			tessellator.addVertexWithUV(x + 0.5, y + 0.25, z + (0.5 - f), d0, d3);
			tessellator.addVertexWithUV(x + 0.5, y + 0.25, z + (0.5 + f), d2, d3);
			tessellator.addVertexWithUV(x + 1, y + f1, z + (0.5 + f), d2, d1);
		}
		if(meta >= 5 && meta <= 6) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.25, y + f1, z, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.5, y + f1, z, block.iconTNTSide);
			renderer.renderFaceYPos(block, x + 0.25 - f, y - 0.75 + f1, z, block.iconTNTTop);
			renderer.renderFaceZPos(block, x + 0.25 - f, y + f1, z - 0.5 + f, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x + 0.25 - f, y + f1, z + 0.5 - f, block.iconTNTSide);
		}
		if(meta >= 6 && meta <= 7) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x, y + 0.25, z, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.75, y + 0.25, z, block.iconTNTSide);
			renderer.renderFaceYPos(block, x + 0.5 - f, y - 0.5, z, block.iconTNTTop);
			renderer.renderFaceZPos(block, x + 0.5 - f, y + 0.25, z - 0.5 + f, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x + 0.5 - f, y + 0.25, z + 0.5 - f, block.iconTNTSide);
		}
            flag = true;
        }
        else if (meta >= 8 && meta <= 11) {
            renderer.uvRotateTop = 3;
            renderer.uvRotateBottom = 3;
            renderer.setRenderBounds(0.5 + f, 0, f1, 1.0F - f, 0.25F + f, 1.0F);
		renderer.flipTexture = true;
		renderer.uvRotateNorth = 1;
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateNorth = 0;
		renderer.flipTexture = false;
		renderer.renderFaceYPos(block, x, y - f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f, 0, f1, 0.5F - f, 0.25 + f, 1.0F);
		renderer.uvRotateSouth = 2;
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateSouth = 0;
		renderer.renderFaceYPos(block, x, y - f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f, 0, f1, 1 - f, f1, 1);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 3;
		renderer.uvRotateWest = 3;
		renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateEast = 0;
		renderer.uvRotateWest = 0;

		renderer.setRenderBounds(f, 0, f1, 1 - f, 1.5 * f, 1);
		renderer.uvRotateNorth = 1;
		renderer.uvRotateSouth = 2;
		renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateNorth = 0;
		renderer.uvRotateSouth = 0;

		renderer.setRenderBounds(0.5F - f, f1, f1, 0.5F + f, 0.25F + f1, 0.25);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));

		renderer.setRenderBounds(0.5F - f, f1, 0.25F, 0.5F + f, 0.25F, 0.5F);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(0.5 - f1, f1, 0.75 + f1, 0.5 + f1, 1.5 * f, 1 - f1);
		renderer.renderFaceXPos(block, x, y, z, block.iconWood);
		renderer.renderFaceXNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceZPos(block, x, y, z, block.iconWood);
		renderer.renderFaceZNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(0.5 - f, 1.5 * f, 0.75, 0.5 + f, 0.25F, 1);
		renderer.renderFaceYPos(block, x, y, z, block.iconWood);
		renderer.renderFaceYNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceZPos(block, x, y, z, block.iconWood);
		renderer.renderFaceZNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(3 * f1, f1, 0, 3 * f, 0.25F - f1, f1);
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(Blocks.stone, 0, meta));
		renderer.flipTexture = true;
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(Blocks.stone, 0, meta));
		renderer.flipTexture = false;
		renderer.renderFaceYPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceYNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(Blocks.stone, 0, meta));

		renderer.setRenderBounds(f, 0.0F, f1, 1.0F - f, 0.25F + f, 1.0F);
		renderer.flipTexture = true;
		renderer.uvRotateNorth = 1;
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateNorth = 0;
		renderer.flipTexture = false;
		renderer.uvRotateSouth = 2;
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateSouth = 0;
		renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));

		if(meta ==  {
			tessellator.addVertexWithUV(x + (0.5 + f), y + f1, z + 1, d0, d1);
			tessellator.addVertexWithUV(x + (0.5 + f), y + 0.25, z + 0.5, d0, d3);
			tessellator.addVertexWithUV(x + (0.5 - f), y + 0.25, z + 0.5, d2, d3);
			tessellator.addVertexWithUV(x + (0.5 - f), y + f1, z + 1, d2, d1);
		}
		if(meta >= 9 && meta <= 10) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.5 + f, y + f1, z + f, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.5 - f, y + f1, z + f, block.iconTNTSide);
			renderer.renderFaceYPos(block, x, y - 0.75 + f1, z + f, block.iconTNTTop);
			renderer.renderFaceZPos(block, x, y + f1, z - 0.25, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x, y + f1, z + 0.5, block.iconTNTSide);
		}
		if(meta >= 10 && meta <= 11) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.5 + f, y + 0.25, z + 0.25 + f, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.5 - f, y + 0.25, z + 0.25 + f, block.iconTNTSide);
			renderer.renderFaceYPos(block, x, y - 0.5, z + 0.25 + f, block.iconTNTTop);
			renderer.renderFaceZPos(block, x, y + 0.25, z, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x, y + 0.25, z + 0.75, block.iconTNTSide);
		}
            flag = true;
        }
        else if (meta >= 12 && meta <= 15) {
            renderer.uvRotateTop = 2;
            renderer.uvRotateBottom = 1;
            renderer.setRenderBounds(0.0F, 0, 0.5 + f, 1.0F - f1, 0.25F + f1, 1.0F - f);
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(0.0F, 0, f, 1.0F - f1, 0.25 + f1, 0.5F - f);
		renderer.flipTexture = true;
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
		renderer.flipTexture = false;
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(0, 0, f, 1 - f1, f1, 1 - f);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateSouth = 3;
		renderer.uvRotateNorth = 3;
		renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateSouth = 0;
		renderer.uvRotateNorth = 0;

		renderer.setRenderBounds(0, 0, f, 1 - f1, 1.5 * f, 1 - f);
		renderer.uvRotateWest = 2;
		renderer.uvRotateEast = 1;
		renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.uvRotateWest = 0;
		renderer.uvRotateEast = 0;

		renderer.setRenderBounds(0.75F, f1, 0.5F - f, 1 - f1, 0.25F + f1, 0.5F + f);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));

		renderer.setRenderBounds(0.5F, f1, 0.5F - f, 0.75F, 0.25F, 0.5F + f);
		renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));

		renderer.setRenderBounds(f1, f1, 0.5 - f1, 1.5 * f, 1.5 * f, 0.5 + f1);
		renderer.renderFaceZPos(block, x, y, z, block.iconWood);
		renderer.renderFaceZNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceXPos(block, x, y, z, block.iconWood);
		renderer.renderFaceXNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(0, 1.5 * f, 0.5 - f, 0.25, 0.25F, 0.5 + f);
		renderer.renderFaceYPos(block, x, y, z, block.iconWood);
		renderer.renderFaceYNeg(block, x, y, z, block.iconWood);
		renderer.renderFaceXPos(block, x, y, z, block.iconWood);
		renderer.renderFaceXNeg(block, x, y, z, block.iconWood);

		renderer.setRenderBounds(1 - f1, f1, 3 * f1, 1, 0.25F - f1, 6 * f1);
		renderer.flipTexture = true;
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
		renderer.flipTexture = false;
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
		renderer.renderFaceYPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceYNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(Blocks.stone, 0, meta));

		renderer.setRenderBounds(0.0F, 0.0F, f, 1.0F - f1, 0.25F + f1, 1.0F - f);
		renderer.flipTexture = true;
		renderer.renderFaceZPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
		renderer.flipTexture = false;
		renderer.renderFaceZNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
		renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
		renderer.renderFaceXPos(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
		renderer.renderFaceXNeg(block, x, y + f1, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));

		if(meta == 12) {
			tessellator.addVertexWithUV(x, y + f1, z + (0.5 + f), d0, d1);
			tessellator.addVertexWithUV(x + 0.5, y + 0.25, z + (0.5 + f), d0, d3);
			tessellator.addVertexWithUV(x + 0.5, y + 0.25, z + (0.5 - f), d2, d3);
			tessellator.addVertexWithUV(x, y + f1, z + (0.5 - f), d2, d1);
		}
		if(meta >= 13 && meta <= 14) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.5, y + f1, z, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x + 0.25, y + f1, z, block.iconTNTSide);
			renderer.renderFaceYPos(block, x - f, y - 0.75 + f1, z, block.iconTNTTop);
			renderer.renderFaceZPos(block, x - f, y + f1, z - 0.5 + f, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x - f, y + f1, z + 0.5 - f, block.iconTNTSide);
		}
		if(meta >= 14 && meta <= 15) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderFaceXPos(block, x - 0.75, y + 0.25, z, block.iconTNTSide);
			renderer.renderFaceXNeg(block, x, y + 0.25, z, block.iconTNTSide);
			renderer.renderFaceYPos(block, x - 0.25 - f, y - 0.5, z, block.iconTNTTop);
			renderer.renderFaceZPos(block, x - 0.25 - f, y + 0.25, z - 0.5 + f, block.iconTNTSide);
			renderer.renderFaceZNeg(block, x - 0.25 - f, y + 0.25, z + 0.5 - f, block.iconTNTSide);
		}
            flag = true;
        }

        renderer.uvRotateSouth = 0;
        renderer.uvRotateEast = 0;
        renderer.uvRotateWest = 0;
        renderer.uvRotateNorth = 0;
        renderer.uvRotateTop = 0;
        renderer.uvRotateBottom = 0;
        flag = false;
        return flag;
}

@Override
public boolean shouldRender3DInInventory(int modelId) {
	return false;
}

@Override
public int getRenderId() {
	return 50;
}
}

IGN: matte006

Played Minecraft since summer 2011.

Modding is my life now.

Please check out my mod :)

https://minecraft.curseforge.com/projects/gadgets-n-goodies-mod?gameCategorySlug=mc-mods&projectID=230028

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.