Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.chef.mod.renderer;
- import org.lwjgl.opengl.GL11;
- import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.ResourceLocation;
- import com.chef.mod.Debugger;
- import com.chef.mod.Reference;
- import com.chef.mod.model.ModelWaffleMaker;
- public class WaffleMakerRenderer extends TileEntitySpecialRenderer {
- private static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":" + "textures/model/ModelWaffleMakerFrontOff.png");
- private ModelWaffleMaker model;
- public WaffleMakerRenderer() {
- this.model = new ModelWaffleMaker();
- }
- @Override
- public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
- int dir = tileentity.getBlockMetadata();
- Debugger.log(dir);
- GL11.glPushMatrix();
- GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
- if (dir == 5) {
- //East
- GL11.glRotatef(180, 1F, 0F, 0F);
- } else if (dir == 4) {
- //West
- GL11.glRotatef(180, 1F, 0F, 1F);
- } else if (dir == 3) {
- //South
- GL11.glRotatef(180, 1F, 0F, 0F);
- } else if (dir == 2) {
- //North
- GL11.glRotatef(180, 0F, 0F, 1F);
- }
- this.bindTexture(texture);
- GL11.glPushMatrix();
- this.model.renderModel(0.0625F);
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment