[QUESTION/SUGGESTION] Spritesheet

  • I'm curious, why exactly are we not allowed to define our own spritesheet for crops? The code required is quite simple.


    In the crop custom renderer code, which I assume exists:

    Code
    1. MinecraftForgeClient.bindTexture(cropCard.getTextureFile());
    2. // do render


    I can see you not wanting to cause performance issues with spritesheet spam, but it seems highly limiting to force users to merge their spritesheets.


    I was thinking to make a Creosote Bush for Railcraft, but the spritesheet issue and the complexity of the code combined with the difficulty in testing is discouraging to say the least.

  • Ehm, this is the code he would add to make additional spreadsheets working.

    Also, it's inside of Forge itself. I believe the latest version alongside LexManos' fix with the whole version bug. Unless they've got a working official copy running now.

  • Where'd you find this code?


    RenderBlocks is where I probably saw it first. I've been using that function in my own custom renderers to switch spritesheets for a long time. The Railcraft Tank Cart for example uses the Buildcraft spritesheet to render the tank.


    EDIT: It was not RenderBlocks, it was probably the Buildcraft source that first saw it being used to render liquids. The underlying function is called in WorldRenderer for all blocks in the game though.

  • Interesting. Didn't knew about this before and i'm not sure whether it's present, given i'm using a minimally altered version of the Flower-Renderer.

  • As far as I know, you just need to call it before you start tessellating. The underlying function is called in WorldRenderer at the start of the render pipe for all bocks, with either a custom spritesheet (via ITextureProvider) or the vanilla spritesheet. Subsequent calls override previous calls. Item renderers can use it as well.