Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. public class TESRPylon extends TileEntitySpecialRenderer {
  2.  
  3. // The model of your block
  4. private final ModelPylon model;
  5.  
  6. public TESRPylon() {
  7. this.model = new ModelPylon();
  8. }
  9.  
  10. // private void adjustRotatePivotViaMeta(World world, int x, int y, int z) {
  11. // int meta = world.getBlockMetadata(x, y, z);
  12. // GL11.glPushMatrix();
  13. // GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
  14. // GL11.glPopMatrix();
  15. // }
  16.  
  17. @Override
  18. public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {
  19. // The PushMatrix tells the renderer to "start" doing something.
  20. GL11.glPushMatrix();
  21. // This is setting the initial location.
  22. GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
  23.  
  24. ResourceLocation textures = (new ResourceLocation("geomancy:models/pylon.png"));
  25. // the ':' is very important
  26. // binding the textures
  27. Minecraft.getMinecraft().renderEngine.bindTexture(textures);
  28.  
  29. // This rotation part is very important! Without it, your model will
  30. // render upside-down! And for some reason you DO need PushMatrix again!
  31. GL11.glPushMatrix();
  32. GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
  33. // A reference to your Model file. Again, very important.
  34. this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
  35. // Tell it to stop rendering for both the PushMatrix's
  36. GL11.glPopMatrix();
  37. GL11.glPopMatrix();
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement