Jump to content

Recommended Posts

Posted

When i'm destroying a block (made with the rendering handler) in survival mode, it glows

 

CODES:

 

RenderGlaciaColumn:

 

package net.minecraft.src;

import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import org.lwjgl.opengl.GL11;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Icon;

public class RenderGlaciaColumn implements ISimpleBlockRenderingHandler
{
public Icon getColumnIcon(int par1)
    {
return mod_Glacia.GlaciaColumn.getIcon(0, par1);
}

private ModelGlaciaColumn aModel;
private static final ResourceLocation GlaciaColumn = new ResourceLocation("textures/entity/Glacia/GlaciaColumn.png");

public RenderGlaciaColumn()
    {
        aModel = new ModelGlaciaColumn();
    }

    public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
double minU2 = (double)getColumnIcon(0).getMinU();
double minV2 = (double)getColumnIcon(0).getMinV();
double maxU2 = (double)getColumnIcon(0).getMaxU();
double maxV2 = (double)getColumnIcon(0).getMaxV();
double minU1 = (double)getColumnIcon(1).getMinU();
    double minV1 = (double)getColumnIcon(1).getMinV();
    double maxU1 = (double)getColumnIcon(1).getMaxU();
    double maxV1 = (double)getColumnIcon(1).getMaxV();
double minU3 = (double)getColumnIcon(2).getMinU();
    double minV3 = (double)getColumnIcon(2).getMinV();
    double maxU3 = (double)getColumnIcon(2).getMaxU();
    double maxV3 = (double)getColumnIcon(2).getMaxV();
Tessellator tessellator = Tessellator.instance;
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

//portantdown face 1

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    tessellator.addVertexWithUV(1.0, 0.0, 0.0, maxU2, maxV2);
tessellator.addVertexWithUV(0.0, 0.0, 0.0, maxU2, minV2);
tessellator.addVertexWithUV(0.0, 0.25, 0.0, minU2, minV2);
tessellator.addVertexWithUV(1.0, 0.25, 0.0, minU2, maxV2);
    tessellator.draw();

//portantdown face inverse  1

tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addVertexWithUV(1.0, 0.25, 1.0, minU2, maxV2);
tessellator.addVertexWithUV(0.0, 0.25, 1.0, minU2, minV2);
tessellator.addVertexWithUV(0.0, 0.0, 1.0, maxU2, minV2);
tessellator.addVertexWithUV(1.0, 0.0, 1.0, maxU2, maxV2);
tessellator.draw();

// portantdown face 2
tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(0.0, 0.25, 1.0, minU2, maxV2);
tessellator.addVertexWithUV(0.0, 0.25, 0.0, minU2, minV2);
tessellator.addVertexWithUV(0.0, 0.0, 0.0, maxU2, minV2);
tessellator.addVertexWithUV(0.0, 0.0, 1.0, maxU2, maxV2);
tessellator.draw();

// portantdown face inverse 2
tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(1.0, 0.0, 1.0, maxU2, maxV2);
tessellator.addVertexWithUV(1.0, 0.0, 0.0, maxU2, minV2);
tessellator.addVertexWithUV(1.0, 0.25, 0.0, minU2, minV2);
tessellator.addVertexWithUV(1.0, 0.25, 1.0, minU2, maxV2);
tessellator.draw();

// portantup face 1
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.addVertexWithUV(1.0, 0.75, 0.0, minU2, maxV2);
tessellator.addVertexWithUV(0.0, 0.75, 0.0, minU2, minV2);
tessellator.addVertexWithUV(0.0, 1.0, 0.0, maxU2, minV2);
tessellator.addVertexWithUV(1.0, 1.0, 0.0, maxU2, maxV2);
tessellator.draw();

// portantup face inverse 1
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.addVertexWithUV(1.0, 1.0, 1.0, maxU2, maxV2);
tessellator.addVertexWithUV(0.0, 1.0, 1.0, maxU2, minV2);
tessellator.addVertexWithUV(0.0, 0.75, 1.0, minU2, minV2);
tessellator.addVertexWithUV(1.0, 0.75, 1.0, minU2, maxV2);
tessellator.draw();

// portantup face 2
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(1.0, 0.75, 1.0, minU2, maxV2);
tessellator.addVertexWithUV(1.0, 0.75, 0.0, minU2, minV2);
tessellator.addVertexWithUV(1.0, 1.0, 0.0, maxU2, minV2);
tessellator.addVertexWithUV(1.0, 1.0, 1.0, maxU2, maxV2);
tessellator.draw();

// portantup face inverse 2
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(0.0, 1.0, 1.0, maxU2, maxV2);
tessellator.addVertexWithUV(0.0, 1.0, 0.0, maxU2, minV2);
tessellator.addVertexWithUV(0.0, 0.75, 0.0, minU2, minV2);
tessellator.addVertexWithUV(0.0, 0.75, 1.0, minU2, maxV2);
tessellator.draw();

// portantup base up
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV(0.0, 1.0, 0.0, maxU1, maxV1);
tessellator.addVertexWithUV(0.0, 1.0, 1.0, maxU1, minV1);
tessellator.addVertexWithUV(1.0, 1.0, 1.0, minU1, minV1);
tessellator.addVertexWithUV(1.0, 1.0, 0.0, minU1, maxV1);
tessellator.draw();

// portantup base down
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(1.0, 0.75, 0.0, minU1, maxV1);
tessellator.addVertexWithUV(1.0, 0.75, 1.0, minU1, minV1);
tessellator.addVertexWithUV(0.0, 0.75, 1.0, maxU1, minV1);
tessellator.addVertexWithUV(0.0, 0.75, 0.0, maxU1, maxV1);
tessellator.draw();

// portantdown base up
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV(0.0, 0.25, 0.0, maxU1, maxV1);
tessellator.addVertexWithUV(0.0, 0.25, 1.0, maxU1, minV1);
tessellator.addVertexWithUV(1.0, 0.25, 1.0, minU1, minV1);
tessellator.addVertexWithUV(1.0, 0.25, 0.0, minU1, maxV1);
tessellator.draw();

// portantdown base down
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(1.0, 0.0, 0.0, minU1, maxV1);
tessellator.addVertexWithUV(1.0, 0.0, 1.0, minU1, minV1);
tessellator.addVertexWithUV(0.0, 0.0, 1.0, maxU1, minV1);
tessellator.addVertexWithUV(0.0, 0.0, 0.0, maxU1, maxV1);
tessellator.draw();

// pillar 1
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.addVertexWithUV(0.25, 0.99, 0.25, minU3, minV3);
tessellator.addVertexWithUV(0.75, 0.99, 0.25, minU3, maxV3);
tessellator.addVertexWithUV(0.75, 0.0, 0.25, maxU3, maxV3);
tessellator.addVertexWithUV(0.25, 0.0, 0.25, maxU3, minV3);
tessellator.draw();

// pillar inverse 1
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addVertexWithUV(0.75, 0.99, 0.75, minU3, minV3);
tessellator.addVertexWithUV(0.25, 0.99, 0.75, minU3, maxV3);
tessellator.addVertexWithUV(0.25, 0.0, 0.75, maxU3, maxV3);
tessellator.addVertexWithUV(0.75, 0.0, 0.75, maxU3, minV3);
tessellator.draw();

// pillar 2
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(0.25, 0.99, 0.75, minU3, minV3);
tessellator.addVertexWithUV(0.25, 0.99, 0.25, minU3, maxV3);
tessellator.addVertexWithUV(0.25, 0.0, 0.25, maxU3, maxV3);
tessellator.addVertexWithUV(0.25, 0.0, 0.75, maxU3, minV3);
tessellator.draw();

// pillar inverse 2
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(0.75, 0.99, 0.25, minU3, minV3);
tessellator.addVertexWithUV(0.75, 0.99, 0.75, minU3, maxV3);
tessellator.addVertexWithUV(0.75, 0.0, 0.75, maxU3, maxV3);
tessellator.addVertexWithUV(0.75, 0.0, 0.25, maxU3, minV3);
tessellator.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}

@Override
    public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
    {
	Tessellator tessellator = Tessellator.instance;
	int lightValue = block.getMixedBrightnessForBlock(world, x, y, z);
	tessellator.setBrightness(lightValue);
	tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);

	if (world.getBlockMetadata(x, y, z) == 3)
	{
	renderColumnFull(tessellator, (double)x, (double)y, (double) z);
	}
	else if (world.getBlockMetadata(x, y, z) == 2)
	{
	renderColumnDown(tessellator, (double)x, (double)y, (double) z);
	} 
	else if (world.getBlockMetadata(x, y, z) == 1)
	{
	renderColumnUp(tessellator, (double)x, (double)y, (double) z);
	}
	else
	{
	renderColumnCenter(tessellator, (double)x, (double)y, (double) z);
	} 
	return true;


	//aModel.ColumnDown.showModel = false;
	//aModel.ColumnUp.showModel = false;
	//aModel.ColumnFull.showModel = false;
	//aModel.PortantUp.showModel = true;
	//aModel.PortantDown.showModel = true;
	//aModel.ColumnCenter.showModel = true;

	//GL11.glBindTexture(GL11.GL_TEXTURE_2D, 2);
	//GL11.glPushMatrix();
	//GL11.glTranslatef((float)x + 0.5F, (float)y - 0.50F, (float)z + 0.5F);
	//GL11.glRotatef(0, 0F, 0F, 0F);
	//GL11.glPushMatrix();
	//aModel.renderModel(0.0625F);
	//GL11.glPopMatrix();
	//GL11.glPopMatrix();

	//tessellator.startDrawingQuads();
	//tessellator.setNormal(0.0F, -1.0F, 0.0F);
	//tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, minU1, maxV1);
	//tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, minU1, minV1);
	//tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU1, minV1);
	//tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU1, maxV1);
}

    public boolean shouldRender3DInInventory(){ return true; }

@Override
public int getRenderId()
{
	return mod_Glacia.rendercolumnID;
}

private void renderColumnFull(Tessellator tessellator, double x, double y, double z) {

    double minU2 = (double)getColumnIcon(0).getMinU();
    double minV2 = (double)getColumnIcon(0).getMinV();
    double maxU2 = (double)getColumnIcon(0).getMaxU();
    double maxV2 = (double)getColumnIcon(0).getMaxV();
    double minU1 = (double)getColumnIcon(1).getMinU();
    double minV1 = (double)getColumnIcon(1).getMinV();
    double maxU1 = (double)getColumnIcon(1).getMaxU();
    double maxV1 = (double)getColumnIcon(1).getMaxV();
double minU3 = (double)getColumnIcon(2).getMinU();
    double minV3 = (double)getColumnIcon(2).getMinV();
    double maxU3 = (double)getColumnIcon(2).getMaxU();
    double maxV3 = (double)getColumnIcon(2).getMaxV();

// portantdown face 1
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+0.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown face inverse 1
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+1.0, minU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+1.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown face 2
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+1.0, minU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown face inverse 2
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+1.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+0.0, minU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+0.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face inverse 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+1.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+1.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+1.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+1.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+1.0, minU2, maxV2);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+1.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face inverse 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+1.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+1.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup base up
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+0.0, maxU1, maxV1);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+0.0, minU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup base down
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+0.0, minU1, maxV1);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+0.0, maxU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown base up
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+0.0, maxU1, maxV1);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+0.0, minU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown base down
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, minU1, maxV1);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();
  }
  
  private void renderColumnUp(Tessellator tessellator, double x, double y, double z) {

    double minU2 = (double)getColumnIcon(0).getMinU();
    double minV2 = (double)getColumnIcon(0).getMinV();
    double maxU2 = (double)getColumnIcon(0).getMaxU();
    double maxV2 = (double)getColumnIcon(0).getMaxV();
    double minU1 = (double)getColumnIcon(1).getMinU();
    double minV1 = (double)getColumnIcon(1).getMinV();
    double maxU1 = (double)getColumnIcon(1).getMaxU();
    double maxV1 = (double)getColumnIcon(1).getMaxV();
double minU3 = (double)getColumnIcon(2).getMinU();
    double minV3 = (double)getColumnIcon(2).getMinV();
    double maxU3 = (double)getColumnIcon(2).getMaxU();
    double maxV3 = (double)getColumnIcon(2).getMaxV();

// portantup face 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+0.0, minU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+0.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face inverse 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+1.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+1.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+1.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+1.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+1.0, minU2, maxV2);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+1.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup face inverse 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+1.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+1.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup base up
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+0.0, maxU1, maxV1);
tessellator.addVertexWithUV(x+0.0, y+1.0, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+1.0, z+0.0, minU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// portantup base down
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+0.0, minU1, maxV1);
tessellator.addVertexWithUV(x+1.0, y+0.75, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.75, z+0.0, maxU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();
  }
  
  private void renderColumnDown(Tessellator tessellator, double x, double y, double z) {

    double minU2 = (double)getColumnIcon(0).getMinU();
    double minV2 = (double)getColumnIcon(0).getMinV();
    double maxU2 = (double)getColumnIcon(0).getMaxU();
    double maxV2 = (double)getColumnIcon(0).getMaxV();
    double minU1 = (double)getColumnIcon(1).getMinU();
    double minV1 = (double)getColumnIcon(1).getMinV();
    double maxU1 = (double)getColumnIcon(1).getMaxU();
    double maxV1 = (double)getColumnIcon(1).getMaxV();
double minU3 = (double)getColumnIcon(2).getMinU();
    double minV3 = (double)getColumnIcon(2).getMinV();
    double maxU3 = (double)getColumnIcon(2).getMaxU();
    double maxV3 = (double)getColumnIcon(2).getMaxV();

// portantdown face 1
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+0.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown face inverse 1
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+1.0, minU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+1.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown face 2
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+1.0, minU2, maxV2);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown face inverse 2
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, maxU2, maxV2);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, maxU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+0.0, minU2, minV2);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+1.0, minU2, maxV2);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown base up
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+0.0, maxU1, maxV1);
tessellator.addVertexWithUV(x+0.0, y+0.25, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+1.0, y+0.25, z+0.0, minU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// portantdown base down
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+0.0, minU1, maxV1);
tessellator.addVertexWithUV(x+1.0, y+0.0, z+1.0, minU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+1.0, maxU1, minV1);
tessellator.addVertexWithUV(x+0.0, y+0.0, z+0.0, maxU1, maxV1);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 1
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 2
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();
  }
  
  private void renderColumnCenter(Tessellator tessellator, double x, double y, double z) {

    double minU2 = (double)getColumnIcon(0).getMinU();
    double minV2 = (double)getColumnIcon(0).getMinV();
    double maxU2 = (double)getColumnIcon(0).getMaxU();
    double maxV2 = (double)getColumnIcon(0).getMaxV();
    double minU1 = (double)getColumnIcon(1).getMinU();
    double minV1 = (double)getColumnIcon(1).getMinV();
    double maxU1 = (double)getColumnIcon(1).getMaxU();
    double maxV1 = (double)getColumnIcon(1).getMaxV();
double minU3 = (double)getColumnIcon(2).getMinU();
    double minV3 = (double)getColumnIcon(2).getMinV();
    double maxU3 = (double)getColumnIcon(2).getMaxU();
    double maxV3 = (double)getColumnIcon(2).getMaxV();

// pillar 1
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 1
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar 2
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.75, minU3, minV3);
tessellator.addVertexWithUV(x+0.25, y+1.0, z+0.25, minU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.25, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.25, y+0.0, z+0.75, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();

// pillar inverse 2
tessellator.setNormal(1.0F, 0.0F, 0.0F);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.25, minU3, minV3);
tessellator.addVertexWithUV(x+0.75, y+1.0, z+0.75, minU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.75, maxU3, maxV3);
tessellator.addVertexWithUV(x+0.75, y+0.0, z+0.25, maxU3, minV3);
tessellator.draw();
tessellator.startDrawingQuads();
  }
}

 

 

BlockGlaciaColumn

 

package net.minecraft.src;

import java.util.Random;
import net.minecraft.block.*;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.IPlantable;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAnvilBlock;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemCloth;
import net.minecraft.item.ItemColored;
import net.minecraft.item.ItemLeaves;
import net.minecraft.item.ItemLilyPad;
import net.minecraft.item.ItemMultiTextureTile;
import net.minecraft.item.ItemPiston;
import net.minecraft.item.ItemSlab;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldProviderEnd;
import net.minecraftforge.common.*;
import static net.minecraftforge.common.ForgeDirection.*;
import static net.minecraftforge.common.EnumPlantType.*;
import net.minecraftforge.common.EnumPlantType;
import net.minecraft.util.MathHelper;
import net.minecraft.entity.EntityLiving;
import org.lwjgl.opengl.GL11;
import net.minecraft.util.Icon;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class BlockGlaciaColumn extends Block
{  
    @SideOnly(Side.CLIENT)
    private Icon IconGlaciaColumnPortantFace;
private Icon IconGlaciaColumnPortantBase;
private Icon IconGlaciaColumnPillar;

@Override
public Icon getIcon(int par1, int par2)
    {
	if (par2 == 2)
	{
		return IconGlaciaColumnPillar;
	}
	if (par2 == 1)
	{
		return IconGlaciaColumnPortantBase;
	}
	else
	{
		return IconGlaciaColumnPortantFace;
	}
    }

    protected BlockGlaciaColumn(int i)
    {
        super(i,Material.rock);
	float var4 = 0.2F;
    }

public void registerIcons(IconRegister par1IconRegister)
    {
        this.IconGlaciaColumnPortantFace = par1IconRegister.registerIcon("Glacia/GlaciaColumnPortantFace");
	this.IconGlaciaColumnPortantBase = par1IconRegister.registerIcon("Glacia/GlaciaColumnPortantBase");
	this.IconGlaciaColumnPillar = par1IconRegister.registerIcon("Glacia/GlaciaColumnPillar");
    }

public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
    {
        return canBlockStay(par1World, par2, par3, par4);
    }

public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
        if (!this.canBlockStay(par1World, par2, par3, par4))
        {
            this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
            par1World.setBlock(par2, par3, par4, 0);
        }
    }

public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) 
{
	Block downblock = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
	Block upblock = blocksList[par1World.getBlockId(par2, par3 + 1, par4)];

	if (downblock != null) {downblock.canBlockStay(par1World, par2, par3 - 1, par4);}
	if (upblock != null) {upblock.canBlockStay(par1World, par2, par3 + 1, par4);}
}

public boolean canBlockStay(World par1World, int par2, int par3, int par4)
    {
    Block downblock = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
	Block upblock = blocksList[par1World.getBlockId(par2, par3 + 1, par4)];
	if (downblock != null && upblock!=null)
	{
		if (upblock.blockID == mod_Glacia.GlaciaColumn.blockID && downblock.blockID == mod_Glacia.GlaciaColumn.blockID)
		{par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2);}
		else if (upblock.blockID != mod_Glacia.GlaciaColumn.blockID && downblock.blockID == mod_Glacia.GlaciaColumn.blockID)
		{par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);}
		else if (upblock.blockID == mod_Glacia.GlaciaColumn.blockID && downblock.blockID != mod_Glacia.GlaciaColumn.blockID)
		{par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);}
		else if (upblock.blockID != mod_Glacia.GlaciaColumn.blockID && downblock.blockID != mod_Glacia.GlaciaColumn.blockID)
		{par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);}
	}
	else if (downblock != null)
	{
		if (downblock.blockID == mod_Glacia.GlaciaColumn.blockID)
		{par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);}
		else if (downblock.blockID != mod_Glacia.GlaciaColumn.blockID && downblock.isBlockNormalCube(par1World , par2, par3, par4))
		{par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);}
	}

        return (downblock != null && (downblock.isBlockNormalCube(par1World , par2, par3, par4) || downblock.blockID == this.blockID || downblock.blockID == Block.ice.blockID));
    }

public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
    {
	Block downblock = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];

	if (downblock != null && downblock.blockID != mod_Glacia.GlaciaColumn.blockID) {downblock.canBlockStay(par1World, par2, par3 - 1, par4);}

	checkFlowerChange(par1World, par2, par3, par4);
}

public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
	Block downblock = blocksList[par1World.getBlockId(par2, par3 - 1, par4)];

	if (downblock != null && downblock.blockID != mod_Glacia.GlaciaColumn.blockID) {downblock.canBlockStay(par1World, par2, par3 - 1, par4);}

	checkFlowerChange(par1World, par2, par3, par4);
}

protected final void checkFlowerChange(World par1World, int par2, int par3, int par4)
    {
        if (!this.canBlockStay(par1World, par2, par3, par4))
        {
            this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
            par1World.setBlock(par2, par3, par4, 0);
        }
    }

@Override
public int getRenderType()
    {
        return mod_Glacia.rendercolumnID;
    }
   
    public int idDropped(int i, Random random, int j)
    {
        return mod_Glacia.GlaciaColumn.blockID;
    }
   
    public int quantityDropped(Random var1)
    {
        return 1;
    }
   
@Override
    public boolean isOpaqueCube()
    {
        return false;
    }

@Override
public int getRenderBlockPass()
    {
        return 1;
    }

@Override
    public boolean renderAsNormalBlock()
    {
        return false;
    }
}

 

 

please i really need help, i can't figure it out

Actually i don't know what to write in this signature soooo.... anyway

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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