Fixed bug with Energy Inject/Extract Averages.

SideOnly All the things.
Pulled Rendering for CableContainers out into a Proxy.
This commit is contained in:
AlgorithmX2 2014-02-06 23:51:19 -06:00
parent 3a42c5e1e7
commit e436dca760
39 changed files with 341 additions and 739 deletions

View file

@ -30,6 +30,7 @@ import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BaseBlockRender
{

View file

@ -12,7 +12,10 @@ import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartRenderHelper;
import appeng.block.AEBaseBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BusRenderHelper implements IPartRenderHelper
{
@ -163,8 +166,9 @@ public class BusRenderHelper implements IPartRenderHelper
list[4] = West;
list[5] = East;
blk.getRendererInstance().setTemporaryRenderIcons( list[mapRotation( ForgeDirection.UP ).ordinal()], list[mapRotation( ForgeDirection.DOWN ).ordinal()],
list[mapRotation( ForgeDirection.SOUTH ).ordinal()], list[mapRotation( ForgeDirection.NORTH ).ordinal()], list[mapRotation( ForgeDirection.EAST ).ordinal()],
blk.getRendererInstance().setTemporaryRenderIcons( list[mapRotation( ForgeDirection.UP ).ordinal()],
list[mapRotation( ForgeDirection.DOWN ).ordinal()], list[mapRotation( ForgeDirection.SOUTH ).ordinal()],
list[mapRotation( ForgeDirection.NORTH ).ordinal()], list[mapRotation( ForgeDirection.EAST ).ordinal()],
list[mapRotation( ForgeDirection.WEST ).ordinal()] );
}

View file

@ -15,7 +15,10 @@ import appeng.api.parts.IPartItem;
import appeng.client.ClientHelper;
import appeng.facade.IFacadeItem;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BusRenderer implements IItemRenderer
{

View file

@ -0,0 +1,177 @@
package appeng.client.render;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.parts.IFacadePart;
import appeng.api.parts.IPart;
import appeng.facade.FacadeContainer;
import appeng.parts.BusCollisionHelper;
import appeng.parts.CableBusContainer;
public class CableRenderHelper
{
private static final CableRenderHelper instance = new CableRenderHelper();
public static CableRenderHelper getInstance()
{
return instance;
}
public void renderStatic(CableBusContainer cableBusContainer, FacadeContainer fc)
{
TileEntity te = cableBusContainer.getTile();
RenderBlocksWorkaround renderer = BusRenderer.instance.renderer;
if ( renderer.blockAccess == null )
renderer.blockAccess = Minecraft.getMinecraft().theWorld;
for (ForgeDirection s : ForgeDirection.values())
{
cableBusContainer.setSide( s );
IPart part = cableBusContainer.getPart( s );
if ( part != null )
{
renderer.renderAllFaces = true;
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer );
renderer.faces = EnumSet.allOf( ForgeDirection.class );
renderer.calculations = true;
renderer.useTextures = true;
}
}
if ( !fc.isEmpty() )
{
/**
* snag list of boxes...
*/
List<AxisAlignedBB> boxes = new ArrayList();
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = cableBusContainer.getPart( s );
if ( part != null )
{
cableBusContainer.setSide( s );
BusCollisionHelper bch = new BusCollisionHelper( boxes, BusRenderHelper.instance.ax, BusRenderHelper.instance.ay,
BusRenderHelper.instance.az, null, true );
part.getBoxes( bch );
}
}
boolean useThinFacades = false;
double min = 2.0 / 16.0;
double max = 14.0 / 16.0;
for (AxisAlignedBB bb : boxes)
{
int o = 0;
o += bb.maxX > max ? 1 : 0;
o += bb.maxY > max ? 1 : 0;
o += bb.maxZ > max ? 1 : 0;
o += bb.minX < min ? 1 : 0;
o += bb.minY < min ? 1 : 0;
o += bb.minZ < min ? 1 : 0;
if ( o >= 2 )
useThinFacades = true;
}
for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS)
{
IFacadePart fPart = fc.getFacade( s );
if ( fPart != null )
{
AxisAlignedBB b = null;
fPart.setThinFacades( useThinFacades );
AxisAlignedBB pb = fPart.getPrimaryBox();
for (AxisAlignedBB bb : boxes)
{
if ( bb.intersectsWith( pb ) )
{
if ( b == null )
b = bb;
else
{
b.maxX = Math.max( b.maxX, bb.maxX );
b.maxY = Math.max( b.maxY, bb.maxY );
b.maxZ = Math.max( b.maxZ, bb.maxZ );
b.minX = Math.min( b.minX, bb.minX );
b.minY = Math.min( b.minY, bb.minY );
b.minZ = Math.min( b.minZ, bb.minZ );
}
}
}
cableBusContainer.setSide( s );
fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer, fc, b, cableBusContainer.getPart( s ) == null );
}
}
renderer.isFacade = false;
renderer.enableAO = false;
renderer.setTexture( null );
renderer.calculations = true;
}
}
public void renderDynamic(CableBusContainer cableBusContainer, double x, double y, double z)
{
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = cableBusContainer.getPart( s );
if ( part != null )
{
switch (s)
{
case DOWN:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.NORTH;
BusRenderHelper.instance.az = ForgeDirection.DOWN;
break;
case UP:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.SOUTH;
BusRenderHelper.instance.az = ForgeDirection.UP;
break;
case EAST:
BusRenderHelper.instance.ax = ForgeDirection.SOUTH;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.EAST;
break;
case WEST:
BusRenderHelper.instance.ax = ForgeDirection.NORTH;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.WEST;
break;
case NORTH:
BusRenderHelper.instance.ax = ForgeDirection.WEST;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.NORTH;
break;
case SOUTH:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.SOUTH;
break;
case UNKNOWN:
default:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.SOUTH;
break;
}
part.renderDynamic( x, y, z, BusRenderHelper.instance, BusRenderer.instance.renderer );
}
}
}
}

View file

@ -8,7 +8,10 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderBlocksWorkaround extends RenderBlocks
{

View file

@ -11,7 +11,10 @@ import org.lwjgl.opengl.GL11;
import appeng.block.AEBaseBlock;
import appeng.tile.AEBaseTile;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TESRWrapper extends TileEntitySpecialRenderer
{

View file

@ -9,7 +9,10 @@ import net.minecraft.world.IBlockAccess;
import appeng.block.AEBaseBlock;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class WorldRender implements ISimpleBlockRenderingHandler
{

View file

@ -11,7 +11,10 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import appeng.entity.EntityTinyTNTPrimed;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderTinyTNTPrimed extends Render
{

View file

@ -22,6 +22,8 @@ import appeng.client.render.BusRenderHelper;
import appeng.client.render.RenderBlocksWorkaround;
import appeng.core.AppEng;
import appeng.integration.abstraction.IBC;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class FacadePart implements IFacadePart
{
@ -73,6 +75,7 @@ public class FacadePart implements IFacadePart
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper instance2, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds,
boolean renderStilt)
{
@ -249,6 +252,7 @@ public class FacadePart implements IFacadePart
}
}
@SideOnly(Side.CLIENT)
private void renderSegmentBlockCurrentBounds(BusRenderHelper instance, int x, int y, int z, RenderBlocks renderer, double minX, double minY, double minZ,
double maxX, double maxY, double maxZ)
{
@ -282,6 +286,7 @@ public class FacadePart implements IFacadePart
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer)
{
if ( facade != null )

View file

@ -157,7 +157,6 @@ public class WirelessTerminalGuiObject implements IPortableCell
itemStorage.removeListener( l );
}
@SuppressWarnings("deprecation")
@Override
public IItemList<IAEItemStack> getAvailableItems(IItemList out)
{

View file

@ -1,400 +0,0 @@
package appeng.integration.modules.helpers;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.transport.ItemFacade;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class FacadeProxyBC implements IFacadeProxy
{
float facadeThickness = 1F / 16F;
int facadeBlocks[];
int facadeMeta[];
public FacadeProxyBC() {
facadeBlocks = new int[6];
facadeMeta = new int[6];
}
/**
* Mirrors the array on the Y axis by calculating offsets from 0.5F
*
* @param targetArray
*/
private void mirrorY(float[][] targetArray)
{
float temp = targetArray[1][0];
targetArray[1][0] = (targetArray[1][1] - 0.5F) * -1F + 0.5F; // 1 ->
// 0.5F
// ->
// -0.5F
// -> 0F
targetArray[1][1] = (temp - 0.5F) * -1F + 0.5F; // 0 -> -0.5F -> 0.5F ->
// 1F
}
/**
* Shifts the coordinates around effectivly rotating something. Zero state
* is DOWN then -> NORTH -> WEST Note - To obtain Pos, do a mirrorY() before
* rotating
*
* @param targetArray
* the array that should be rotated
*/
private void rotate(float[][] targetArray)
{
for (int i = 0; i < 2; i++)
{
float temp = targetArray[2][i];
targetArray[2][i] = targetArray[1][i];
targetArray[1][i] = targetArray[0][i];
targetArray[0][i] = temp;
}
}
/**
* @param targetArray
* the array that should be transformed
* @param direction
*/
private void transform(float[][] targetArray, ForgeDirection direction)
{
if ( (direction.ordinal() & 0x1) == 1 )
{
mirrorY( targetArray );
}
for (int i = 0; i < (direction.ordinal() >> 1); i++)
{
rotate( targetArray );
}
}
/**
* Clones both dimensions of a float[][]
*
* @param source
* the float[][] to deepClone
* @return
*/
private float[][] deepClone(float[][] source)
{
float[][] target = source.clone();
for (int i = 0; i < target.length; i++)
{
target[i] = source[i].clone();
}
return target;
}
@Override
@SideOnly(Side.CLIENT)
public void facadeRender(RenderBlocks renderblocks, Block block, IFacadeTile ft, int x, int y, int z, float tubeThickness)
{
float zFightOffset = 1F / 4096F;
float[][] zeroState = new float[3][2];
// X START - END
zeroState[0][0] = 0.0F - zFightOffset / 2;
zeroState[0][1] = 1.0F + zFightOffset / 2;
// Y START - END
zeroState[1][0] = 0.0F - zFightOffset;
zeroState[1][1] = facadeThickness;
// Z START - END
zeroState[2][0] = 0.0F;
zeroState[2][1] = 1.0F;
renderblocks.renderAllFaces = true;
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
if ( hasFacade( ft, direction ) )
{
Block blk = Block.blocksList[facadeBlocks[direction.ordinal()]];
renderblocks.overrideBlockTexture = blk.getIcon( direction.ordinal(), facadeMeta[direction.ordinal()] );
try
{
// AppEngBlockRenderer.instance.overrideRenderColor =
// Item.itemsList[ facadeBlocks[ direction.ordinal() ]
// ].getColorFromItemStack(new ItemStack( facadeBlocks[
// direction.ordinal() ], 1, facadeMeta[ direction.ordinal()
// ] ), 0);
} catch (Throwable error)
{
// explosion!
}
if ( blk.getRenderType() == 31 )
{
if ( (facadeMeta[direction.ordinal()] & 12) == 4 )
{
renderblocks.uvRotateEast = 1;
renderblocks.uvRotateWest = 1;
renderblocks.uvRotateTop = 1;
renderblocks.uvRotateBottom = 1;
} else if ( (facadeMeta[direction.ordinal()] & 12) == 8 )
{
renderblocks.uvRotateSouth = 1;
renderblocks.uvRotateNorth = 1;
}
}
float holeThickness = ft.getHoleThickness( direction );
// Hollow facade
if ( ft.isConnected( direction ) )
{
float[][] rotated = deepClone( zeroState );
rotated[2][0] = 0.0F;
rotated[2][1] = 0.0f + holeThickness;
rotated[1][0] -= zFightOffset / 2;
transform( rotated, direction );
block.setBlockBounds( rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1],
rotated[2][1] );
renderblocks.setRenderBoundsFromBlock( block );
renderblocks.renderStandardBlock( block, x, y, z );
rotated = deepClone( zeroState );
rotated[2][0] = 1.0f - holeThickness;
rotated[1][0] -= zFightOffset / 2;
transform( rotated, direction );
block.setBlockBounds( rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1],
rotated[2][1] );
renderblocks.setRenderBoundsFromBlock( block );
renderblocks.renderStandardBlock( block, x, y, z );
rotated = deepClone( zeroState );
rotated[0][0] = 0.0F;
rotated[0][1] = 0.0f + holeThickness;
rotated[1][1] -= zFightOffset;
transform( rotated, direction );
block.setBlockBounds( rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1],
rotated[2][1] );
renderblocks.setRenderBoundsFromBlock( block );
renderblocks.renderStandardBlock( block, x, y, z );
rotated = deepClone( zeroState );
rotated[0][0] = 1.0f - holeThickness;
rotated[0][1] = 1F;
rotated[1][1] -= zFightOffset;
transform( rotated, direction );
block.setBlockBounds( rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1],
rotated[2][1] );
renderblocks.setRenderBoundsFromBlock( block );
renderblocks.renderStandardBlock( block, x, y, z );
} else
{ // Solid facade
float[][] rotated = deepClone( zeroState );
transform( rotated, direction );
block.setBlockBounds( rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1],
rotated[2][1] );
renderblocks.setRenderBoundsFromBlock( block );
renderblocks.renderStandardBlock( block, x, y, z );
}
// AppEngBlockRenderer.instance.overrideRenderColor = -1;
}
renderblocks.uvRotateEast = 0;
renderblocks.uvRotateWest = 0;
renderblocks.uvRotateTop = 0;
renderblocks.uvRotateBottom = 0;
renderblocks.uvRotateSouth = 0;
renderblocks.uvRotateNorth = 0;
}
// X START - END
zeroState[0][0] = 0.0f + tubeThickness; // Utils.pipeMinPos;
zeroState[0][1] = 1.0f - tubeThickness; // Utils.pipeMaxPos;
// Y START - END
zeroState[1][0] = facadeThickness;
zeroState[1][1] = 0.0f + tubeThickness; // Utils.pipeMinPos;
// Z START - END
zeroState[2][0] = 0.0f + tubeThickness; // Utils.pipeMinPos;
zeroState[2][1] = 1.0f - tubeThickness; // Utils.pipeMaxPos;
if ( tubeThickness > 0.001 )
{
// renderblocks.overrideBlockTexture =
// BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone);
// // Structure Pipe
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
if ( hasFacade( ft, direction ) && !ft.isConnected( direction ) )
{
float[][] rotated = deepClone( zeroState );
transform( rotated, direction );
block.setBlockBounds( rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1],
rotated[2][1] );
renderblocks.setRenderBoundsFromBlock( block );
renderblocks.renderStandardBlock( block, x, y, z );
}
}
}
renderblocks.renderAllFaces = false;
renderblocks.overrideBlockTexture = null;
}
ItemStack createFacade(int itemid, int meta)
{
try
{
return ItemFacade.getStack( itemid, meta );
} catch (Throwable e)
{
try
{
// return new ItemStack( BuildCraftTransport.facadeItem, 1,
// ItemFacade.encode( itemid, meta ) );
} catch (Throwable e2)
{
FMLLog.severe( "Unable to create facade item, please make sure your using the newest Version of BC and AE, and if you are inform AlgorithmX2 of this message." );
}
}
return null;
}
@Override
public List<ItemStack> getDrops(IFacadeTile ft)
{
List<ItemStack> out = new ArrayList();
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{
if ( this.facadeBlocks[direction.ordinal()] != 0 )
{
ItemStack facade = createFacade( this.facadeBlocks[direction.ordinal()], this.facadeMeta[direction.ordinal()] );
this.facadeMeta[direction.ordinal()] = 0;
out.add( facade );
}
}
return out;
}
@Override
public boolean addFacade(IFacadeTile ft, ForgeDirection direction, int blockid, int meta)
{
if ( hasFacade( ft, direction ) )
dropFacade( ft, direction );
// if ( ft.isConnected( direction ) )
// return false;
this.facadeBlocks[direction.ordinal()] = blockid;
this.facadeMeta[direction.ordinal()] = meta;
ft.markForUpdate();
return true;
}
@Override
public boolean hasFacade(IFacadeTile ft, ForgeDirection direction)
{
return this.facadeBlocks[direction.ordinal()] != 0;
}
@Override
public void dropFacade(IFacadeTile ft, ForgeDirection direction)
{
if ( this.facadeBlocks[direction.ordinal()] != 0 )
{
ItemStack facade = createFacade( this.facadeBlocks[direction.ordinal()], this.facadeMeta[direction.ordinal()] );
this.facadeBlocks[direction.ordinal()] = 0;
this.facadeMeta[direction.ordinal()] = 0;
ft.dropFacadeItem( facade );
ft.markForUpdate();
}
}
@Override
public boolean readFromStream(DataInputStream out) throws IOException
{
boolean diffrent = false;
for (int x = 0; x < 6; x++)
{
int fb = facadeBlocks[x];
int fm = facadeMeta[x];
facadeBlocks[x] = out.readInt();
facadeMeta[x] = out.readInt();
diffrent = diffrent || fb != facadeBlocks[x] || fm != facadeMeta[x];
}
return diffrent;
}
@Override
public void writeToStream(DataOutputStream out) throws IOException
{
for (int x = 0; x < 6; x++)
{
out.writeInt( facadeBlocks[x] );
out.writeInt( facadeMeta[x] );
}
}
@Override
public void writeToNBT(NBTTagCompound tc)
{
tc.setIntArray( "facadeBlocks", facadeBlocks );
tc.setIntArray( "facadeMeta", facadeMeta );
}
@Override
public void readFromNBT(NBTTagCompound tc)
{
facadeBlocks = tc.getIntArray( "facadeBlocks" );
facadeMeta = tc.getIntArray( "facadeMeta" );
if ( facadeBlocks == null )
facadeBlocks = new int[6];
if ( facadeMeta == null )
facadeMeta = new int[6];
if ( facadeBlocks.length != 6 )
facadeBlocks = new int[6];
if ( facadeMeta.length != 6 )
facadeMeta = new int[6];
}
@Override
public boolean addFacade(TileEntity tileEntity, int side, ItemStack hand)
{
if ( tileEntity instanceof IFacadeTile )
{
try
{
return addFacade( (IFacadeTile) tileEntity, ForgeDirection.getOrientation( side ), ItemFacade.getBlockId( hand ),
ItemFacade.getMetaData( hand ) );
} catch (Throwable e)
{
FMLLog.severe( "Unable to place facade item, please make sure your using the newest Version of BC and AE, and if you are inform AlgorithmX2 of this message." );
}
}
return false;
}
}

View file

@ -1,83 +0,0 @@
package appeng.integration.modules.helpers;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class FacadeProxyNull implements IFacadeProxy
{
@Override
@SideOnly(Side.CLIENT)
public void facadeRender(RenderBlocks renderblocks, Block block, IFacadeTile ft, int x, int y, int z, float th)
{
}
@Override
public List<ItemStack> getDrops(IFacadeTile ft)
{
return new ArrayList<ItemStack>();
}
@Override
public boolean addFacade(IFacadeTile ft, ForgeDirection direction, int blockid, int meta)
{
return false;
}
@Override
public boolean hasFacade(IFacadeTile ft, ForgeDirection direction)
{
return false;
}
@Override
public void dropFacade(IFacadeTile ft, ForgeDirection direction)
{
}
@Override
public void writeToNBT(NBTTagCompound tc)
{
}
@Override
public void writeToStream(DataOutputStream out) throws IOException
{
}
@Override
public boolean readFromStream(DataInputStream out) throws IOException
{
return false;
}
@Override
public void readFromNBT(NBTTagCompound tc)
{
}
@Override
public boolean addFacade(TileEntity tileEntity, int side, ItemStack hand)
{
return false;
}
}

View file

@ -1,41 +0,0 @@
package appeng.integration.modules.helpers;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface IFacadeProxy
{
@SideOnly(Side.CLIENT)
void facadeRender(RenderBlocks renderblocks, Block block, IFacadeTile ft, int x, int y, int z, float tubeThickness);
List<ItemStack> getDrops(IFacadeTile ft);
boolean addFacade(IFacadeTile ft, ForgeDirection direction, int blockid, int meta);
boolean hasFacade(IFacadeTile ft, ForgeDirection direction);
void dropFacade(IFacadeTile ft, ForgeDirection direction);
void writeToNBT(NBTTagCompound tc);
void writeToStream(DataOutputStream out) throws IOException;
boolean readFromStream(DataInputStream out) throws IOException;
void readFromNBT(NBTTagCompound tc);
boolean addFacade(TileEntity tileEntity, int side, ItemStack hand);
}

View file

@ -1,19 +0,0 @@
package appeng.integration.modules.helpers;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
public interface IFacadeTile
{
boolean isConnected(ForgeDirection direction);
void dropFacadeItem(ItemStack facade);
IFacadeProxy getFacadeProxy();
void markForUpdate();
float getHoleThickness(ForgeDirection direction);
}

View file

@ -40,7 +40,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
switch (component)
{
case Cell1kPart:
idleDrain = 0.5;
idleDrain = 12.5;
break;
case Cell4kPart:
idleDrain = 1.0;
@ -69,17 +69,12 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
l.add( cd.usedBytes() + " " + GuiText.Of.getLocal() + " " + cd.totalBytes() + " " + GuiText.BytesUsed.getLocal() );
l.add( cd.storedItemTypes() + " " + GuiText.Of.getLocal() + " " + cd.getTotalItemTypes() + " " + GuiText.Types.getLocal() );
/*
* if ( cd.isPreformatted() ) { String List =
* StatCollector.translateToLocal( cd.getListMode() ==
* ListMode.WHITELIST ? "AppEng.Gui.Whitelisted" :
* "AppEng.Gui.Blacklisted" ); if ( cd.isFuzzyPreformatted() )
* l.add( StatCollector.translateToLocal(
* "Appeng.GuiITooltip.Partitioned" ) + " - " + List + " " +
* StatCollector.translateToLocal( "Appeng.GuiITooltip.Fuzzy" )
* ); else l.add( StatCollector.translateToLocal(
* "Appeng.GuiITooltip.Partitioned" ) + " - " + List + " " +
* StatCollector.translateToLocal( "Appeng.GuiITooltip.Precise"
* ) ); }
* if ( cd.isPreformatted() ) { String List = StatCollector.translateToLocal( cd.getListMode() ==
* ListMode.WHITELIST ? "AppEng.Gui.Whitelisted" : "AppEng.Gui.Blacklisted" ); if (
* cd.isFuzzyPreformatted() ) l.add( StatCollector.translateToLocal( "Appeng.GuiITooltip.Partitioned" )
* + " - " + List + " " + StatCollector.translateToLocal( "Appeng.GuiITooltip.Fuzzy" ) ); else l.add(
* StatCollector.translateToLocal( "Appeng.GuiITooltip.Partitioned" ) + " - " + List + " " +
* StatCollector.translateToLocal( "Appeng.GuiITooltip.Precise" ) ); }
*/
}
}

View file

@ -156,6 +156,7 @@ public class EnergyGridCache implements IEnergyGrid
@Override
public double injectPower(double i, Actionable mode)
{
double ignore = extra;
i += extra;
if ( mode == Actionable.SIMULATE )
@ -169,7 +170,7 @@ public class EnergyGridCache implements IEnergyGrid
}
else
{
tickInjectionPerTick += i;
tickInjectionPerTick += i - ignore;
// totalInjectionPastTicks[0] += i;
while (i > 0 && !requesters.isEmpty())
@ -369,6 +370,7 @@ public class EnergyGridCache implements IEnergyGrid
extra = extractedPower - amt;
globalAvailablePower -= amt;
tickDrainPerTick += amt;
return amt;
}
@ -381,6 +383,7 @@ public class EnergyGridCache implements IEnergyGrid
// go less or the correct amount?
globalAvailablePower -= extractedPower;
tickDrainPerTick += extractedPower;
return extractedPower;
}
@ -401,7 +404,6 @@ public class EnergyGridCache implements IEnergyGrid
}
}
tickDrainPerTick += extractedPower;
// totalDrainPastTicks[0] += extractedPower;
return extractedPower;
}

View file

@ -37,6 +37,8 @@ import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable;
import appeng.parts.networking.PartCable;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradeableHost
{
@ -55,6 +57,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setBounds( 1, 1, 1, 15, 15, 15 );
@ -65,6 +68,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setBounds( 1, 1, 1, 15, 15, 15 );
@ -72,6 +76,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
}
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer)
{
@ -206,6 +211,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random r)
{

View file

@ -3,13 +3,11 @@ package appeng.parts;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -39,12 +37,13 @@ import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import appeng.client.render.BusRenderHelper;
import appeng.client.render.BusRenderer;
import appeng.client.render.RenderBlocksWorkaround;
import appeng.client.render.CableRenderHelper;
import appeng.facade.FacadeContainer;
import appeng.helpers.AEMultiTile;
import appeng.me.GridConnection;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class CableBusContainer implements AEMultiTile, ICableBusContainer
{
@ -521,154 +520,16 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
}
}
@SideOnly(Side.CLIENT)
public void renderStatic(double x, double y, double z)
{
TileEntity te = getTile();
RenderBlocksWorkaround renderer = BusRenderer.instance.renderer;
if ( renderer.blockAccess == null )
renderer.blockAccess = Minecraft.getMinecraft().theWorld;
for (ForgeDirection s : ForgeDirection.values())
{
setSide( s );
IPart part = getPart( s );
if ( part != null )
{
renderer.renderAllFaces = true;
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer );
renderer.faces = EnumSet.allOf( ForgeDirection.class );
renderer.calculations = true;
renderer.useTextures = true;
}
}
if ( !fc.isEmpty() )
{
/**
* snag list of boxes...
*/
List<AxisAlignedBB> boxes = new ArrayList();
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
if ( part != null )
{
setSide( s );
BusCollisionHelper bch = new BusCollisionHelper( boxes, BusRenderHelper.instance.ax, BusRenderHelper.instance.ay,
BusRenderHelper.instance.az, null, true );
part.getBoxes( bch );
}
}
boolean useThinFacades = false;
double min = 2.0 / 16.0;
double max = 14.0 / 16.0;
for (AxisAlignedBB bb : boxes)
{
int o = 0;
o += bb.maxX > max ? 1 : 0;
o += bb.maxY > max ? 1 : 0;
o += bb.maxZ > max ? 1 : 0;
o += bb.minX < min ? 1 : 0;
o += bb.minY < min ? 1 : 0;
o += bb.minZ < min ? 1 : 0;
if ( o >= 2 )
useThinFacades = true;
}
for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS)
{
IFacadePart fPart = fc.getFacade( s );
if ( fPart != null )
{
AxisAlignedBB b = null;
fPart.setThinFacades( useThinFacades );
AxisAlignedBB pb = fPart.getPrimaryBox();
for (AxisAlignedBB bb : boxes)
{
if ( bb.intersectsWith( pb ) )
{
if ( b == null )
b = bb;
else
{
b.maxX = Math.max( b.maxX, bb.maxX );
b.maxY = Math.max( b.maxY, bb.maxY );
b.maxZ = Math.max( b.maxZ, bb.maxZ );
b.minX = Math.min( b.minX, bb.minX );
b.minY = Math.min( b.minY, bb.minY );
b.minZ = Math.min( b.minZ, bb.minZ );
}
}
}
setSide( s );
fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer, fc, b, getPart( s ) == null );
}
}
renderer.isFacade = false;
renderer.enableAO = false;
renderer.setTexture( null );
renderer.calculations = true;
}
CableRenderHelper.getInstance().renderStatic( this, fc );
}
@SideOnly(Side.CLIENT)
public void renderDynamic(double x, double y, double z)
{
for (ForgeDirection s : ForgeDirection.values())
{
IPart part = getPart( s );
if ( part != null )
{
switch (s)
{
case DOWN:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.NORTH;
BusRenderHelper.instance.az = ForgeDirection.DOWN;
break;
case UP:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.SOUTH;
BusRenderHelper.instance.az = ForgeDirection.UP;
break;
case EAST:
BusRenderHelper.instance.ax = ForgeDirection.SOUTH;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.EAST;
break;
case WEST:
BusRenderHelper.instance.ax = ForgeDirection.NORTH;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.WEST;
break;
case NORTH:
BusRenderHelper.instance.ax = ForgeDirection.WEST;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.NORTH;
break;
case SOUTH:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.SOUTH;
break;
case UNKNOWN:
default:
BusRenderHelper.instance.ax = ForgeDirection.EAST;
BusRenderHelper.instance.ay = ForgeDirection.UP;
BusRenderHelper.instance.az = ForgeDirection.SOUTH;
break;
}
part.renderDynamic( x, y, z, BusRenderHelper.instance, BusRenderer.instance.renderer );
}
}
CableRenderHelper.getInstance().renderDynamic( this, x, y, z );
}
public void writeToStream(DataOutputStream data) throws IOException

View file

@ -10,6 +10,8 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.parts.SelectedPart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public interface ICableBusContainer
{
@ -36,6 +38,7 @@ public interface ICableBusContainer
boolean isLadder(EntityLivingBase entity);
@SideOnly(Side.CLIENT)
void randomDisplayTick(World world, int x, int y, int z, Random r);
int getLightValue();

View file

@ -15,6 +15,8 @@ import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.parts.IPartRenderHelper;
import appeng.client.texture.CableBusTextures;
import appeng.me.GridAccessException;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartBasicState extends AEBasePart
{
@ -57,6 +59,7 @@ public class PartBasicState extends AEBasePart
}
}
@SideOnly(Side.CLIENT)
public void renderLights(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.normalRendering();

View file

@ -10,6 +10,8 @@ import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.client.texture.CableBusTextures;
import appeng.parts.PartBasicState;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartAnnihilationPlane extends PartBasicState
{
@ -19,6 +21,7 @@ public class PartAnnihilationPlane extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
@ -32,6 +35,7 @@ public class PartAnnihilationPlane extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
int minX = 1;

View file

@ -25,6 +25,8 @@ import appeng.core.sync.GuiBridge;
import appeng.me.GridAccessException;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartExportBus extends PartSharedItemBus implements IGridTickable
{
@ -54,6 +56,7 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
@ -71,6 +74,7 @@ public class PartExportBus extends PartSharedItemBus implements IGridTickable
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );

View file

@ -10,6 +10,8 @@ import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.client.texture.CableBusTextures;
import appeng.parts.PartBasicState;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartFormationPlane extends PartBasicState
{
@ -19,6 +21,7 @@ public class PartFormationPlane extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
@ -32,6 +35,7 @@ public class PartFormationPlane extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
int minX = 1;

View file

@ -30,6 +30,8 @@ import appeng.me.GridAccessException;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.inv.IInventoryDestination;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartImportBus extends PartSharedItemBus implements IGridTickable, IInventoryDestination
{
@ -76,6 +78,7 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
@ -92,6 +95,7 @@ public class PartImportBus extends PartSharedItemBus implements IGridTickable, I
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );

View file

@ -39,6 +39,8 @@ import appeng.me.GridAccessException;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartLevelEmitter extends PartUpgradeable implements IStackWatcherHost, IMEMonitorHandlerReciever<IAEItemStack>
{
@ -250,6 +252,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IStackWatcherHo
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( is.getIconIndex() );
@ -446,6 +449,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IStackWatcherHo
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( is.getIconIndex() );

View file

@ -24,6 +24,8 @@ import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.PartItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartCableAnchor implements IPart
{
@ -36,6 +38,7 @@ public class PartCableAnchor implements IPart
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
Icon myIcon = is.getIconIndex();
@ -46,12 +49,14 @@ public class PartCableAnchor implements IPart
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random r)
{
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper instance, RenderBlocks renderer)
{
instance.setTexture( is.getIconIndex() );
@ -79,6 +84,7 @@ public class PartCableAnchor implements IPart
}
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer)
{

View file

@ -30,6 +30,8 @@ import appeng.tile.inventory.IAEAppEngInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.Platform;
import appeng.util.inv.IInventoryDestination;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartInterface extends PartBasicState implements IGridTickable, ISegmentedInventory, IStorageMonitorable, IInventoryDestination, IInterfaceHost,
ISidedInventory, IAEAppEngInventory, ITileStorageMonitorable
@ -62,6 +64,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
@ -78,6 +81,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );

View file

@ -55,6 +55,8 @@ import buildcraft.api.transport.IPipeConnection;
import buildcraft.api.transport.IPipeTile.PipeType;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.Optional.Method;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Interface(modid = "BuildCraft|Transport", iface = "buildcraft.api.transport.IPipeConnection")
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReciever<IAEItemStack>, IPipeConnection,
@ -261,6 +263,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),
@ -277,6 +280,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );

View file

@ -25,6 +25,8 @@ import appeng.client.texture.CableBusTextures;
import appeng.me.helpers.AENetworkProxy;
import appeng.parts.PartBasicState;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartToggleBus extends PartBasicState
{
@ -158,6 +160,7 @@ public class PartToggleBus extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
@ -186,6 +189,7 @@ public class PartToggleBus extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
GL11.glTranslated( -0.2, -0.3, 0.0 );

View file

@ -37,6 +37,8 @@ import appeng.me.GridAccessException;
import appeng.me.helpers.AENetworkProxy;
import appeng.parts.AEBasePart;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartCable extends AEBasePart implements IPartCable
{
@ -355,6 +357,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
GL11.glTranslated( -0.2, -0.3, 0.0 );
@ -365,6 +368,7 @@ public class PartCable extends AEBasePart implements IPartCable
rh.setTexture( null );
}
@SideOnly(Side.CLIENT)
public void rendereGlassConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
@ -472,6 +476,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
}
@SideOnly(Side.CLIENT)
public void renderCoveredConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
@ -573,6 +578,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
}
@SideOnly(Side.CLIENT)
public void renderSmartConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
@ -694,6 +700,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
}
@SideOnly(Side.CLIENT)
protected void setSmartConnectionRotations(ForgeDirection of, RenderBlocks renderer)
{
switch (of)
@ -728,6 +735,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
}
@SideOnly(Side.CLIENT)
protected void renderAllFaces(AEBaseBlock blk, int x, int y, int z, RenderBlocks renderer)
{
renderer.renderFaceXNeg( blk, x, y, z, blk.getRendererInstance().getTexture( ForgeDirection.WEST ) );
@ -739,6 +747,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
boolean useCovered = false;

View file

@ -22,6 +22,8 @@ import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.client.texture.OffsetIcon;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartCableCovered extends PartCable
{
@ -97,6 +99,7 @@ public class PartCableCovered extends PartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
GL11.glTranslated( -0.2, -0.3, 0.0 );
@ -108,6 +111,7 @@ public class PartCableCovered extends PartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( getTexture( getCableColor() ) );

View file

@ -26,6 +26,8 @@ import appeng.client.texture.FlipableIcon;
import appeng.client.texture.OffsetIcon;
import appeng.client.texture.TaughtIcon;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartCableSmart extends PartCable
{
@ -59,6 +61,7 @@ public class PartCableSmart extends PartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
GL11.glTranslated( -0.2, -0.3, 0.0 );
@ -121,6 +124,7 @@ public class PartCableSmart extends PartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( getTexture( getCableColor() ) );

View file

@ -30,6 +30,8 @@ import appeng.client.texture.FlipableIcon;
import appeng.client.texture.OffsetIcon;
import appeng.client.texture.TaughtIcon;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartDenseCable extends PartCable
{
@ -73,6 +75,7 @@ public class PartDenseCable extends PartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
GL11.glTranslated( -0.2, -0.3, 0.0 );
@ -189,6 +192,7 @@ public class PartDenseCable extends PartCable
return false;
}
@SideOnly(Side.CLIENT)
public void renderDenseConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
@ -197,40 +201,31 @@ public class PartDenseCable extends PartCable
boolean isGlass = false;
AEColor myColor = getCableColor();
/*
* ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) ==
* AECableType.GLASS && ccph.getPart( of.getOpposite() ) == null ) {
* isGlass = true; rh.setTexture( getGlassTexture( myColor =
* ccph.getColor() ) ); } else if ( ccph == null && ghh != null &&
* ghh.getCableConnectionType( of ) != AECableType.GLASS ) {
* rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN:
* rh.setBounds( 3, 0, 3, 13, 4, 13 ); break; case EAST: rh.setBounds(
* 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13,
* 13, 4 ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 );
* break; case UP: rh.setBounds( 3, 12, 3, 13, 16, 13 ); break; case
* WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; }
* rh.renderBlock( x, y, z, renderer );
* ( ghh != null && ccph != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && ccph.getPart(
* of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = ccph.getColor() ) );
* } else if ( ccph == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) {
* rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, 0, 3, 13, 4, 13 );
* break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, 13, 4
* ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( 3, 12, 3, 13, 16,
* 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y,
* z, renderer );
*
* if ( true ) { setSmartConnectionRotations( of, renderer ); Icon defa
* = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f
* ); Icon defb = new TaughtIcon( getChannelTex( channels, true
* ).getIcon(), -0.2f );
* if ( true ) { setSmartConnectionRotations( of, renderer ); Icon defa = new TaughtIcon( getChannelTex(
* channels, false ).getIcon(), -0.2f ); Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(),
* -0.2f );
*
* if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) {
* AEBaseBlock blk = (AEBaseBlock) rh.getBlock(); FlipableIcon ico =
* blk.getRendererInstance().getTexture( ForgeDirection.EAST );
* ico.setFlip( false, true ); }
* if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock)
* rh.getBlock(); FlipableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST ); ico.setFlip(
* false, true ); }
*
* Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 );
* Tessellator.instance.setColorOpaque_I( myColor.mediumVariant );
* rh.setTexture( defa, defa, defa, defa, defa, defa ); renderAllFaces(
* (AEBaseBlock) rh.getBlock(), x, y, z, renderer );
* Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 ); Tessellator.instance.setColorOpaque_I(
* myColor.mediumVariant ); rh.setTexture( defa, defa, defa, defa, defa, defa ); renderAllFaces( (AEBaseBlock)
* rh.getBlock(), x, y, z, renderer );
*
* Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
* rh.setTexture( defb, defb, defb, defb, defb, defb ); renderAllFaces(
* (AEBaseBlock) rh.getBlock(), x, y, z, renderer );
* Tessellator.instance.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( defb, defb, defb, defb, defb,
* defb ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer );
*
* renderer.uvRotateBottom = renderer.uvRotateEast =
* renderer.uvRotateNorth = renderer.uvRotateSouth =
* renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth =
* renderer.uvRotateTop = renderer.uvRotateWest = 0; }
*
* rh.setTexture( getTexture( getCableColor() ) ); }
@ -288,6 +283,7 @@ public class PartDenseCable extends PartCable
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( getTexture( getCableColor() ) );

View file

@ -25,6 +25,8 @@ import appeng.api.util.AECableType;
import appeng.me.GridAccessException;
import appeng.me.helpers.AENetworkProxy;
import appeng.parts.AEBasePart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
{
@ -92,6 +94,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
Icon myIcon = is.getIconIndex();
@ -108,6 +111,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
GL11.glTranslated( -0.2, -0.3, 0.0 );

View file

@ -25,6 +25,8 @@ import appeng.me.cache.P2PCache;
import appeng.me.cache.helpers.TunnelCollection;
import appeng.parts.PartBasicState;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
{
@ -259,6 +261,7 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( getTypeTexture() );
@ -266,8 +269,8 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderInventoryBox( renderer );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), is.getIconIndex(),
CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderInventoryBox( renderer );
@ -279,6 +282,7 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.useSimpliedRendering( x, y, z, this );
@ -287,8 +291,8 @@ public class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), is.getIconIndex(),
CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(),
is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
rh.setBounds( 2, 2, 14, 14, 14, 16 );
rh.renderBlock( x, y, z, renderer );

View file

@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.parts.IPartRenderHelper;
import appeng.client.texture.CableBusTextures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartDarkMonitor extends PartMonitor
{
@ -17,6 +19,7 @@ public class PartDarkMonitor extends PartMonitor
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setBounds( 2, 2, 14, 14, 14, 16 );
@ -33,6 +36,7 @@ public class PartDarkMonitor extends PartMonitor
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),

View file

@ -21,6 +21,8 @@ import appeng.client.texture.CableBusTextures;
import appeng.me.GridAccessException;
import appeng.parts.AEBasePart;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartMonitor extends AEBasePart implements IPartMonitor
{
@ -123,6 +125,7 @@ public class PartMonitor extends AEBasePart implements IPartMonitor
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setBounds( 2, 2, 14, 14, 14, 16 );
@ -145,6 +148,7 @@ public class PartMonitor extends AEBasePart implements IPartMonitor
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),

View file

@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.parts.IPartRenderHelper;
import appeng.client.texture.CableBusTextures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartSemiDarkMonitor extends PartMonitor
{
@ -17,6 +19,7 @@ public class PartSemiDarkMonitor extends PartMonitor
}
@Override
@SideOnly(Side.CLIENT)
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setBounds( 2, 2, 14, 14, 14, 16 );
@ -36,6 +39,7 @@ public class PartSemiDarkMonitor extends PartMonitor
}
@Override
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(),

View file

@ -45,6 +45,8 @@ import appeng.core.localization.PlayerMessages;
import appeng.me.GridAccessException;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PartStorageMonitor extends PartMonitor implements IPartStorageMonitor, IStackWatcherHost
{
@ -169,6 +171,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
}
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer)
{
Tessellator tess = Tessellator.instance;