Advertisement
Guest User

renderer

a guest
Apr 24th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package net.dyeo.teleporter.rendering;
  2.  
  3. import net.dyeo.teleporter.Reference;
  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.  
  10. import org.lwjgl.opengl.GL11;
  11.  
  12. public class RenderBlockTeleporter extends TileEntitySpecialRenderer
  13. {
  14.     ResourceLocation texture;
  15.     ResourceLocation objModelLocation;
  16.     public IModelCustom model;
  17.    
  18.     public RenderBlockTeleporter(String texloc, String modloc)
  19.     {
  20.         texture = new ResourceLocation(Reference.MODID.toLowerCase(), texloc);
  21.         objModelLocation = new ResourceLocation(Reference.MODID.toLowerCase(), modloc);
  22.         model = AdvancedModelLoader.loadModel(objModelLocation);
  23.     }
  24.  
  25.     @Override
  26.     public void renderTileEntityAt(TileEntity te, double posX, double posY, double posZ, float timeSinceLastTick)
  27.     {
  28.         bindTexture(texture);
  29.  
  30.         GL11.glPushMatrix();
  31.             GL11.glTranslated(posX + 0.5, posY + 0.5, posZ + 0.5);
  32.            
  33.             GL11.glPushMatrix();
  34.                 model.renderAll();
  35.             GL11.glPopMatrix();
  36.            
  37.         GL11.glPopMatrix();
  38.        
  39.     }
  40.        
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement