Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TESRPylon extends TileEntitySpecialRenderer {
- // The model of your block
- private final ModelPylon model;
- public TESRPylon() {
- this.model = new ModelPylon();
- }
- // private void adjustRotatePivotViaMeta(World world, int x, int y, int z) {
- // int meta = world.getBlockMetadata(x, y, z);
- // GL11.glPushMatrix();
- // GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
- // GL11.glPopMatrix();
- // }
- @Override
- public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {
- // The PushMatrix tells the renderer to "start" doing something.
- GL11.glPushMatrix();
- // This is setting the initial location.
- GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
- ResourceLocation textures = (new ResourceLocation("geomancy:models/pylon.png"));
- // the ':' is very important
- // binding the textures
- Minecraft.getMinecraft().renderEngine.bindTexture(textures);
- // This rotation part is very important! Without it, your model will
- // render upside-down! And for some reason you DO need PushMatrix again!
- GL11.glPushMatrix();
- GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
- // A reference to your Model file. Again, very important.
- this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- // Tell it to stop rendering for both the PushMatrix's
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement