2014-02-19 03:51:22 +01:00
|
|
|
package resonantinduction.mechanical.process.grinder;
|
2014-01-19 06:06:26 +01:00
|
|
|
|
|
|
|
import static org.lwjgl.opengl.GL11.glPopMatrix;
|
|
|
|
import static org.lwjgl.opengl.GL11.glPushMatrix;
|
2014-01-19 06:49:42 +01:00
|
|
|
import static org.lwjgl.opengl.GL11.glRotatef;
|
2014-01-19 06:06:26 +01:00
|
|
|
import static org.lwjgl.opengl.GL11.glScalef;
|
|
|
|
import static org.lwjgl.opengl.GL11.glTranslatef;
|
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
2014-02-26 08:31:00 +01:00
|
|
|
import net.minecraftforge.client.model.IModelCustom;
|
2014-01-24 11:02:28 +01:00
|
|
|
import net.minecraftforge.common.ForgeDirection;
|
2014-05-14 07:32:00 +02:00
|
|
|
import resonant.lib.render.RenderUtility;
|
2014-01-19 06:06:26 +01:00
|
|
|
import resonantinduction.core.Reference;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Calclavia
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
@SideOnly(Side.CLIENT)
|
2014-03-12 10:04:30 +01:00
|
|
|
public class RenderGrindingWheel extends TileEntitySpecialRenderer
|
2014-01-19 06:06:26 +01:00
|
|
|
{
|
2014-03-12 11:22:31 +01:00
|
|
|
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "grinder.obj");
|
2014-01-19 06:06:26 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
|
|
|
{
|
2014-03-12 10:04:30 +01:00
|
|
|
if (t instanceof TileGrindingWheel)
|
2014-01-19 06:49:42 +01:00
|
|
|
{
|
2014-03-12 10:04:30 +01:00
|
|
|
TileGrindingWheel tile = (TileGrindingWheel) t;
|
2014-01-19 06:49:42 +01:00
|
|
|
glPushMatrix();
|
|
|
|
glTranslatef((float) x + 0.5F, (float) y + 0.5f, (float) z + 0.5F);
|
2014-01-24 10:08:50 +01:00
|
|
|
glScalef(0.51f, 0.5f, 0.5f);
|
2014-01-24 11:02:28 +01:00
|
|
|
ForgeDirection dir = tile.getDirection();
|
2014-06-10 14:54:09 +02:00
|
|
|
//dir = ForgeDirection.getOrientation(!(dir.ordinal() % 2 == 0) ? dir.ordinal() - 1 : dir.ordinal());
|
2014-01-24 11:02:28 +01:00
|
|
|
RenderUtility.rotateBlockBasedOnDirection(dir);
|
2014-06-04 14:24:46 +02:00
|
|
|
glRotatef((float) Math.toDegrees(tile.mechanicalNode.renderAngle), 0, 0, 1);
|
2014-01-24 16:43:38 +01:00
|
|
|
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "planks_oak.png");
|
|
|
|
MODEL.renderAllExcept("teeth");
|
|
|
|
RenderUtility.bind(Reference.BLOCK_TEXTURE_DIRECTORY + "cobblestone.png");
|
|
|
|
MODEL.renderOnly("teeth");
|
2014-01-19 06:49:42 +01:00
|
|
|
glPopMatrix();
|
|
|
|
}
|
2014-01-19 06:06:26 +01:00
|
|
|
}
|
|
|
|
}
|