Guest User

Classe Render

a guest
Aug 3rd, 2017
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package fr.lavapower.harmonia.client.render;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import fr.lavapower.harmonia.client.model.ModelStatue;
  6. import fr.lavapower.harmonia.common.ModHarmonia;
  7. import fr.lavapower.harmonia.common.entity.TileEntityStatue;
  8. import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
  9. import net.minecraft.tileentity.TileEntity;
  10. import net.minecraft.util.ResourceLocation;
  11.  
  12. public class TileEntityStatueSpecialRenderer extends TileEntitySpecialRenderer
  13. {
  14. public static ModelStatue model = new ModelStatue();
  15. public static ResourceLocation texture;
  16.  
  17. @Override
  18. public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialRenderTick)
  19. {
  20. this.renderTileEntityStatueAt((TileEntityStatue)tile, x, y, z, partialRenderTick);
  21. }
  22.  
  23. private void renderTileEntityStatueAt(TileEntityStatue tile, double x, double y, double z, float partialRenderTick)
  24. {
  25. texture = new ResourceLocation(ModHarmonia.MODID, "textures/models/blocks/model_statue_"+tile.getPseudo()+".png");
  26. GL11.glPushMatrix();
  27. GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
  28. GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
  29. GL11.glRotatef(90F * tile.getDirection(), 0.0F, 1.0F, 0.0F);
  30. this.bindTexture(texture);
  31. model.renderAll();
  32. GL11.glPopMatrix();
  33. }
  34.  
  35. }
RAW Paste Data