Jump to content

[1.7.10] Trying to render a Techne Model, error in code?


JohnnyMccurm

Recommended Posts

Trying to render a Techne Model

 

I get an error in my ClientProxy class that looks like this

 

public class ClientProxy extends CommonProxy {


    public void registerRenderThings()
    {
        //rubble
        TileEntitySpecialRenderer render = new RendererJohnnyBlockRubble();
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJohnnyBlockRubble, render);
    }

    public void registerTileEntitySpecialRenderer()
    {

    }

} 

 

Error is the first Parameter in "ClientRegistry.bindTileEntitySpecialRenderer" which would be "TileEntityJohnnyBlockRubble"

 

Any idea what I've done wrong?

 

Here's the code for My BlockJohnnyBlockRubble (The block that will eventually be the techne model

 

public class BlockJohnnyBlockRubble extends BaseJohnnyBlock
{
    public BlockJohnnyBlockRubble()
    {
        super();
        this.setBlockName("johnnyFaceBlockRubble");
        this.setStepSound(soundTypeStone);
        this.setHardness(10.0f);
        this.setResistance(20.0f);
        this.setHarvestLevel("pickaxe", 2);


    }


    public TileEntity createNewTileEntity(World var1, int var2)
    {
        return new TileEntityJohnnyBlockRubble();
    }

    public int getRenderType()
    {
        return 100;
    }

    public boolean isOpaqueCube()
    {
        return false;
    }


    public boolean renderAsNormalBlock()
    {
        return false;
    }




} 

 

 

The "TileEntityJohnnyBlockRubble" class exists but it doesn't contain any code.

 

 

Think Java is tough? try BrainFuck!

Link to comment
Share on other sites

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJohnnyBlockRubble.class, render);

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Nah, everyone else calls me an asshole because they're too [lazy|stupid|assholish] to go to the effort of helping themselves.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I have another issue if you feel like helping out.

 

My block is completely invisible.

 

I hear this has something to do with extending the BlockContainer class instead of my BaseBlock

 

But when I do that I get a bunch of errors to do with "material" any idea what I'm doing wrong?

 

Think Java is tough? try BrainFuck!

Link to comment
Share on other sites

You need to supply a material.  Look at all the other blocks:

blockRegistry.addObject(20, "glass", (new BlockGlass(Material.glass, false))...

public BlockStone()
    {
        super(Material.rock); //here
        this.setCreativeTab(CreativeTabs.tabBlock);
    }

 

As for invisible, that has nothing to do with BlockContainer.  You registered a renderer for your block, and likely, it isn't rendering anything.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I managed to fix it, the renderer is working and this is the un-textured way my model should look, the problem with that code was that I was doing this:

 

public static final BaseJohnnyBlock johnnyFaceBlockRubble = new BlockJohnnyBlockRubble();

 

Instead of this

 

public static final BlockJohnnyBlockRubble johnnyFaceBlockRubble = new BlockJohnnyBlockRubble(Material.rock);

 

 

My texture and name aren't working though now. :(

 

 

**UPDATE**

 

Stupid error to do with my renderer not finding the correct path for my image, my fault for putting "model" instead of "models"

 

last error to fix is the name of the item to be placed, don't know how to fix this one.

 

 

 

 

Think Java is tough? try BrainFuck!

Link to comment
Share on other sites

I managed to fix it, the renderer is working and this is the un-textured way my model should look, the problem with that code was that I was doing this:

 

public static final BaseJohnnyBlock johnnyFaceBlockRubble = new BlockJohnnyBlockRubble();

 

Instead of this

 

public static final BlockJohnnyBlockRubble johnnyFaceBlockRubble = new BlockJohnnyBlockRubble(Material.rock);

 

 

My texture and name aren't working though now. :(

 

Can you show your renderer?

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

last error to fix is the name of the item to be placed, don't know how to fix this one.

 

Lang files.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.