Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.roadcraft.mod.renderer;
- import org.lwjgl.opengl.GL11;
- import net.minecraft.block.Block;
- import net.minecraft.client.renderer.OpenGlHelper;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.world.World;
- import net.roadcraft.mod.Roadcraft;
- import net.roadcraft.mod.model.ModelRoadSignPostBase;
- import net.roadcraft.mod.tileentity.TileEntityRoadSignPostBase;
- public class RenderRoadSignPostBase extends TileEntitySpecialRenderer {
- private static ResourceLocation texture = new ResourceLocation(Roadcraft.MODID + ":" + "textures/model/RoadSignPostBase.png");
- private ModelRoadSignPostBase model;
- public RenderRoadSignPostBase() {
- this.model = new ModelRoadSignPostBase();
- }
- @Override
- public void renderTileEntityAt(TileEntity tilentity, double x, double y, double z, float f) {
- GL11.glPushMatrix();
- GL11.glTranslatef((float)x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
- GL11.glRotatef(180, 0F, 0F, 1F);
- this.bindTexture(texture);
- GL11.glPushMatrix();
- this.model.renderModel(0.0625F);
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
- public void renderBlockYour(TileEntityRoadSignPostBase tl, World world, int i, int j, int k, Block block) {
- Tessellator tessellator = Tessellator.instance;
- int dir = world.getBlockMetadata(i, j, k);
- GL11.glPushMatrix();
- GL11.glTranslatef(0.5F, 0, 0.5F);
- GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);
- GL11.glTranslatef(-0.5F, 0, -0.5F);
- GL11.glPopMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment