BloodMagic/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellParadigmBlock.java

38 lines
1.6 KiB
Java

package WayofTime.alchemicalWizardry.common.renderer.block;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.FMLClientHandler;
import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
{
private ModelSpellParadigmBlock modelSpellParadigmBlock = new ModelSpellParadigmBlock();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i)
{
if (tileEntity instanceof TESpellParadigmBlock)
{
TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) tileEntity;
GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test;
int meta = tileEntity.getBlockMetadata();
String resource = tileSpellBlock.getResourceLocationForMeta(meta);
test = new ResourceLocation(resource);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
this.modelSpellParadigmBlock.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}
}