From e436dca7607586412f1c823e06d2690b48a45860 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Thu, 6 Feb 2014 23:51:19 -0600 Subject: [PATCH] Fixed bug with Energy Inject/Extract Averages. SideOnly All the things. Pulled Rendering for CableContainers out into a Proxy. --- client/render/BaseBlockRender.java | 1 + client/render/BusRenderHelper.java | 8 +- client/render/BusRenderer.java | 3 + client/render/CableRenderHelper.java | 177 ++++++++ client/render/RenderBlocksWorkaround.java | 3 + client/render/TESRWrapper.java | 3 + client/render/WorldRender.java | 3 + client/render/entity/RenderTinyTNTPrimed.java | 3 + facade/FacadePart.java | 5 + helpers/WirelessTerminalGuiObject.java | 1 - .../modules/helpers/FacadeProxyBC.java | 400 ------------------ .../modules/helpers/FacadeProxyNull.java | 83 ---- integration/modules/helpers/IFacadeProxy.java | 41 -- integration/modules/helpers/IFacadeTile.java | 19 - items/storage/ItemBasicStorageCell.java | 19 +- me/cache/EnergyGridCache.java | 6 +- parts/AEBasePart.java | 6 + parts/CableBusContainer.java | 153 +------ parts/ICableBusContainer.java | 3 + parts/PartBasicState.java | 3 + parts/automation/PartAnnihilationPlane.java | 4 + parts/automation/PartExportBus.java | 4 + parts/automation/PartFormationPlane.java | 4 + parts/automation/PartImportBus.java | 4 + parts/automation/PartLevelEmitter.java | 4 + parts/misc/PartCableAnchor.java | 6 + parts/misc/PartInterface.java | 4 + parts/misc/PartStorageBus.java | 4 + parts/misc/PartToggleBus.java | 4 + parts/networking/PartCable.java | 9 + parts/networking/PartCableCovered.java | 4 + parts/networking/PartCableSmart.java | 4 + parts/networking/PartDenseCable.java | 54 ++- parts/networking/PartQuartzFiber.java | 4 + parts/p2p/PartP2PTunnel.java | 12 +- parts/reporting/PartDarkMonitor.java | 4 + parts/reporting/PartMonitor.java | 4 + parts/reporting/PartSemiDarkMonitor.java | 4 + parts/reporting/PartStorageMonitor.java | 3 + 39 files changed, 341 insertions(+), 739 deletions(-) create mode 100644 client/render/CableRenderHelper.java delete mode 100644 integration/modules/helpers/FacadeProxyBC.java delete mode 100644 integration/modules/helpers/FacadeProxyNull.java delete mode 100644 integration/modules/helpers/IFacadeProxy.java delete mode 100644 integration/modules/helpers/IFacadeTile.java diff --git a/client/render/BaseBlockRender.java b/client/render/BaseBlockRender.java index 86eb8f36..8f513250 100644 --- a/client/render/BaseBlockRender.java +++ b/client/render/BaseBlockRender.java @@ -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 { diff --git a/client/render/BusRenderHelper.java b/client/render/BusRenderHelper.java index 1d4909f7..c4ac4a69 100644 --- a/client/render/BusRenderHelper.java +++ b/client/render/BusRenderHelper.java @@ -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()] ); } diff --git a/client/render/BusRenderer.java b/client/render/BusRenderer.java index 25cf5598..c53a24d6 100644 --- a/client/render/BusRenderer.java +++ b/client/render/BusRenderer.java @@ -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 { diff --git a/client/render/CableRenderHelper.java b/client/render/CableRenderHelper.java new file mode 100644 index 00000000..67a7d47a --- /dev/null +++ b/client/render/CableRenderHelper.java @@ -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 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 ); + } + } + } + +} diff --git a/client/render/RenderBlocksWorkaround.java b/client/render/RenderBlocksWorkaround.java index 845e6771..41095293 100644 --- a/client/render/RenderBlocksWorkaround.java +++ b/client/render/RenderBlocksWorkaround.java @@ -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 { diff --git a/client/render/TESRWrapper.java b/client/render/TESRWrapper.java index 13a2e077..56de965a 100644 --- a/client/render/TESRWrapper.java +++ b/client/render/TESRWrapper.java @@ -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 { diff --git a/client/render/WorldRender.java b/client/render/WorldRender.java index 03f7763a..6bf683f8 100644 --- a/client/render/WorldRender.java +++ b/client/render/WorldRender.java @@ -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 { diff --git a/client/render/entity/RenderTinyTNTPrimed.java b/client/render/entity/RenderTinyTNTPrimed.java index a369f08b..aff39e96 100644 --- a/client/render/entity/RenderTinyTNTPrimed.java +++ b/client/render/entity/RenderTinyTNTPrimed.java @@ -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 { diff --git a/facade/FacadePart.java b/facade/FacadePart.java index 56b0868e..fdfd0e98 100644 --- a/facade/FacadePart.java +++ b/facade/FacadePart.java @@ -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 ) diff --git a/helpers/WirelessTerminalGuiObject.java b/helpers/WirelessTerminalGuiObject.java index e6965fdc..5019b43e 100644 --- a/helpers/WirelessTerminalGuiObject.java +++ b/helpers/WirelessTerminalGuiObject.java @@ -157,7 +157,6 @@ public class WirelessTerminalGuiObject implements IPortableCell itemStorage.removeListener( l ); } - @SuppressWarnings("deprecation") @Override public IItemList getAvailableItems(IItemList out) { diff --git a/integration/modules/helpers/FacadeProxyBC.java b/integration/modules/helpers/FacadeProxyBC.java deleted file mode 100644 index cf05349f..00000000 --- a/integration/modules/helpers/FacadeProxyBC.java +++ /dev/null @@ -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 getDrops(IFacadeTile ft) - { - List 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; - } - -} diff --git a/integration/modules/helpers/FacadeProxyNull.java b/integration/modules/helpers/FacadeProxyNull.java deleted file mode 100644 index 52c357a0..00000000 --- a/integration/modules/helpers/FacadeProxyNull.java +++ /dev/null @@ -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 getDrops(IFacadeTile ft) - { - return new ArrayList(); - } - - @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; - } - -} diff --git a/integration/modules/helpers/IFacadeProxy.java b/integration/modules/helpers/IFacadeProxy.java deleted file mode 100644 index e4bf7bde..00000000 --- a/integration/modules/helpers/IFacadeProxy.java +++ /dev/null @@ -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 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); - -} diff --git a/integration/modules/helpers/IFacadeTile.java b/integration/modules/helpers/IFacadeTile.java deleted file mode 100644 index 1b5776a2..00000000 --- a/integration/modules/helpers/IFacadeTile.java +++ /dev/null @@ -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); - -} diff --git a/items/storage/ItemBasicStorageCell.java b/items/storage/ItemBasicStorageCell.java index 64bbcf2c..372c4d48 100644 --- a/items/storage/ItemBasicStorageCell.java +++ b/items/storage/ItemBasicStorageCell.java @@ -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" ) ); } */ } } diff --git a/me/cache/EnergyGridCache.java b/me/cache/EnergyGridCache.java index ec10670c..2d32d93b 100644 --- a/me/cache/EnergyGridCache.java +++ b/me/cache/EnergyGridCache.java @@ -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; } diff --git a/parts/AEBasePart.java b/parts/AEBasePart.java index 39c0dffb..c46dd0ed 100644 --- a/parts/AEBasePart.java +++ b/parts/AEBasePart.java @@ -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) { diff --git a/parts/CableBusContainer.java b/parts/CableBusContainer.java index 5eb5525b..d86526fb 100644 --- a/parts/CableBusContainer.java +++ b/parts/CableBusContainer.java @@ -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 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 diff --git a/parts/ICableBusContainer.java b/parts/ICableBusContainer.java index 0b580c63..e7fe8704 100644 --- a/parts/ICableBusContainer.java +++ b/parts/ICableBusContainer.java @@ -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(); diff --git a/parts/PartBasicState.java b/parts/PartBasicState.java index 4a71fef2..01304383 100644 --- a/parts/PartBasicState.java +++ b/parts/PartBasicState.java @@ -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(); diff --git a/parts/automation/PartAnnihilationPlane.java b/parts/automation/PartAnnihilationPlane.java index 4ebb1214..f5005c07 100644 --- a/parts/automation/PartAnnihilationPlane.java +++ b/parts/automation/PartAnnihilationPlane.java @@ -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; diff --git a/parts/automation/PartExportBus.java b/parts/automation/PartExportBus.java index 19cd28d2..4ce99630 100644 --- a/parts/automation/PartExportBus.java +++ b/parts/automation/PartExportBus.java @@ -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 ); diff --git a/parts/automation/PartFormationPlane.java b/parts/automation/PartFormationPlane.java index 67ba347c..55ba8055 100644 --- a/parts/automation/PartFormationPlane.java +++ b/parts/automation/PartFormationPlane.java @@ -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; diff --git a/parts/automation/PartImportBus.java b/parts/automation/PartImportBus.java index 3f574da8..7089f313 100644 --- a/parts/automation/PartImportBus.java +++ b/parts/automation/PartImportBus.java @@ -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 ); diff --git a/parts/automation/PartLevelEmitter.java b/parts/automation/PartLevelEmitter.java index e6c1cd99..016b8860 100644 --- a/parts/automation/PartLevelEmitter.java +++ b/parts/automation/PartLevelEmitter.java @@ -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 { @@ -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() ); diff --git a/parts/misc/PartCableAnchor.java b/parts/misc/PartCableAnchor.java index 931e4bfd..cc9dee7d 100644 --- a/parts/misc/PartCableAnchor.java +++ b/parts/misc/PartCableAnchor.java @@ -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) { diff --git a/parts/misc/PartInterface.java b/parts/misc/PartInterface.java index c4ce6b16..a39352dd 100644 --- a/parts/misc/PartInterface.java +++ b/parts/misc/PartInterface.java @@ -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 ); diff --git a/parts/misc/PartStorageBus.java b/parts/misc/PartStorageBus.java index 2492d9fb..cccd9d9b 100644 --- a/parts/misc/PartStorageBus.java +++ b/parts/misc/PartStorageBus.java @@ -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, 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 ); diff --git a/parts/misc/PartToggleBus.java b/parts/misc/PartToggleBus.java index 41997a58..0b29644d 100644 --- a/parts/misc/PartToggleBus.java +++ b/parts/misc/PartToggleBus.java @@ -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 ); diff --git a/parts/networking/PartCable.java b/parts/networking/PartCable.java index bb899e73..2f568c22 100644 --- a/parts/networking/PartCable.java +++ b/parts/networking/PartCable.java @@ -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; diff --git a/parts/networking/PartCableCovered.java b/parts/networking/PartCableCovered.java index d58104eb..a0949f6f 100644 --- a/parts/networking/PartCableCovered.java +++ b/parts/networking/PartCableCovered.java @@ -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() ) ); diff --git a/parts/networking/PartCableSmart.java b/parts/networking/PartCableSmart.java index eff9857a..1344cb74 100644 --- a/parts/networking/PartCableSmart.java +++ b/parts/networking/PartCableSmart.java @@ -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() ) ); diff --git a/parts/networking/PartDenseCable.java b/parts/networking/PartDenseCable.java index 85a90eb5..c58469b1 100644 --- a/parts/networking/PartDenseCable.java +++ b/parts/networking/PartDenseCable.java @@ -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() ) ); diff --git a/parts/networking/PartQuartzFiber.java b/parts/networking/PartQuartzFiber.java index cf5bb4e3..4a44ac15 100644 --- a/parts/networking/PartQuartzFiber.java +++ b/parts/networking/PartQuartzFiber.java @@ -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 ); diff --git a/parts/p2p/PartP2PTunnel.java b/parts/p2p/PartP2PTunnel.java index 136754f4..08f85cdf 100644 --- a/parts/p2p/PartP2PTunnel.java +++ b/parts/p2p/PartP2PTunnel.java @@ -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 extends PartBasicState { @@ -259,6 +261,7 @@ public class PartP2PTunnel extends PartBasicState } @Override + @SideOnly(Side.CLIENT) public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) { rh.setTexture( getTypeTexture() ); @@ -266,8 +269,8 @@ public class 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 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 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 ); diff --git a/parts/reporting/PartDarkMonitor.java b/parts/reporting/PartDarkMonitor.java index 173e5ab3..879dfe30 100644 --- a/parts/reporting/PartDarkMonitor.java +++ b/parts/reporting/PartDarkMonitor.java @@ -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(), diff --git a/parts/reporting/PartMonitor.java b/parts/reporting/PartMonitor.java index dd2dbe25..ee81041f 100644 --- a/parts/reporting/PartMonitor.java +++ b/parts/reporting/PartMonitor.java @@ -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(), diff --git a/parts/reporting/PartSemiDarkMonitor.java b/parts/reporting/PartSemiDarkMonitor.java index a09c553f..ccd00ccb 100644 --- a/parts/reporting/PartSemiDarkMonitor.java +++ b/parts/reporting/PartSemiDarkMonitor.java @@ -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(), diff --git a/parts/reporting/PartStorageMonitor.java b/parts/reporting/PartStorageMonitor.java index 484aa7a2..4dbcaba7 100644 --- a/parts/reporting/PartStorageMonitor.java +++ b/parts/reporting/PartStorageMonitor.java @@ -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;