Jump to content

Recommended Posts

Posted

so, im looking at recreating a storage tank similar to buildcrafts without looking at any of their code, and iv managed to make it up to using the metadata to store how much water is in the storage tank, but i ran into the problems of textures not working the way i want it to. so i started thinking of how else it could be done, and remembered that cauldrons seem to hold actual water, but i cannot for the life of me see where the coding for this is as it is not in BlockCauldron (i checked multiple times with every method). does anyone know of the class that handles the water within a cauldron? and the class where it is rendered? i know it uses render type 24, but i do not know where it is used.

 

thanks.

Posted

You mean this?

 

Found in RenderBlocks

 

public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4)
    {
        int var5 = par1Block.getRenderType();
        par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4);
        switch (var5)
        {
            case 0:  return renderStandardBlock(par1Block, par2, par3, par4);
            case 4:  return renderBlockFluids(par1Block, par2, par3, par4);
            case 13: return renderBlockCactus(par1Block, par2, par3, par4);
            case 1:  return renderCrossedSquares(par1Block, par2, par3, par4);
            case 19: return renderBlockStem(par1Block, par2, par3, par4);
            case 23: return renderBlockLilyPad(par1Block, par2, par3, par4);
            case 6:  return renderBlockCrops(par1Block, par2, par3, par4);
            case 2:  return renderBlockTorch(par1Block, par2, par3, par4);
            case 3:  return renderBlockFire(par1Block, par2, par3, par4);
            case 5:  return renderBlockRedstoneWire(par1Block, par2, par3, par4);
            case 8:  return renderBlockLadder(par1Block, par2, par3, par4);
            case 7:  return renderBlockDoor(par1Block, par2, par3, par4);
            case 9:  return renderBlockMinecartTrack((BlockRail)par1Block, par2, par3, par4);
            case 10: return renderBlockStairs(par1Block, par2, par3, par4);
            case 27: return renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4);
            case 11: return renderBlockFence((BlockFence)par1Block, par2, par3, par4);
            case 12: return renderBlockLever(par1Block, par2, par3, par4);
            case 14: return renderBlockBed(par1Block, par2, par3, par4);
            case 15: return renderBlockRepeater(par1Block, par2, par3, par4);
            case 16: return renderPistonBase(par1Block, par2, par3, par4, false);
            case 17: return renderPistonExtension(par1Block, par2, par3, par4, true);
            case 18: return renderBlockPane((BlockPane)par1Block, par2, par3, par4);
            case 20: return renderBlockVine(par1Block, par2, par3, par4);
            case 21: return renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4);
            case 24: return renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4);
            case 25: return renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4);
            case 26: return renderBlockEndPortalFrame(par1Block, par2, par3, par4);
            default: return FMLClientHandler.instance().renderWorldBlock(this, blockAccess, par2, par3, par4, par1Block, var5);
        }
    }

 

 

(Still in RenderBlocks)

renderBlockCauldron

 

 public boolean renderBlockCauldron(BlockCauldron par1BlockCauldron, int par2, int par3, int par4)
    {
        this.renderStandardBlock(par1BlockCauldron, par2, par3, par4);
        Tessellator var5 = Tessellator.instance;
        var5.setBrightness(par1BlockCauldron.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
        float var6 = 1.0F;
        int var7 = par1BlockCauldron.colorMultiplier(this.blockAccess, par2, par3, par4);
        float var8 = (float)(var7 >> 16 & 255) / 255.0F;
        float var9 = (float)(var7 >> 8 & 255) / 255.0F;
        float var10 = (float)(var7 & 255) / 255.0F;
        float var12;

        if (EntityRenderer.anaglyphEnable)
        {
            float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
            var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
            float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
            var8 = var11;
            var9 = var12;
            var10 = var13;
        }

        var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10);
        short var16 = 154;
        var12 = 0.125F;
        this.renderSouthFace(par1BlockCauldron, (double)((float)par2 - 1.0F + var12), (double)par3, (double)par4, var16);
        this.renderNorthFace(par1BlockCauldron, (double)((float)par2 + 1.0F - var12), (double)par3, (double)par4, var16);
        this.renderWestFace(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var12), var16);
        this.renderEastFace(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var12), var16);
        short var17 = 139;
        this.renderTopFace(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + 0.25F), (double)par4, var17);
        this.renderBottomFace(par1BlockCauldron, (double)par2, (double)((float)par3 + 1.0F - 0.75F), (double)par4, var17);
        int var14 = this.blockAccess.getBlockMetadata(par2, par3, par4);

        if (var14 > 0)
        {
            short var15 = 205;

            if (var14 > 3)
            {
                var14 = 3;
            }

            this.renderTopFace(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)par4, var15);
        }

        return true;
    }

 

Posted

You mean this?

 

Found in RenderBlocks

 

public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4)
    {
        int var5 = par1Block.getRenderType();
        par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4);
        switch (var5)
        {
            case 0:  return renderStandardBlock(par1Block, par2, par3, par4);
            case 4:  return renderBlockFluids(par1Block, par2, par3, par4);
            case 13: return renderBlockCactus(par1Block, par2, par3, par4);
            case 1:  return renderCrossedSquares(par1Block, par2, par3, par4);
            case 19: return renderBlockStem(par1Block, par2, par3, par4);
            case 23: return renderBlockLilyPad(par1Block, par2, par3, par4);
            case 6:  return renderBlockCrops(par1Block, par2, par3, par4);
            case 2:  return renderBlockTorch(par1Block, par2, par3, par4);
            case 3:  return renderBlockFire(par1Block, par2, par3, par4);
            case 5:  return renderBlockRedstoneWire(par1Block, par2, par3, par4);
            case 8:  return renderBlockLadder(par1Block, par2, par3, par4);
            case 7:  return renderBlockDoor(par1Block, par2, par3, par4);
            case 9:  return renderBlockMinecartTrack((BlockRail)par1Block, par2, par3, par4);
            case 10: return renderBlockStairs(par1Block, par2, par3, par4);
            case 27: return renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4);
            case 11: return renderBlockFence((BlockFence)par1Block, par2, par3, par4);
            case 12: return renderBlockLever(par1Block, par2, par3, par4);
            case 14: return renderBlockBed(par1Block, par2, par3, par4);
            case 15: return renderBlockRepeater(par1Block, par2, par3, par4);
            case 16: return renderPistonBase(par1Block, par2, par3, par4, false);
            case 17: return renderPistonExtension(par1Block, par2, par3, par4, true);
            case 18: return renderBlockPane((BlockPane)par1Block, par2, par3, par4);
            case 20: return renderBlockVine(par1Block, par2, par3, par4);
            case 21: return renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4);
            case 24: return renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4);
            case 25: return renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4);
            case 26: return renderBlockEndPortalFrame(par1Block, par2, par3, par4);
            default: return FMLClientHandler.instance().renderWorldBlock(this, blockAccess, par2, par3, par4, par1Block, var5);
        }
    }

 

 

(Still in RenderBlocks)

renderBlockCauldron

 

 public boolean renderBlockCauldron(BlockCauldron par1BlockCauldron, int par2, int par3, int par4)
    {
        this.renderStandardBlock(par1BlockCauldron, par2, par3, par4);
        Tessellator var5 = Tessellator.instance;
        var5.setBrightness(par1BlockCauldron.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
        float var6 = 1.0F;
        int var7 = par1BlockCauldron.colorMultiplier(this.blockAccess, par2, par3, par4);
        float var8 = (float)(var7 >> 16 & 255) / 255.0F;
        float var9 = (float)(var7 >> 8 & 255) / 255.0F;
        float var10 = (float)(var7 & 255) / 255.0F;
        float var12;

        if (EntityRenderer.anaglyphEnable)
        {
            float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
            var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
            float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
            var8 = var11;
            var9 = var12;
            var10 = var13;
        }

        var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10);
        short var16 = 154;
        var12 = 0.125F;
        this.renderSouthFace(par1BlockCauldron, (double)((float)par2 - 1.0F + var12), (double)par3, (double)par4, var16);
        this.renderNorthFace(par1BlockCauldron, (double)((float)par2 + 1.0F - var12), (double)par3, (double)par4, var16);
        this.renderWestFace(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var12), var16);
        this.renderEastFace(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var12), var16);
        short var17 = 139;
        this.renderTopFace(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + 0.25F), (double)par4, var17);
        this.renderBottomFace(par1BlockCauldron, (double)par2, (double)((float)par3 + 1.0F - 0.75F), (double)par4, var17);
        int var14 = this.blockAccess.getBlockMetadata(par2, par3, par4);

        if (var14 > 0)
        {
            short var15 = 205;

            if (var14 > 3)
            {
                var14 = 3;
            }

            this.renderTopFace(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)par4, var15);
        }

        return true;
    }

 

thanks, thats great. i thought id checked RenderBlock, but i must have missed it among the 5700 lines of code in there =.=

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.