Jump to content

[UNSOLVED][1.7.2] 3D modeld block


yuvalr00

Recommended Posts

i have few errors in my Renderer calss.I will be happy with a solution or connect in kype(message me your name skype)

 

Here is the class:

 

  public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

 

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        RcTileEntity tileEntityRc = (TileEntityBlockZRail)tileEntity;

       

        renderBlockRail(tileEntityRc, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Yuvalmod.RC);

        GL11.glPopMatrix();

    }

 

    public void renderBlockYour(RcTileEntity tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

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

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTexture("yourTexturePath");

       

 

        GL11.glPopMatrix();

    }

Link to comment
Share on other sites

i have few errors in my Renderer calss.I will be happy with a solution or connect in kype(message me your name skype)

 

Here is the class:

 

  public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

 

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        RcTileEntity tileEntityRc = (TileEntityBlockZRail)tileEntity;

       

        renderBlockRail(tileEntityRc, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Yuvalmod.RC);

        GL11.glPopMatrix();

    }

 

    public void renderBlockYour(RcTileEntity tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

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

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTexture("yourTexturePath");

       

 

        GL11.glPopMatrix();

    }

 

In your code above, the struckout text does not match up. Why cast to a class and then assign the cast to a different class? That is just plain wrong!

The underlined text also does not match. What method are you calling? Include that code so we can see what the problem is. The method renderBlockYour() does not seem to be called at all. Why did you include it?

Link to comment
Share on other sites

Well. i fixed some stuff and there is my new class but i still have 4 errors:

 

public class RcTileEntityRenderer extends TileEntitySpecialRenderer {

 

    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

 

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        TileEntity tileEntityRc = tileEntity;

       

        renderBlockRail(tileEntityRc, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Yuvalmod.RC);

        GL11.glPopMatrix();

    }

   

 

    public void renderBlockYour(RcTileEntity tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

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

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTexture("yourTexturePath");

 

       

 

        GL11.glPopMatrix();

    }

   

    public RcTileEntityRenderer()

    {

      model = new Rcmodel();

    }

   

   

   

    public static final ResourceLocation texture = new ResourceLocation("Yuvalmod", "textures/models/mytexture");

 

}

 

Link to comment
Share on other sites

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.