Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pastre.clashMod.blocks;
- import net.minecraft.block.Block;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
- import net.minecraft.entity.Entity;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.World;
- import org.lwjgl.opengl.GL11;
- import pastre.clashMod.modInfo.MODINFO;
- public class TileEntityTower1Renderer extends TileEntitySpecialRenderer {
- //The model of your block
- private final Tower1Model model;
- public TileEntityTower1Renderer() {
- this.model = new Tower1Model();
- }
- 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) {
- GL11.glPushMatrix();
- GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
- ResourceLocation textures = (new ResourceLocation(MODINFO.ID + ":textures/blocks/TrafficLightPoleRed.png"));
- Minecraft.getMinecraft().renderEngine.bindTexture(textures);
- GL11.glPushMatrix();
- GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
- this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement