Advertisement
Guest User

Untitled

a guest
Dec 9th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. package com.nextlevelminecraft.cad435.objloader;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
  5. import net.minecraft.tileentity.TileEntity;
  6. import net.minecraft.util.ResourceLocation;
  7. import net.minecraftforge.client.model.AdvancedModelLoader;
  8. import net.minecraftforge.client.model.IModelCustom;
  9. import org.lwjgl.opengl.GL11;
  10.  
  11.  
  12. public class ComplexTileEntitySpecialRenderer extends TileEntitySpecialRenderer {
  13. public static IModelCustom Crystall;
  14. public static ResourceLocation CrystallTex;
  15.  
  16.  
  17. public ComplexTileEntitySpecialRenderer(){
  18. //initialize Model and Texture
  19.  
  20. //Res-Location
  21. ResourceLocation LocationCrystall = new ResourceLocation("objloader", "models/Crystall_2Forge.obj");
  22.  
  23. //Model format: Std Wavefront, Triangulated, denormalized(for now), Poly-optimzed
  24. Crystall = AdvancedModelLoader.loadModel(LocationCrystall);
  25.  
  26. //No final texture created, Dummy white plain texture (265x256)
  27. CrystallTex = new ResourceLocation("objloader", "models/texture/Dummy_256.png");
  28.  
  29. }
  30.  
  31. @Override
  32. public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
  33. GL11.glPushMatrix();//Matrix to Stack
  34. GL11.glTranslated(x, y, z);//Translate
  35. Minecraft.getMinecraft().renderEngine.bindTexture(CrystallTex);
  36. Crystall.renderAll();//seems to be the whole Drawing code // found the Tessalator code at ModelRenderer.class & Wavefrontobject.class, seems that rendering 'll be done by forge
  37. GL11.glPopMatrix();//remove Matrix from Stack
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement