Posted July 5, 201510 yr 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.
July 5, 201510 yr 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.
July 5, 201510 yr 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.
July 5, 201510 yr 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
July 5, 201510 yr Author First: Use GameRegistry.registerTileEntity in your main class Okay fixed that (not pushed yet), stupid me. Then: you are always rendering your model at 0, 0, 0. That's because I don't know what those arguments mean. According to IntelliJ, only the last float value is used. I like trains.
July 5, 201510 yr 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.
July 5, 201510 yr Author Okay now it's rendering, but it's flickering and jumping around. I recorded what was happening with OBS but GFYCat doesn't give me a useful error message when uploading fails. It works with YouTube: https://www.youtube.com/watch?v=C-cXm0IlevM I like trains.
July 6, 201510 yr Author Here are the changes I made in the latest commit: https://github.com/UntouchedWagons/PowerLines/commit/76fe68c404ac2bd323be240e3ad6401046381aca I like trains.
July 6, 201510 yr 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.
July 6, 201510 yr Author I understand the stuff about chest rotation and checking for adjacent chests but I don't see what you want me to see. I like trains.
July 6, 201510 yr Author TileEntityChestRenderer Yeah I found that. That's how I know about the chest rotation and checking for adjacent chests stuff. I like trains.
July 8, 201510 yr 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.