Jump to content

Recommended Posts

Posted

Hey,

I want to know where I find the beacon renderer code. I mean the code, which forces the glass, obsidian and the light in the middle to render correctly.. I remember seeing it somewhere, but today I don't know where it is :D

Posted

That's the beam what I'm not searching for :/

 

Search in RenderBlocks(package net.minecraft.client.renderer;).Its just blocktype , like torch rails and other that kind of renderers.

 

    public boolean renderBlockBeacon(BlockBeacon par1BlockBeacon, int par2, int par3, int par4)
    {
        float f = 0.1875F;
        this.setOverrideBlockTexture(this.getBlockIcon(Block.glass));
        this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.renderAllFaces = true;
        this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian));
        this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)f, 0.875D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon));
        this.setRenderBounds(0.1875D, (double)f, 0.1875D, 0.8125D, 0.875D, 0.8125D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.renderAllFaces = false;
        this.clearOverrideBlockTexture();
        return true;
    }

Posted

Hi

 

What I did:

1) Open TileBeacon

2) search for usage of getRenderType

3) --> RenderBlocks.renderBlockByRenderType

4) --> search for type 34 gives

                case 34: return this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4);

5) ---> RenderBlocks.renderBlockBeacon

 

-TGG

Posted

That's the beam what I'm not searching for :/

 

Search in RenderBlocks(package net.minecraft.client.renderer;).Its just blocktype , like torch rails and other that kind of renderers.

 

    public boolean renderBlockBeacon(BlockBeacon par1BlockBeacon, int par2, int par3, int par4)
    {
        float f = 0.1875F;
        this.setOverrideBlockTexture(this.getBlockIcon(Block.glass));
        this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.renderAllFaces = true;
        this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian));
        this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)f, 0.875D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon));
        this.setRenderBounds(0.1875D, (double)f, 0.1875D, 0.8125D, 0.875D, 0.8125D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.renderAllFaces = false;
        this.clearOverrideBlockTexture();
        return true;
    }

Thanks :)

Hi

 

What I did:

1) Open TileBeacon

2) search for usage of getRenderType

3) --> RenderBlocks.renderBlockByRenderType

4) --> search for type 34 gives

                case 34: return this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4);

5) ---> RenderBlocks.renderBlockBeacon

 

-TGG

Do you know how to create a new renderBlockByRenderType?

 

Posted

That's the beam what I'm not searching for :/

 

Search in RenderBlocks(package net.minecraft.client.renderer;).Its just blocktype , like torch rails and other that kind of renderers.

 

    public boolean renderBlockBeacon(BlockBeacon par1BlockBeacon, int par2, int par3, int par4)
    {
        float f = 0.1875F;
        this.setOverrideBlockTexture(this.getBlockIcon(Block.glass));
        this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.renderAllFaces = true;
        this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian));
        this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)f, 0.875D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon));
        this.setRenderBounds(0.1875D, (double)f, 0.1875D, 0.8125D, 0.875D, 0.8125D);
        this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
        this.renderAllFaces = false;
        this.clearOverrideBlockTexture();
        return true;
    }

Thanks :)

Hi

 

What I did:

1) Open TileBeacon

2) search for usage of getRenderType

3) --> RenderBlocks.renderBlockByRenderType

4) --> search for type 34 gives

                case 34: return this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4);

5) ---> RenderBlocks.renderBlockBeacon

 

-TGG

Do you know how to create a new renderBlockByRenderType?

Hi

 

Some background information in this link that might help

http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html

 

A few of the other links in the "Blocks" section might also be interesting

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

 

-TGG

 

 

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.