Jump to content

Alternative Renderer for Texture override of the falling sand entity


omolen

Recommended Posts

Hello, i am making a mod that adds an new type of obsidian, obsidiand (I'm still working on the name) it's sand from obzidian and therefore it has gravity, so I let it extend BlockSand and I do the usual stuff and it works. But whenever it falls the texture changes to the equivaltent texture from terrain.png, after some searching I found the spot I have to edit: in RenderFallingSand.java is this line :

public void doRenderFallingSand(EntityFallingSand par1EntityFallingSand, double par2, double par4, double par6, float par8, float par9)
    {
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par2, (float)par4, (float)par6);
        this.loadTexture("/terrain.png");
        Block var10 = Block.blocksList[par1EntityFallingSand.blockID];
        World var11 = par1EntityFallingSand.getWorld();
        GL11.glDisable(GL11.GL_LIGHTING);

        if (var10 == Block.dragonEgg)
        {
            this.renderBlocks.blockAccess = var11;
            Tessellator var12 = Tessellator.instance;
            var12.startDrawingQuads();
            var12.setTranslation((double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posX)) - 0.5F), (double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posY)) - 0.5F), (double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posZ)) - 0.5F));
            this.renderBlocks.renderBlockByRenderType(var10, MathHelper.floor_double(par1EntityFallingSand.posX), MathHelper.floor_double(par1EntityFallingSand.posY), MathHelper.floor_double(par1EntityFallingSand.posZ));
            var12.setTranslation(0.0D, 0.0D, 0.0D);
            var12.draw();
        }
        else if (var10 != null)
        {
            this.renderBlocks.func_78588_a(var10, var11, MathHelper.floor_double(par1EntityFallingSand.posX), MathHelper.floor_double(par1EntityFallingSand.posY), MathHelper.floor_double(par1EntityFallingSand.posZ), par1EntityFallingSand.field_70285_b);
        }

        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    }

so I thought I would just make an RenderFallingObsidiand wich extends RenderFallingSand and override the texture. But I can't find the place in the code where Minecraft decides which renderer to use.

 

I have been stuck with this for days and i can't find a solution.

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.