2014-06-27 19:43:09 -04:00
|
|
|
package WayofTime.alchemicalWizardry.common.renderer.block;
|
|
|
|
|
2014-10-13 22:33:20 +02:00
|
|
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
|
|
|
|
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
|
|
|
import cpw.mods.fml.client.FMLClientHandler;
|
2014-06-27 19:43:09 -04:00
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
|
|
public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
|
|
|
|
{
|
|
|
|
private ModelSpellParadigmBlock modelSpellParadigmBlock = new ModelSpellParadigmBlock();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
|
|
|
{
|
|
|
|
if (tileEntity instanceof TESpellParadigmBlock)
|
|
|
|
{
|
|
|
|
TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) tileEntity;
|
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
2015-07-02 11:05:07 -04:00
|
|
|
ResourceLocation test;
|
2014-06-27 19:43:09 -04:00
|
|
|
int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
|
|
|
String resource = tileSpellBlock.getResourceLocationForMeta(meta);
|
|
|
|
test = new ResourceLocation(resource);
|
2014-10-13 22:33:20 +02:00
|
|
|
|
2014-06-27 19:43:09 -04:00
|
|
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
2015-07-02 11:05:07 -04:00
|
|
|
this.modelSpellParadigmBlock.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
2014-06-27 19:43:09 -04:00
|
|
|
GL11.glPopMatrix();
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|