Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Source code can be found in my git repo: https://github.com/UntouchedWagons/PowerLines

 

My mod will add, among other things, a large power line like the ones you find outside. I've made a babby's first model using Tabula and have hacked together the rendering stuff using Mekanism as a point of reference. The large power line is supposed to look like this: http://i.imgur.com/na6ceWe.png but instead looks like this: http://i.imgur.com/qPOXbjC.png What did I do wrong? It's bound to be something stupidly simple.

 

I know I screwed up the texture size.

I like trains.

  • Author

Okay so I've fixed the first two issues and the second half of the third (haven't pushed the changes yet) but I'm not sure how to implement the ISBRH, or where to put it (in the file structure that is).

I like trains.

  • Author

Oh okay, you use an ISBRH if you want to give a basic block a custom model right? I may want to do that later.

 

I've pushed the changes I've made as per your recommendations, but the block is still rendering as invisible.

I like trains.

I just copied this from the client proxy of one of my mods PreInit method

 

GameTable.gameTableRenderID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(GameTable.gameTableRenderID, new GameTableRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGameTable.class, new TileEntityGameTableRenderer());

 

this registers a renderer to the block and one to the tileentity

 

hope this is of some help

 

X, y, z, rot, rot, partialTicks

that's six

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.

  • Author

So like this:

 

    public void renderTileEntityAt(TileEntityLargePowerLine te, double x, double y, double z, float partialTick) {
        GL11.glPushMatrix();
        //GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);

        bindTexture(new ResourceLocation("powerlines", "render/largePowerLine.png"));

        GL11.glRotatef(180, 0F, 0F, 1F);

        model.render(null, (float)x, (float)y, (float)z, 0, 0, partialTick);

        GL11.glPopMatrix();
    }

 

It doesn't seem right that I have to cast the doubles to floats, but what do I know? I'm basically a monkey at a keyboard when it comes to this rendering stuff.

I like trains.

  • Author

Through the power of shotgun debugging and looking at what others have done I have finally got my model to render properly. This is what I have now to make it work:

 

    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
        GL11.glPushMatrix();
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);

        bindTexture(texture);

        GL11.glRotatef(180, 0F, 0F, 1F);

        model.render(null, 0, 0, 0, 0, 0, 0.0625F);

        GL11.glPopMatrix();
    }

 

The glTranslatef method allows you to moves the model around. The glRotatef method allows you to rotate the model which you'd want if you need to rotate your machine. The first parameter is the amount to rotate in degrees along the X axis, the second is the Y axis and the third is the Z axis. I don't know what the parameters for the render method do but in my model classes only the last parameter is ever used.

I like trains.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.