Dear lord its been awhile since I've done rendering

This commit is contained in:
Pahimar 2014-09-24 16:02:45 -04:00
parent 7537165eec
commit 745098665c
20 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,7 @@
package com.pahimar.ee3.alchemy;
public class Symbols
{
private static final String SYMBOL_TEXTURE_LOCATION = "textures/array/";
public static final Symbol CIRCLE = new Symbol(SYMBOL_TEXTURE_LOCATION + "transBaseCircle.png", 1f);
}

View file

@ -1,9 +1,14 @@
package com.pahimar.ee3.client.renderer.tileentity;
import com.pahimar.ee3.alchemy.Symbol;
import com.pahimar.ee3.tileentity.TileEntityAlchemyArray;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
public class TileEntityRendererAlchemyArray extends TileEntitySpecialRenderer
@ -11,6 +16,55 @@ public class TileEntityRendererAlchemyArray extends TileEntitySpecialRenderer
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
{
if (tileEntity instanceof TileEntityAlchemyArray)
{
TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) tileEntity;
ForgeDirection direction = null;
if (tileEntityAlchemyArray.getWorldObj() != null)
{
direction = tileEntityAlchemyArray.getOrientation();
}
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F);
GL11.glScalef(1.0F, -1.0F, -1.0F);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
short angle = 0;
if (direction != null)
{
if (direction == ForgeDirection.NORTH)
{
angle = 180;
}
else if (direction == ForgeDirection.SOUTH)
{
angle = 0;
}
else if (direction == ForgeDirection.WEST)
{
angle = 90;
}
else if (direction == ForgeDirection.EAST)
{
angle = -90;
}
}
GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
for (Symbol symbol : tileEntityAlchemyArray.getAlchemySymbols())
{
this.bindTexture(symbol.getTexture());
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
}
}

View file

@ -1,5 +1,24 @@
package com.pahimar.ee3.tileentity;
import com.pahimar.ee3.alchemy.Symbol;
import com.pahimar.ee3.alchemy.Symbols;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TileEntityAlchemyArray extends TileEntityEE
{
private List<Symbol> alchemySymbols;
public TileEntityAlchemyArray()
{
super();
alchemySymbols = new ArrayList<Symbol>(Arrays.asList(Symbols.CIRCLE));
}
public List<Symbol> getAlchemySymbols()
{
return alchemySymbols;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB