Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17bdd085b1 | |||
| 684cda58c2 | |||
| 740324913e | |||
| dae5e888e9 | |||
| a3abc7a1f0 | |||
| dd1ae4a9b5 | |||
| c9ef1beea1 | |||
| 276480519e | |||
| 04b1ca3485 | |||
| c14f688100 | |||
| 8bf98919e2 | |||
| 1862ab3562 | |||
| df6070ecbd | |||
| 12cf76a62f | |||
| 919faefb15 | |||
| 71a9687b01 | |||
| e877eac7bb | |||
| 0696662254 | |||
| 1aa84945eb | |||
| 88f9c8ba40 | |||
| 0ed1054aad | |||
| 11f92f6888 | |||
| b0d3a6c743 | |||
| b252d1f269 | |||
| d4692128a5 | |||
| 599e6f3e64 | |||
| 478d400627 | |||
| fbfd13d163 | |||
| 8b4a39085e | |||
| d5dfc31210 | |||
| 824ec1eccb | |||
| 87eb5498f9 | |||
| 8c62e1e7a6 | |||
| 97c099c2ae | |||
| 3c19350b9b | |||
| c83946420e | |||
| 500fc47490 | |||
| cb44af5e49 | |||
| c1b966eea1 | |||
| 8f1d22b863 | |||
| 15bcf6fbd1 | |||
| 1ea48fb389 | |||
| 47592bcbcb |
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.api.networking.IGridNode;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception occurred because of an already existing connection between the two {@link IGridNode}s
|
||||||
|
*
|
||||||
|
* Intended to signal an internal exception and not intended to be thrown by
|
||||||
|
* any 3rd party module.
|
||||||
|
*
|
||||||
|
* @author yueh
|
||||||
|
* @version rv3
|
||||||
|
* @since rv3
|
||||||
|
*/
|
||||||
|
public class ExistingConnectionException extends FailedConnection
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2975450379720353182L;
|
||||||
|
private static final String DEFAULT_MESSAGE = "Connection between both nodes already exists.";
|
||||||
|
|
||||||
|
public ExistingConnectionException()
|
||||||
|
{
|
||||||
|
super( DEFAULT_MESSAGE );
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExistingConnectionException( String message )
|
||||||
|
{
|
||||||
|
super( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,6 +24,22 @@
|
|||||||
package appeng.api.exceptions;
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.api.networking.IGridNode;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception indicating a failed connection between two {@link IGridNode}s.
|
||||||
|
*
|
||||||
|
* Intended to signal an internal exception and not intended to be thrown by
|
||||||
|
* any 3rd party module.
|
||||||
|
*
|
||||||
|
* See any subclass for a more specific reason.
|
||||||
|
*
|
||||||
|
* @author AlgorithmX2
|
||||||
|
* @author yueh
|
||||||
|
* @version rv3
|
||||||
|
* @since rv0
|
||||||
|
*/
|
||||||
public class FailedConnection extends Exception
|
public class FailedConnection extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -32,4 +48,9 @@ public class FailedConnection extends Exception
|
|||||||
public FailedConnection()
|
public FailedConnection()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FailedConnection( String message )
|
||||||
|
{
|
||||||
|
super( message );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception due to trying to connect one or more null values.
|
||||||
|
*
|
||||||
|
* Intended to signal an internal exception and not intended to be thrown by
|
||||||
|
* any 3rd party module.
|
||||||
|
*
|
||||||
|
* @author yueh
|
||||||
|
* @version rv3
|
||||||
|
* @since rv3
|
||||||
|
*/
|
||||||
|
public class NullNodeConnectionException extends FailedConnection
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -2143719383495321764L;
|
||||||
|
private static final String DEFAULT_MESSAGE = "Connection forged between null entities.";
|
||||||
|
|
||||||
|
public NullNodeConnectionException()
|
||||||
|
{
|
||||||
|
super( DEFAULT_MESSAGE );
|
||||||
|
}
|
||||||
|
|
||||||
|
public NullNodeConnectionException( String message )
|
||||||
|
{
|
||||||
|
super( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 AlgorithmX2
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.api.exceptions;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception due to trying to connect different security realms.
|
||||||
|
*
|
||||||
|
* Intended to signal an internal exception and not intended to be thrown by
|
||||||
|
* any 3rd party module.
|
||||||
|
*
|
||||||
|
* @author yueh
|
||||||
|
* @version rv3
|
||||||
|
* @since rv3
|
||||||
|
*/
|
||||||
|
public class SecurityConnectionException extends FailedConnection
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 5048714900434215426L;
|
||||||
|
private static final String DEFAULT_MESSAGE = "Connection failed due to different security realms.";
|
||||||
|
|
||||||
|
public SecurityConnectionException()
|
||||||
|
{
|
||||||
|
super( DEFAULT_MESSAGE );
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecurityConnectionException( String message )
|
||||||
|
{
|
||||||
|
super( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -61,6 +61,7 @@ import appeng.core.features.IAEFeature;
|
|||||||
import appeng.core.features.IFeatureHandler;
|
import appeng.core.features.IFeatureHandler;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
|
import appeng.tile.AEBaseTile;
|
||||||
import appeng.util.LookDirection;
|
import appeng.util.LookDirection;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||||||
protected boolean isInventory = false;
|
protected boolean isInventory = false;
|
||||||
private IFeatureHandler handler;
|
private IFeatureHandler handler;
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
BlockRenderInfo renderInfo;
|
private BlockRenderInfo renderInfo;
|
||||||
|
|
||||||
protected AEBaseBlock( final Material mat )
|
protected AEBaseBlock( final Material mat )
|
||||||
{
|
{
|
||||||
@@ -132,30 +133,24 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||||||
return this.renderInfo;
|
return this.renderInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
final BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> renderer = this.getRenderer();
|
||||||
{
|
this.renderInfo = new BlockRenderInfo( renderer );
|
||||||
final BaseBlockRender renderer = this.getRenderer().newInstance();
|
|
||||||
this.renderInfo = new BlockRenderInfo( renderer );
|
|
||||||
|
|
||||||
return this.renderInfo;
|
return this.renderInfo;
|
||||||
}
|
|
||||||
catch( final InstantiationException e )
|
|
||||||
{
|
|
||||||
throw new IllegalStateException( "Failed to create a new instance of an illegal class " + this.getRenderer(), e );
|
|
||||||
}
|
|
||||||
catch( final IllegalAccessException e )
|
|
||||||
{
|
|
||||||
throw new IllegalStateException( "Failed to create a new instance of " + this.getRenderer() + " because of permissions.", e );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory method to create a new render instance.
|
||||||
|
*
|
||||||
|
* @return the newly created instance.
|
||||||
|
*/
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
protected BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> getRenderer()
|
||||||
{
|
{
|
||||||
return BaseBlockRender.class;
|
return new BaseBlockRender<AEBaseBlock, AEBaseTile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
|
IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
|
||||||
{
|
{
|
||||||
return super.getIcon( w, x, y, z, s );
|
return super.getIcon( w, x, y, z, s );
|
||||||
}
|
}
|
||||||
@@ -276,15 +271,15 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||||||
{
|
{
|
||||||
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
|
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
|
||||||
|
|
||||||
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
|
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.getA(), ld.getB() );
|
||||||
|
|
||||||
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
|
|
||||||
if( r != null )
|
if( r != null )
|
||||||
{
|
{
|
||||||
final double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
|
final double xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
|
||||||
final double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
|
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
|
||||||
final double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
|
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
|
||||||
|
|
||||||
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
|
||||||
|
|
||||||
@@ -528,7 +523,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||||||
super.getSubBlocks( item, tabs, itemStacks );
|
super.getSubBlocks( item, tabs, itemStacks );
|
||||||
}
|
}
|
||||||
|
|
||||||
int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s )
|
private int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s )
|
||||||
{
|
{
|
||||||
final IOrientable ori = this.getOrientable( w, x, y, z );
|
final IOrientable ori = this.getOrientable( w, x, y, z );
|
||||||
|
|
||||||
@@ -611,7 +606,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
|
|||||||
return this.getUnlocalizedName();
|
return this.getUnlocalizedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
|
void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
|
|||||||
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
|
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
|
private AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
|
||||||
{
|
{
|
||||||
this.slabs = slabs;
|
this.slabs = slabs;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
|
|||||||
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
|
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasBlockTileEntity()
|
private boolean hasBlockTileEntity()
|
||||||
{
|
{
|
||||||
return this.tileEntityType != null;
|
return this.tileEntityType != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
|
import appeng.client.render.blocks.RenderBlockCraftingCPUMonitor;
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
import appeng.tile.crafting.TileCraftingMonitorTile;
|
import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||||
@@ -46,9 +45,10 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockCraftingCPUMonitor getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockCraftingCPUMonitor.class;
|
return new RenderBlockCraftingCPUMonitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockCraftingCPU;
|
import appeng.client.render.blocks.RenderBlockCraftingCPU;
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
@@ -47,7 +46,7 @@ import appeng.util.Platform;
|
|||||||
|
|
||||||
public class BlockCraftingUnit extends AEBaseTileBlock
|
public class BlockCraftingUnit extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
public static final int FLAG_FORMED = 8;
|
static final int FLAG_FORMED = 8;
|
||||||
|
|
||||||
public BlockCraftingUnit()
|
public BlockCraftingUnit()
|
||||||
{
|
{
|
||||||
@@ -59,9 +58,10 @@ public class BlockCraftingUnit extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockCraftingCPU<? extends BlockCraftingUnit, ? extends TileCraftingTile> getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockCraftingCPU.class;
|
return new RenderBlockCraftingCPU<BlockCraftingUnit, TileCraftingTile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockAssembler;
|
import appeng.client.render.blocks.RenderBlockAssembler;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -41,7 +40,7 @@ import appeng.util.Platform;
|
|||||||
public class BlockMolecularAssembler extends AEBaseTileBlock
|
public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public static boolean booleanAlphaPass = false;
|
private static boolean booleanAlphaPass = false;
|
||||||
|
|
||||||
public BlockMolecularAssembler()
|
public BlockMolecularAssembler()
|
||||||
{
|
{
|
||||||
@@ -62,15 +61,15 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||||||
@Override
|
@Override
|
||||||
public boolean canRenderInPass( final int pass )
|
public boolean canRenderInPass( final int pass )
|
||||||
{
|
{
|
||||||
booleanAlphaPass = pass == 1;
|
setBooleanAlphaPass( pass == 1 );
|
||||||
return pass == 0 || pass == 1;
|
return pass == 0 || pass == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public Class<? extends BaseBlockRender> getRenderer()
|
public RenderBlockAssembler getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockAssembler.class;
|
return new RenderBlockAssembler();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -84,4 +83,14 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isBooleanAlphaPass()
|
||||||
|
{
|
||||||
|
return booleanAlphaPass;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setBooleanAlphaPass( final boolean booleanAlphaPass )
|
||||||
|
{
|
||||||
|
BlockMolecularAssembler.booleanAlphaPass = booleanAlphaPass;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.util.FakePlayer;
|
import net.minecraftforge.common.util.FakePlayer;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.implementations.tiles.ICrankable;
|
import appeng.api.implementations.tiles.ICrankable;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockCrank;
|
import appeng.client.render.blocks.RenderBlockCrank;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.stats.Stats;
|
import appeng.core.stats.Stats;
|
||||||
@@ -56,9 +58,10 @@ public class BlockCrank extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
public RenderBlockCrank getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockCrank.class;
|
return new RenderBlockCrank();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockCharger;
|
import appeng.client.render.blocks.RenderBlockCharger;
|
||||||
import appeng.client.render.effects.LightningFX;
|
import appeng.client.render.effects.LightningFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
@@ -63,9 +62,10 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockCharger getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockCharger.class;
|
return new RenderBlockCharger();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockInscriber;
|
import appeng.client.render.blocks.RenderBlockInscriber;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -49,9 +51,10 @@ public class BlockInscriber extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockInscriber getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockInscriber.class;
|
return new RenderBlockInscriber();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,9 +26,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockInterface;
|
import appeng.client.render.blocks.RenderBlockInterface;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -48,9 +50,10 @@ public class BlockInterface extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockInterface getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockInterface.class;
|
return new RenderBlockInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -91,9 +91,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends RenderQuartzTorch> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderQuartzTorch getRenderer()
|
||||||
{
|
{
|
||||||
return RenderQuartzTorch.class;
|
return new RenderQuartzTorch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockPaint;
|
import appeng.client.render.blocks.RenderBlockPaint;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.tile.misc.TilePaint;
|
import appeng.tile.misc.TilePaint;
|
||||||
@@ -59,9 +58,10 @@ public class BlockPaint extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockPaint getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockPaint.class;
|
return new RenderBlockPaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
import appeng.api.util.IOrientableBlock;
|
import appeng.api.util.IOrientableBlock;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockQuartzAccelerator;
|
import appeng.client.render.blocks.RenderBlockQuartzAccelerator;
|
||||||
import appeng.client.render.effects.LightningFX;
|
import appeng.client.render.effects.LightningFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
@@ -55,9 +54,10 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockQuartzAccelerator getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockQuartzAccelerator.class;
|
return new RenderBlockQuartzAccelerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,7 +71,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
|
|||||||
|
|
||||||
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
|
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
|
||||||
|
|
||||||
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
|
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
|
||||||
{
|
{
|
||||||
final double d0 = r.nextFloat() - 0.5F;
|
final double d0 = r.nextFloat() - 0.5F;
|
||||||
final double d1 = r.nextFloat() - 0.5F;
|
final double d1 = r.nextFloat() - 0.5F;
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
import appeng.api.util.IOrientableBlock;
|
import appeng.api.util.IOrientableBlock;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderQuartzTorch;
|
import appeng.client.render.blocks.RenderQuartzTorch;
|
||||||
import appeng.client.render.effects.LightningFX;
|
import appeng.client.render.effects.LightningFX;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
@@ -63,9 +62,10 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderQuartzTorch getRenderer()
|
||||||
{
|
{
|
||||||
return RenderQuartzTorch.class;
|
return new RenderQuartzTorch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RendererSecurity;
|
import appeng.client.render.blocks.RendererSecurity;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -47,9 +49,10 @@ public class BlockSecurity extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RendererSecurity getRenderer()
|
||||||
{
|
{
|
||||||
return RendererSecurity.class;
|
return new RendererSecurity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockSkyCompass;
|
import appeng.client.render.blocks.RenderBlockSkyCompass;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
@@ -57,9 +56,10 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockSkyCompass getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockSkyCompass.class;
|
return new RenderBlockSkyCompass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -40,9 +40,10 @@ import net.minecraft.world.Explosion;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderTinyTNT;
|
import appeng.client.render.blocks.RenderTinyTNT;
|
||||||
import appeng.client.texture.FullIcon;
|
import appeng.client.texture.FullIcon;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
@@ -66,13 +67,14 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
this.setHardness( 0F );
|
this.setHardness( 0F );
|
||||||
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
|
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
|
||||||
|
|
||||||
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance(), 16, 4, true );
|
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderTinyTNT getRenderer()
|
||||||
{
|
{
|
||||||
return RenderTinyTNT.class;
|
return new RenderTinyTNT();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -89,19 +91,18 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated( final World w, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, final float hitY, final float hitZ )
|
public boolean onBlockActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
|
||||||
{
|
{
|
||||||
if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel )
|
if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel )
|
||||||
{
|
{
|
||||||
this.startFuse( w, x, y, z, player );
|
this.startFuse( w, x, y, z, player );
|
||||||
w.setBlockToAir( x, y, z );
|
w.setBlockToAir( x, y, z );
|
||||||
player.getCurrentEquippedItem().damageItem( 1, player );
|
player.getCurrentEquippedItem().damageItem( 1, player );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return super.onBlockActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
|
||||||
return super.onActivated( w, x, y, z, player, side, hitX, hitY, hitZ );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -110,16 +111,6 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
// no images required.
|
// no images required.
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startFuse( final World w, final int x, final int y, final int z, final EntityLivingBase igniter )
|
|
||||||
{
|
|
||||||
if( !w.isRemote )
|
|
||||||
{
|
|
||||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
|
|
||||||
w.spawnEntityInWorld( primedTinyTNTEntity );
|
|
||||||
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockAdded( final World w, final int x, final int y, final int z )
|
public void onBlockAdded( final World w, final int x, final int y, final int z )
|
||||||
{
|
{
|
||||||
@@ -185,4 +176,14 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
|||||||
{
|
{
|
||||||
out.add( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
|
out.add( AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startFuse( final World w, final int x, final int y, final int z, final EntityLivingBase igniter )
|
||||||
|
{
|
||||||
|
if( !w.isRemote )
|
||||||
|
{
|
||||||
|
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, x + 0.5F, y + 0.5F, z + 0.5F, igniter );
|
||||||
|
w.spawnEntityInWorld( primedTinyTNTEntity );
|
||||||
|
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ import appeng.api.parts.PartItemStack;
|
|||||||
import appeng.api.parts.SelectedPart;
|
import appeng.api.parts.SelectedPart;
|
||||||
import appeng.api.util.AEColor;
|
import appeng.api.util.AEColor;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.BusRenderHelper;
|
import appeng.client.render.BusRenderHelper;
|
||||||
import appeng.client.render.blocks.RendererCableBus;
|
import appeng.client.render.blocks.RendererCableBus;
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
@@ -64,6 +63,7 @@ import appeng.core.CommonHelper;
|
|||||||
import appeng.core.features.AECableBusFeatureHandler;
|
import appeng.core.features.AECableBusFeatureHandler;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
|
import appeng.helpers.Reflected;
|
||||||
import appeng.integration.IntegrationRegistry;
|
import appeng.integration.IntegrationRegistry;
|
||||||
import appeng.integration.IntegrationType;
|
import appeng.integration.IntegrationType;
|
||||||
import appeng.integration.abstraction.IFMP;
|
import appeng.integration.abstraction.IFMP;
|
||||||
@@ -82,13 +82,19 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
|
|||||||
{
|
{
|
||||||
|
|
||||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||||
public static Class<? extends TileEntity> noTesrTile;
|
private static Class<? extends TileEntity> noTesrTile;
|
||||||
public static Class<? extends TileEntity> tesrTile;
|
private static Class<? extends TileEntity> tesrTile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immibis MB Support.
|
* Immibis MB Support.
|
||||||
|
*
|
||||||
|
* It will look for a field named ImmibisMicroblocks_TransformableBlockMarker or
|
||||||
|
* ImmibisMicroblocks_TransformableTileEntityMarker, modifiers, type, etc can be ignored.
|
||||||
*/
|
*/
|
||||||
boolean ImmibisMicroblocks_TransformableBlockMarker = true;
|
@Reflected
|
||||||
int myColorMultiplier = 0xffffff;
|
private static final boolean ImmibisMicroblocks_TransformableBlockMarker = true;
|
||||||
|
|
||||||
|
private int myColorMultiplier = 0xffffff;
|
||||||
|
|
||||||
public BlockCableBus()
|
public BlockCableBus()
|
||||||
{
|
{
|
||||||
@@ -396,7 +402,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
|
|||||||
|
|
||||||
if( te instanceof TileCableBus )
|
if( te instanceof TileCableBus )
|
||||||
{
|
{
|
||||||
out = ( (TileCableBus) te ).cb;
|
out = ( (TileCableBus) te ).getCableBus();
|
||||||
}
|
}
|
||||||
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||||
{
|
{
|
||||||
@@ -407,9 +413,10 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RendererCableBus getRenderer()
|
||||||
{
|
{
|
||||||
return RendererCableBus.class;
|
return new RendererCableBus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -516,4 +523,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
|
|||||||
{
|
{
|
||||||
this.myColorMultiplier = color;
|
this.myColorMultiplier = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Class<? extends TileEntity> getTesrTile()
|
||||||
|
{
|
||||||
|
return BlockCableBus.tesrTile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Class<? extends TileEntity> getNoTesrTile()
|
||||||
|
{
|
||||||
|
return BlockCableBus.noTesrTile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockController;
|
import appeng.client.render.blocks.RenderBlockController;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.tile.networking.TileController;
|
import appeng.tile.networking.TileController;
|
||||||
@@ -54,8 +56,9 @@ public class BlockController extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockController getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockController.class;
|
return new RenderBlockController();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
import appeng.block.AEBaseItemBlock;
|
import appeng.block.AEBaseItemBlock;
|
||||||
import appeng.block.AEBaseItemBlockChargeable;
|
import appeng.block.AEBaseItemBlockChargeable;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockEnergyCube;
|
import appeng.client.render.blocks.RenderBlockEnergyCube;
|
||||||
import appeng.client.texture.ExtraBlockTextures;
|
import appeng.client.texture.ExtraBlockTextures;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
@@ -55,9 +54,10 @@ public class BlockEnergyCell extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockEnergyCube getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockEnergyCube.class;
|
return new RenderBlockEnergyCube();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockWireless;
|
import appeng.client.render.blocks.RenderBlockWireless;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -54,9 +56,10 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockWireless getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockWireless.class;
|
return new RenderBlockWireless();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.blocks.RenderQNB;
|
import appeng.client.render.blocks.RenderQNB;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
@@ -69,9 +72,10 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends RenderQNB> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderQNB getRenderer()
|
||||||
{
|
{
|
||||||
return RenderQNB.class;
|
return new RenderQNB();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderQuartzGlass;
|
import appeng.client.render.blocks.RenderQuartzGlass;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
@@ -46,9 +45,9 @@ public class BlockQuartzGlass extends AEBaseBlock
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public Class<? extends BaseBlockRender> getRenderer()
|
public RenderQuartzGlass getRenderer()
|
||||||
{
|
{
|
||||||
return RenderQuartzGlass.class;
|
return new RenderQuartzGlass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -31,10 +31,12 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.exceptions.MissingDefinition;
|
import appeng.api.exceptions.MissingDefinition;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderQuartzOre;
|
import appeng.client.render.blocks.RenderQuartzOre;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
|
|
||||||
@@ -57,9 +59,10 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderQuartzOre getRenderer()
|
||||||
{
|
{
|
||||||
return RenderQuartzOre.class;
|
return new RenderQuartzOre();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -150,12 +153,12 @@ public class OreQuartz extends AEBaseBlock
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBoostBrightnessLow( final int boostBrightnessLow )
|
void setBoostBrightnessLow( final int boostBrightnessLow )
|
||||||
{
|
{
|
||||||
this.boostBrightnessLow = boostBrightnessLow;
|
this.boostBrightnessLow = boostBrightnessLow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBoostBrightnessHigh( final int boostBrightnessHigh )
|
void setBoostBrightnessHigh( final int boostBrightnessHigh )
|
||||||
{
|
{
|
||||||
this.boostBrightnessHigh = boostBrightnessHigh;
|
this.boostBrightnessHigh = boostBrightnessHigh;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderNull;
|
import appeng.client.render.blocks.RenderNull;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.ICustomCollision;
|
import appeng.helpers.ICustomCollision;
|
||||||
@@ -58,9 +57,10 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderNull getRenderer()
|
||||||
{
|
{
|
||||||
return RenderNull.class;
|
return new RenderNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderSpatialPylon;
|
import appeng.client.render.blocks.RenderSpatialPylon;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
@@ -65,8 +67,9 @@ public class BlockSpatialPylon extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderSpatialPylon getRenderer()
|
||||||
{
|
{
|
||||||
return RenderSpatialPylon.class;
|
return new RenderSpatialPylon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,12 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.storage.ICellHandler;
|
import appeng.api.storage.ICellHandler;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderMEChest;
|
import appeng.client.render.blocks.RenderMEChest;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.localization.PlayerMessages;
|
import appeng.core.localization.PlayerMessages;
|
||||||
@@ -50,9 +52,10 @@ public class BlockChest extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderMEChest getRenderer()
|
||||||
{
|
{
|
||||||
return RenderMEChest.class;
|
return new RenderMEChest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderDrive;
|
import appeng.client.render.blocks.RenderDrive;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -46,9 +48,10 @@ public class BlockDrive extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderDrive getRenderer()
|
||||||
{
|
{
|
||||||
return RenderDrive.class;
|
return new RenderDrive();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
import appeng.client.render.BaseBlockRender;
|
|
||||||
import appeng.client.render.blocks.RenderBlockSkyChest;
|
import appeng.client.render.blocks.RenderBlockSkyChest;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
@@ -83,9 +82,10 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends BaseBlockRender> getRenderer()
|
@SideOnly( Side.CLIENT )
|
||||||
|
protected RenderBlockSkyChest getRenderer()
|
||||||
{
|
{
|
||||||
return RenderBlockSkyChest.class;
|
return new RenderBlockSkyChest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class ClientHelper extends ServerHelper
|
|||||||
@Override
|
@Override
|
||||||
public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk )
|
public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk )
|
||||||
{
|
{
|
||||||
final BaseBlockRender bbr = blk.getRendererInstance().rendererInstance;
|
final BaseBlockRender bbr = blk.getRendererInstance().getRendererInstance();
|
||||||
if( bbr.hasTESR() && tile != null )
|
if( bbr.hasTESR() && tile != null )
|
||||||
{
|
{
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) );
|
ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) );
|
||||||
@@ -413,7 +413,7 @@ public class ClientHelper extends ServerHelper
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,17 +83,16 @@ import appeng.integration.abstraction.INEI;
|
|||||||
|
|
||||||
public abstract class AEBaseGui extends GuiContainer
|
public abstract class AEBaseGui extends GuiContainer
|
||||||
{
|
{
|
||||||
public static boolean switchingGuis;
|
private static boolean switchingGuis;
|
||||||
protected final List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
|
private final List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
|
||||||
// drag y
|
// drag y
|
||||||
final Set<Slot> drag_click = new HashSet<Slot>();
|
private final Set<Slot> drag_click = new HashSet<Slot>();
|
||||||
final AppEngRenderItem aeRenderItem = new AppEngRenderItem();
|
private final AppEngRenderItem aeRenderItem = new AppEngRenderItem();
|
||||||
protected GuiScrollbar myScrollBar = null;
|
private GuiScrollbar scrollBar = null;
|
||||||
boolean disableShiftClick = false;
|
private boolean disableShiftClick = false;
|
||||||
Stopwatch dbl_clickTimer = Stopwatch.createStarted();
|
private Stopwatch dbl_clickTimer = Stopwatch.createStarted();
|
||||||
ItemStack dbl_whichItem;
|
private ItemStack dbl_whichItem;
|
||||||
Slot bl_clicked;
|
private Slot bl_clicked;
|
||||||
boolean useNEI = false;
|
|
||||||
private boolean subGui;
|
private boolean subGui;
|
||||||
|
|
||||||
public AEBaseGui( final Container container )
|
public AEBaseGui( final Container container )
|
||||||
@@ -161,9 +160,9 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
super.drawScreen( mouseX, mouseY, btn );
|
super.drawScreen( mouseX, mouseY, btn );
|
||||||
|
|
||||||
final boolean hasClicked = Mouse.isButtonDown( 0 );
|
final boolean hasClicked = Mouse.isButtonDown( 0 );
|
||||||
if( hasClicked && this.myScrollBar != null )
|
if( hasClicked && this.scrollBar != null )
|
||||||
{
|
{
|
||||||
this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
|
this.scrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( final Object c : this.buttonList )
|
for( final Object c : this.buttonList )
|
||||||
@@ -289,9 +288,9 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
final int oy = this.guiTop; // (height - ySize) / 2;
|
final int oy = this.guiTop; // (height - ySize) / 2;
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
|
||||||
if( this.myScrollBar != null )
|
if( this.scrollBar != null )
|
||||||
{
|
{
|
||||||
this.myScrollBar.draw( this );
|
this.scrollBar.draw( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawFG( ox, oy, x, y );
|
this.drawFG( ox, oy, x, y );
|
||||||
@@ -317,14 +316,14 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
if( fs.isEnabled() )
|
if( fs.isEnabled() )
|
||||||
{
|
{
|
||||||
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
|
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 0.4F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 0.4F );
|
||||||
GL11.glEnable( GL11.GL_BLEND );
|
GL11.glEnable( GL11.GL_BLEND );
|
||||||
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
|
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
GL11.glPopAttrib();
|
GL11.glPopAttrib();
|
||||||
}
|
}
|
||||||
@@ -411,7 +410,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( slot instanceof SlotCraftingTerm )
|
else if( slot instanceof SlotCraftingTerm )
|
||||||
@@ -490,7 +489,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
if( action != null )
|
if( action != null )
|
||||||
{
|
{
|
||||||
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id );
|
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).getSlot().getId() );
|
||||||
NetworkHandler.instance.sendToServer( p );
|
NetworkHandler.instance.sendToServer( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -680,13 +679,13 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
|
final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
|
||||||
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
|
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
|
||||||
}
|
}
|
||||||
else if( i != 0 && this.myScrollBar != null )
|
else if( i != 0 && this.scrollBar != null )
|
||||||
{
|
{
|
||||||
this.myScrollBar.wheel( i );
|
this.scrollBar.wheel( i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void mouseWheelEvent( final int x, final int y, final int wheel )
|
private void mouseWheelEvent( final int x, final int y, final int wheel )
|
||||||
{
|
{
|
||||||
final Slot slot = this.getSlot( x, y );
|
final Slot slot = this.getSlot( x, y );
|
||||||
if( slot instanceof SlotME )
|
if( slot instanceof SlotME )
|
||||||
@@ -744,22 +743,17 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
if( this.inventorySlots instanceof AEBaseContainer )
|
if( this.inventorySlots instanceof AEBaseContainer )
|
||||||
{
|
{
|
||||||
return ( (AEBaseContainer) this.inventorySlots ).customName != null;
|
return ( (AEBaseContainer) this.inventorySlots ).getCustomName() != null;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getInventoryName()
|
private String getInventoryName()
|
||||||
{
|
{
|
||||||
return ( (AEBaseContainer) this.inventorySlots ).customName;
|
return ( (AEBaseContainer) this.inventorySlots ).getCustomName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a( final Slot s )
|
private void drawSlot( final Slot s )
|
||||||
{
|
|
||||||
this.drawSlot( s );
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawSlot( final Slot s )
|
|
||||||
{
|
{
|
||||||
if( s instanceof SlotME )
|
if( s instanceof SlotME )
|
||||||
{
|
{
|
||||||
@@ -779,13 +773,13 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
this.zLevel = 0.0F;
|
this.zLevel = 0.0F;
|
||||||
itemRender.zLevel = 0.0F;
|
itemRender.zLevel = 0.0F;
|
||||||
|
|
||||||
this.aeRenderItem.aeStack = ( (SlotME) s ).getAEStack();
|
this.aeRenderItem.setAeStack( ( (SlotME) s ).getAEStack() );
|
||||||
|
|
||||||
this.safeDrawSlot( s );
|
this.safeDrawSlot( s );
|
||||||
}
|
}
|
||||||
catch( final Exception err )
|
catch( final Exception err )
|
||||||
{
|
{
|
||||||
AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
|
AELog.warn( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
|
||||||
}
|
}
|
||||||
this.setItemRender( pIR );
|
this.setItemRender( pIR );
|
||||||
return;
|
return;
|
||||||
@@ -841,7 +835,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
if( is != null && s instanceof AppEngSlot )
|
if( is != null && s instanceof AppEngSlot )
|
||||||
{
|
{
|
||||||
if( ( (AppEngSlot) s ).isValid == hasCalculatedValidness.NotAvailable )
|
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.NotAvailable )
|
||||||
{
|
{
|
||||||
boolean isValid = s.isItemValid( is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
|
boolean isValid = s.isItemValid( is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
|
||||||
if( isValid && s instanceof SlotRestrictedInput )
|
if( isValid && s instanceof SlotRestrictedInput )
|
||||||
@@ -852,13 +846,13 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
}
|
}
|
||||||
catch( final Exception err )
|
catch( final Exception err )
|
||||||
{
|
{
|
||||||
AELog.error( err );
|
AELog.debug( err );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
( (AppEngSlot) s ).isValid = isValid ? hasCalculatedValidness.Valid : hasCalculatedValidness.Invalid;
|
( (AppEngSlot) s ).setIsValid( isValid ? hasCalculatedValidness.Valid : hasCalculatedValidness.Invalid );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( (AppEngSlot) s ).isValid == hasCalculatedValidness.Invalid )
|
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.Invalid )
|
||||||
{
|
{
|
||||||
this.zLevel = 100.0F;
|
this.zLevel = 100.0F;
|
||||||
itemRender.zLevel = 100.0F;
|
itemRender.zLevel = 100.0F;
|
||||||
@@ -874,7 +868,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
|
|
||||||
if( s instanceof AppEngSlot )
|
if( s instanceof AppEngSlot )
|
||||||
{
|
{
|
||||||
( (AppEngSlot) s ).isDisplay = true;
|
( (AppEngSlot) s ).setDisplay( true );
|
||||||
this.safeDrawSlot( s );
|
this.safeDrawSlot( s );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -886,7 +880,7 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
}
|
}
|
||||||
catch( final Exception err )
|
catch( final Exception err )
|
||||||
{
|
{
|
||||||
AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
|
AELog.warn( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// do the usual for non-ME Slots.
|
// do the usual for non-ME Slots.
|
||||||
@@ -933,4 +927,29 @@ public abstract class AEBaseGui extends GuiContainer
|
|||||||
{
|
{
|
||||||
this.drawSlot( s );
|
this.drawSlot( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected GuiScrollbar getScrollBar()
|
||||||
|
{
|
||||||
|
return this.scrollBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setScrollBar( final GuiScrollbar myScrollBar )
|
||||||
|
{
|
||||||
|
this.scrollBar = myScrollBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected List<InternalSlotME> getMeSlots()
|
||||||
|
{
|
||||||
|
return this.meSlots;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final synchronized boolean isSwitchingGuis()
|
||||||
|
{
|
||||||
|
return switchingGuis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final synchronized void setSwitchingGuis( final boolean switchingGuis )
|
||||||
|
{
|
||||||
|
AEBaseGui.switchingGuis = switchingGuis;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,19 +47,17 @@ import appeng.util.Platform;
|
|||||||
public class GuiCellWorkbench extends GuiUpgradeable
|
public class GuiCellWorkbench extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerCellWorkbench workbench;
|
private final ContainerCellWorkbench workbench;
|
||||||
final TileCellWorkbench tcw;
|
|
||||||
|
|
||||||
GuiImgButton clear;
|
private GuiImgButton clear;
|
||||||
GuiImgButton partition;
|
private GuiImgButton partition;
|
||||||
GuiToggleButton copyMode;
|
private GuiToggleButton copyMode;
|
||||||
|
|
||||||
public GuiCellWorkbench( final InventoryPlayer inventoryPlayer, final TileCellWorkbench te )
|
public GuiCellWorkbench( final InventoryPlayer inventoryPlayer, final TileCellWorkbench te )
|
||||||
{
|
{
|
||||||
super( new ContainerCellWorkbench( inventoryPlayer, te ) );
|
super( new ContainerCellWorkbench( inventoryPlayer, te ) );
|
||||||
this.workbench = (ContainerCellWorkbench) this.inventorySlots;
|
this.workbench = (ContainerCellWorkbench) this.inventorySlots;
|
||||||
this.ySize = 251;
|
this.ySize = 251;
|
||||||
this.tcw = te;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -135,7 +133,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
|||||||
@Override
|
@Override
|
||||||
protected void handleButtonVisibility()
|
protected void handleButtonVisibility()
|
||||||
{
|
{
|
||||||
this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE );
|
this.copyMode.setState( this.workbench.getCopyMode() == CopyMode.CLEAR_ON_REMOVE );
|
||||||
|
|
||||||
boolean hasFuzzy = false;
|
boolean hasFuzzy = false;
|
||||||
final IInventory inv = this.workbench.getCellUpgradeInventory();
|
final IInventory inv = this.workbench.getCellUpgradeInventory();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import appeng.tile.storage.TileChest;
|
|||||||
public class GuiChest extends AEBaseGui
|
public class GuiChest extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiTabButton priority;
|
private GuiTabButton priority;
|
||||||
|
|
||||||
public GuiChest( final InventoryPlayer inventoryPlayer, final TileChest te )
|
public GuiChest( final InventoryPlayer inventoryPlayer, final TileChest te )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ import appeng.tile.misc.TileCondenser;
|
|||||||
public class GuiCondenser extends AEBaseGui
|
public class GuiCondenser extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerCondenser cvc;
|
private final ContainerCondenser cvc;
|
||||||
GuiProgressBar pb;
|
private GuiProgressBar pb;
|
||||||
GuiImgButton mode;
|
private GuiImgButton mode;
|
||||||
|
|
||||||
public GuiCondenser( final InventoryPlayer inventoryPlayer, final TileCondenser te )
|
public GuiCondenser( final InventoryPlayer inventoryPlayer, final TileCondenser te )
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ public class GuiCondenser extends AEBaseGui
|
|||||||
|
|
||||||
this.pb = new GuiProgressBar( this.cvc, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal() );
|
this.pb = new GuiProgressBar( this.cvc, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal() );
|
||||||
|
|
||||||
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.output );
|
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.getOutput() );
|
||||||
|
|
||||||
this.buttonList.add( this.pb );
|
this.buttonList.add( this.pb );
|
||||||
this.buttonList.add( this.mode );
|
this.buttonList.add( this.mode );
|
||||||
@@ -82,8 +82,8 @@ public class GuiCondenser extends AEBaseGui
|
|||||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||||
|
|
||||||
this.mode.set( this.cvc.output );
|
this.mode.set( this.cvc.getOutput() );
|
||||||
this.mode.fillVar = String.valueOf( this.cvc.output.requiredPower );
|
this.mode.setFillVar( String.valueOf( this.cvc.getOutput().requiredPower ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -58,28 +58,30 @@ import appeng.util.Platform;
|
|||||||
public class GuiCraftConfirm extends AEBaseGui
|
public class GuiCraftConfirm extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerCraftConfirm ccc;
|
private final ContainerCraftConfirm ccc;
|
||||||
|
|
||||||
final int rows = 5;
|
private final int rows = 5;
|
||||||
|
|
||||||
final IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
private final IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||||
final IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
private final IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||||
final IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
|
private final IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
|
||||||
|
|
||||||
final List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
|
private final List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
|
||||||
|
|
||||||
GuiBridge OriginalGui;
|
private GuiBridge OriginalGui;
|
||||||
GuiButton cancel;
|
private GuiButton cancel;
|
||||||
GuiButton start;
|
private GuiButton start;
|
||||||
GuiButton selectCPU;
|
private GuiButton selectCPU;
|
||||||
int tooltip = -1;
|
private int tooltip = -1;
|
||||||
|
|
||||||
public GuiCraftConfirm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
public GuiCraftConfirm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||||
{
|
{
|
||||||
super( new ContainerCraftConfirm( inventoryPlayer, te ) );
|
super( new ContainerCraftConfirm( inventoryPlayer, te ) );
|
||||||
this.xSize = 238;
|
this.xSize = 238;
|
||||||
this.ySize = 206;
|
this.ySize = 206;
|
||||||
this.myScrollBar = new GuiScrollbar();
|
|
||||||
|
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||||
|
this.setScrollBar( scrollbar );
|
||||||
|
|
||||||
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
|
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
|
||||||
|
|
||||||
@@ -106,7 +108,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
|
|
||||||
boolean isAutoStart()
|
boolean isAutoStart()
|
||||||
{
|
{
|
||||||
return ( (ContainerCraftConfirm) this.inventorySlots ).autoStart;
|
return ( (ContainerCraftConfirm) this.inventorySlots ).isAutoStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -135,7 +137,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
{
|
{
|
||||||
this.updateCPUButtonText();
|
this.updateCPUButtonText();
|
||||||
|
|
||||||
this.start.enabled = !( this.ccc.noCPU || this.isSimulation() );
|
this.start.enabled = !( this.ccc.hasNoCPU() || this.isSimulation() );
|
||||||
this.selectCPU.enabled = !this.isSimulation();
|
this.selectCPU.enabled = !this.isSimulation();
|
||||||
|
|
||||||
final int gx = ( this.width - this.xSize ) / 2;
|
final int gx = ( this.width - this.xSize ) / 2;
|
||||||
@@ -175,20 +177,20 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
private void updateCPUButtonText()
|
private void updateCPUButtonText()
|
||||||
{
|
{
|
||||||
String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal();
|
String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal();
|
||||||
if( this.ccc.selectedCpu >= 0 )// && status.selectedCpu < status.cpus.size() )
|
if( this.ccc.getSelectedCpu() >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||||
{
|
{
|
||||||
if( this.ccc.myName.length() > 0 )
|
if( this.ccc.getName().length() > 0 )
|
||||||
{
|
{
|
||||||
final String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) );
|
final String name = this.ccc.getName().substring( 0, Math.min( 20, this.ccc.getName().length() ) );
|
||||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
|
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.selectedCpu;
|
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.getSelectedCpu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.ccc.noCPU )
|
if( this.ccc.hasNoCPU() )
|
||||||
{
|
{
|
||||||
btnTextText = GuiText.NoCraftingCPUs.getLocal();
|
btnTextText = GuiText.NoCraftingCPUs.getLocal();
|
||||||
}
|
}
|
||||||
@@ -196,15 +198,15 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
this.selectCPU.displayString = btnTextText;
|
this.selectCPU.displayString = btnTextText;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isSimulation()
|
private boolean isSimulation()
|
||||||
{
|
{
|
||||||
return ( (ContainerCraftConfirm) this.inventorySlots ).simulation;
|
return ( (ContainerCraftConfirm) this.inventorySlots ).isSimulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||||
{
|
{
|
||||||
final long BytesUsed = this.ccc.bytesUsed;
|
final long BytesUsed = this.ccc.getUsedBytes();
|
||||||
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
|
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
|
||||||
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
|
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
|
||||||
this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
|
this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
|
||||||
@@ -217,7 +219,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
dsp = this.ccc.getCpuAvailableBytes() > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.getCpuAvailableBytes() + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.getCpuCoProcessors() ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
||||||
}
|
}
|
||||||
|
|
||||||
final int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
|
final int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
|
||||||
@@ -229,7 +231,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
int y = 0;
|
int y = 0;
|
||||||
final int xo = 9;
|
final int xo = 9;
|
||||||
final int yo = 22;
|
final int yo = 22;
|
||||||
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
|
final int viewStart = this.getScrollBar().getCurrentScroll() * 3;
|
||||||
final int viewEnd = viewStart + 3 * this.rows;
|
final int viewEnd = viewStart + 3 * this.rows;
|
||||||
|
|
||||||
String dspToolTip = "";
|
String dspToolTip = "";
|
||||||
@@ -381,9 +383,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
|
|
||||||
if( this.tooltip >= 0 && dspToolTip.length() > 0 )
|
if( this.tooltip >= 0 && dspToolTip.length() > 0 )
|
||||||
{
|
{
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
|
||||||
this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip );
|
this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip );
|
||||||
GL11.glPopAttrib();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,8 +399,8 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
{
|
{
|
||||||
final int size = this.visual.size();
|
final int size = this.visual.size();
|
||||||
|
|
||||||
this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 );
|
this.getScrollBar().setTop( 19 ).setLeft( 218 ).setHeight( 114 );
|
||||||
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
|
this.getScrollBar().setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void postUpdate( final List<IAEItemStack> list, final byte ref )
|
public void postUpdate( final List<IAEItemStack> list, final byte ref )
|
||||||
@@ -556,7 +556,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
|||||||
}
|
}
|
||||||
catch( final Throwable e )
|
catch( final Throwable e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
this.craftingCpu = container;
|
this.craftingCpu = container;
|
||||||
this.ySize = GUI_HEIGHT;
|
this.ySize = GUI_HEIGHT;
|
||||||
this.xSize = GUI_WIDTH;
|
this.xSize = GUI_WIDTH;
|
||||||
this.myScrollBar = new GuiScrollbar();
|
|
||||||
|
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||||
|
this.setScrollBar( scrollbar );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearItems()
|
public void clearItems()
|
||||||
@@ -127,7 +129,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,8 +147,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
{
|
{
|
||||||
final int size = this.visual.size();
|
final int size = this.visual.size();
|
||||||
|
|
||||||
this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
|
this.getScrollBar().setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
|
||||||
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
|
this.getScrollBar().setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -193,9 +195,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
{
|
{
|
||||||
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
|
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
|
||||||
|
|
||||||
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() )
|
if( this.craftingCpu.getEstimatedTime() > 0 && !this.visual.isEmpty() )
|
||||||
{
|
{
|
||||||
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.eta, TimeUnit.NANOSECONDS );
|
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.getEstimatedTime(), TimeUnit.NANOSECONDS );
|
||||||
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
|
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
|
||||||
title += " - " + etaTimeText;
|
title += " - " + etaTimeText;
|
||||||
}
|
}
|
||||||
@@ -204,7 +206,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
|
final int viewStart = this.getScrollBar().getCurrentScroll() * 3;
|
||||||
final int viewEnd = viewStart + 3 * 6;
|
final int viewEnd = viewStart + 3 * 6;
|
||||||
|
|
||||||
String dspToolTip = "";
|
String dspToolTip = "";
|
||||||
@@ -332,9 +334,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
|||||||
|
|
||||||
if( this.tooltip >= 0 && dspToolTip.length() > 0 )
|
if( this.tooltip >= 0 && dspToolTip.length() > 0 )
|
||||||
{
|
{
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
|
||||||
this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip );
|
this.drawTooltip( toolPosX, toolPosY + 10, 0, dspToolTip );
|
||||||
GL11.glPopAttrib();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ import appeng.parts.reporting.PartTerminal;
|
|||||||
public class GuiCraftingStatus extends GuiCraftingCPU
|
public class GuiCraftingStatus extends GuiCraftingCPU
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerCraftingStatus status;
|
private final ContainerCraftingStatus status;
|
||||||
GuiButton selectCPU;
|
private GuiButton selectCPU;
|
||||||
|
|
||||||
GuiTabButton originalGuiBtn;
|
private GuiTabButton originalGuiBtn;
|
||||||
GuiBridge originalGui;
|
private GuiBridge originalGui;
|
||||||
ItemStack myIcon = null;
|
private ItemStack myIcon = null;
|
||||||
|
|
||||||
public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||||
{
|
{
|
||||||
@@ -121,7 +121,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
|||||||
if( this.myIcon != null )
|
if( this.myIcon != null )
|
||||||
{
|
{
|
||||||
this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, this.myIcon, this.myIcon.getDisplayName(), itemRender ) );
|
this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, this.myIcon, this.myIcon.getDisplayName(), itemRender ) );
|
||||||
this.originalGuiBtn.hideEdge = 13;
|
this.originalGuiBtn.setHideEdge( 13 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ import appeng.helpers.InventoryAction;
|
|||||||
public class GuiCraftingTerm extends GuiMEMonitorable
|
public class GuiCraftingTerm extends GuiMEMonitorable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiImgButton clearBtn;
|
private GuiImgButton clearBtn;
|
||||||
|
|
||||||
public GuiCraftingTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
public GuiCraftingTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||||
{
|
{
|
||||||
super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) );
|
super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) );
|
||||||
this.reservedSpace = 73;
|
this.setReservedSpace( 73 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -77,14 +77,14 @@ public class GuiCraftingTerm extends GuiMEMonitorable
|
|||||||
{
|
{
|
||||||
super.initGui();
|
super.initGui();
|
||||||
this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) );
|
this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) );
|
||||||
this.clearBtn.halfSize = true;
|
this.clearBtn.setHalfSize( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||||
{
|
{
|
||||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||||
this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 );
|
this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import appeng.tile.storage.TileDrive;
|
|||||||
public class GuiDrive extends AEBaseGui
|
public class GuiDrive extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiTabButton priority;
|
private GuiTabButton priority;
|
||||||
|
|
||||||
public GuiDrive( final InventoryPlayer inventoryPlayer, final TileDrive te )
|
public GuiDrive( final InventoryPlayer inventoryPlayer, final TileDrive te )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ import appeng.parts.automation.PartFormationPlane;
|
|||||||
public class GuiFormationPlane extends GuiUpgradeable
|
public class GuiFormationPlane extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiTabButton priority;
|
private GuiTabButton priority;
|
||||||
GuiImgButton placeMode;
|
private GuiImgButton placeMode;
|
||||||
|
|
||||||
public GuiFormationPlane( final InventoryPlayer inventoryPlayer, final PartFormationPlane te )
|
public GuiFormationPlane( final InventoryPlayer inventoryPlayer, final PartFormationPlane te )
|
||||||
{
|
{
|
||||||
@@ -70,12 +70,12 @@ public class GuiFormationPlane extends GuiUpgradeable
|
|||||||
|
|
||||||
if( this.fuzzyMode != null )
|
if( this.fuzzyMode != null )
|
||||||
{
|
{
|
||||||
this.fuzzyMode.set( this.cvb.fzMode );
|
this.fuzzyMode.set( this.cvb.getFuzzyMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.placeMode != null )
|
if( this.placeMode != null )
|
||||||
{
|
{
|
||||||
this.placeMode.set( ( (ContainerFormationPlane) this.cvb ).placeMode );
|
this.placeMode.set( ( (ContainerFormationPlane) this.cvb ).getPlaceMode() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ import appeng.tile.storage.TileIOPort;
|
|||||||
public class GuiIOPort extends GuiUpgradeable
|
public class GuiIOPort extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiImgButton fullMode;
|
private GuiImgButton fullMode;
|
||||||
GuiImgButton operationMode;
|
private GuiImgButton operationMode;
|
||||||
|
|
||||||
public GuiIOPort( final InventoryPlayer inventoryPlayer, final TileIOPort te )
|
public GuiIOPort( final InventoryPlayer inventoryPlayer, final TileIOPort te )
|
||||||
{
|
{
|
||||||
@@ -71,17 +71,17 @@ public class GuiIOPort extends GuiUpgradeable
|
|||||||
|
|
||||||
if( this.redstoneMode != null )
|
if( this.redstoneMode != null )
|
||||||
{
|
{
|
||||||
this.redstoneMode.set( this.cvb.rsMode );
|
this.redstoneMode.set( this.cvb.getRedStoneMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.operationMode != null )
|
if( this.operationMode != null )
|
||||||
{
|
{
|
||||||
this.operationMode.set( ( (ContainerIOPort) this.cvb ).opMode );
|
this.operationMode.set( ( (ContainerIOPort) this.cvb ).getOperationMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.fullMode != null )
|
if( this.fullMode != null )
|
||||||
{
|
{
|
||||||
this.fullMode.set( ( (ContainerIOPort) this.cvb ).fMode );
|
this.fullMode.set( ( (ContainerIOPort) this.cvb ).getFullMode() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import appeng.tile.misc.TileInscriber;
|
|||||||
public class GuiInscriber extends AEBaseGui
|
public class GuiInscriber extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerInscriber cvc;
|
private final ContainerInscriber cvc;
|
||||||
GuiProgressBar pb;
|
private GuiProgressBar pb;
|
||||||
|
|
||||||
public GuiInscriber( final InventoryPlayer inventoryPlayer, final TileInscriber te )
|
public GuiInscriber( final InventoryPlayer inventoryPlayer, final TileInscriber te )
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,7 @@ public class GuiInscriber extends AEBaseGui
|
|||||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasToolbox()
|
private boolean hasToolbox()
|
||||||
{
|
{
|
||||||
return ( (ContainerUpgradeable) this.inventorySlots ).hasToolbox();
|
return ( (ContainerUpgradeable) this.inventorySlots ).hasToolbox();
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ public class GuiInscriber extends AEBaseGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean drawUpgrades()
|
private boolean drawUpgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ import appeng.helpers.IInterfaceHost;
|
|||||||
public class GuiInterface extends GuiUpgradeable
|
public class GuiInterface extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiTabButton priority;
|
private GuiTabButton priority;
|
||||||
GuiImgButton BlockMode;
|
private GuiImgButton BlockMode;
|
||||||
GuiToggleButton interfaceMode;
|
private GuiToggleButton interfaceMode;
|
||||||
|
|
||||||
public GuiInterface( final InventoryPlayer inventoryPlayer, final IInterfaceHost te )
|
public GuiInterface( final InventoryPlayer inventoryPlayer, final IInterfaceHost te )
|
||||||
{
|
{
|
||||||
@@ -69,12 +69,12 @@ public class GuiInterface extends GuiUpgradeable
|
|||||||
{
|
{
|
||||||
if( this.BlockMode != null )
|
if( this.BlockMode != null )
|
||||||
{
|
{
|
||||||
this.BlockMode.set( ( (ContainerInterface) this.cvb ).bMode );
|
this.BlockMode.set( ( (ContainerInterface) this.cvb ).getBlockingMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.interfaceMode != null )
|
if( this.interfaceMode != null )
|
||||||
{
|
{
|
||||||
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).iTermMode == YesNo.YES );
|
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).getInterfaceTerminalMode() == YesNo.YES );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
private static final int LINES_ON_PAGE = 6;
|
private static final int LINES_ON_PAGE = 6;
|
||||||
|
|
||||||
// TODO: copied from GuiMEMonitorable. It looks not changed, maybe unneeded?
|
// TODO: copied from GuiMEMonitorable. It looks not changed, maybe unneeded?
|
||||||
final int offsetX = 9;
|
private final int offsetX = 9;
|
||||||
|
|
||||||
private final HashMap<Long, ClientDCInternalInv> byId = new HashMap<Long, ClientDCInternalInv>();
|
private final HashMap<Long, ClientDCInternalInv> byId = new HashMap<Long, ClientDCInternalInv>();
|
||||||
private final HashMultimap<String, ClientDCInternalInv> byName = HashMultimap.create();
|
private final HashMultimap<String, ClientDCInternalInv> byName = HashMultimap.create();
|
||||||
@@ -70,7 +70,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
public GuiInterfaceTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te )
|
public GuiInterfaceTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te )
|
||||||
{
|
{
|
||||||
super( new ContainerInterfaceTerminal( inventoryPlayer, te ) );
|
super( new ContainerInterfaceTerminal( inventoryPlayer, te ) );
|
||||||
this.myScrollBar = new GuiScrollbar();
|
|
||||||
|
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||||
|
this.setScrollBar( scrollbar );
|
||||||
this.xSize = 195;
|
this.xSize = 195;
|
||||||
this.ySize = 222;
|
this.ySize = 222;
|
||||||
}
|
}
|
||||||
@@ -80,9 +82,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
{
|
{
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
this.myScrollBar.setLeft( 175 );
|
this.getScrollBar().setLeft( 175 );
|
||||||
this.myScrollBar.setHeight( 106 );
|
this.getScrollBar().setHeight( 106 );
|
||||||
this.myScrollBar.setTop( 18 );
|
this.getScrollBar().setTop( 18 );
|
||||||
|
|
||||||
this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 );
|
this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 );
|
||||||
this.searchField.setEnableBackgroundDrawing( false );
|
this.searchField.setEnableBackgroundDrawing( false );
|
||||||
@@ -98,7 +100,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||||
|
|
||||||
final int ex = this.myScrollBar.getCurrentScroll();
|
final int ex = this.getScrollBar().getCurrentScroll();
|
||||||
|
|
||||||
final Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
|
final Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
|
||||||
while( o.hasNext() )
|
while( o.hasNext() )
|
||||||
@@ -116,7 +118,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
if( lineObj instanceof ClientDCInternalInv )
|
if( lineObj instanceof ClientDCInternalInv )
|
||||||
{
|
{
|
||||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||||
for( int z = 0; z < inv.inv.getSizeInventory(); z++ )
|
for( int z = 0; z < inv.getInventory().getSizeInventory(); z++ )
|
||||||
{
|
{
|
||||||
this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) );
|
this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) );
|
||||||
}
|
}
|
||||||
@@ -162,7 +164,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||||
|
|
||||||
int offset = 17;
|
int offset = 17;
|
||||||
final int ex = this.myScrollBar.getCurrentScroll();
|
final int ex = this.getScrollBar().getCurrentScroll();
|
||||||
|
|
||||||
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
|
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
|
||||||
{
|
{
|
||||||
@@ -172,7 +174,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||||
|
|
||||||
GL11.glColor4f( 1, 1, 1, 1 );
|
GL11.glColor4f( 1, 1, 1, 1 );
|
||||||
final int width = inv.inv.getSizeInventory() * 18;
|
final int width = inv.getInventory().getSizeInventory() * 18;
|
||||||
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
|
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
|
||||||
}
|
}
|
||||||
offset += 18;
|
offset += 18;
|
||||||
@@ -224,12 +226,12 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
final NBTTagCompound invData = in.getCompoundTag( key );
|
final NBTTagCompound invData = in.getCompoundTag( key );
|
||||||
final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
|
final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
|
||||||
|
|
||||||
for( int x = 0; x < current.inv.getSizeInventory(); x++ )
|
for( int x = 0; x < current.getInventory().getSizeInventory(); x++ )
|
||||||
{
|
{
|
||||||
final String which = Integer.toString( x );
|
final String which = Integer.toString( x );
|
||||||
if( invData.hasKey( which ) )
|
if( invData.hasKey( which ) )
|
||||||
{
|
{
|
||||||
current.inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) );
|
current.getInventory().setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,7 +278,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
// Search if the current inventory holds a pattern containing the search term.
|
// Search if the current inventory holds a pattern containing the search term.
|
||||||
if( !found && !searchFilterLowerCase.isEmpty() )
|
if( !found && !searchFilterLowerCase.isEmpty() )
|
||||||
{
|
{
|
||||||
for( final ItemStack itemStack : entry.inv )
|
for( final ItemStack itemStack : entry.getInventory() )
|
||||||
{
|
{
|
||||||
found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase );
|
found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase );
|
||||||
if( found )
|
if( found )
|
||||||
@@ -317,7 +319,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
|||||||
this.lines.addAll( clientInventories );
|
this.lines.addAll( clientInventories );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.myScrollBar.setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 );
|
this.getScrollBar().setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm )
|
private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm )
|
||||||
|
|||||||
@@ -47,19 +47,19 @@ import appeng.parts.automation.PartLevelEmitter;
|
|||||||
public class GuiLevelEmitter extends GuiUpgradeable
|
public class GuiLevelEmitter extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiNumberBox level;
|
private GuiNumberBox level;
|
||||||
|
|
||||||
GuiButton plus1;
|
private GuiButton plus1;
|
||||||
GuiButton plus10;
|
private GuiButton plus10;
|
||||||
GuiButton plus100;
|
private GuiButton plus100;
|
||||||
GuiButton plus1000;
|
private GuiButton plus1000;
|
||||||
GuiButton minus1;
|
private GuiButton minus1;
|
||||||
GuiButton minus10;
|
private GuiButton minus10;
|
||||||
GuiButton minus100;
|
private GuiButton minus100;
|
||||||
GuiButton minus1000;
|
private GuiButton minus1000;
|
||||||
|
|
||||||
GuiImgButton levelMode;
|
private GuiImgButton levelMode;
|
||||||
GuiImgButton craftingMode;
|
private GuiImgButton craftingMode;
|
||||||
|
|
||||||
public GuiLevelEmitter( final InventoryPlayer inventoryPlayer, final PartLevelEmitter te )
|
public GuiLevelEmitter( final InventoryPlayer inventoryPlayer, final PartLevelEmitter te )
|
||||||
{
|
{
|
||||||
@@ -131,12 +131,12 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
|||||||
|
|
||||||
if( this.craftingMode != null )
|
if( this.craftingMode != null )
|
||||||
{
|
{
|
||||||
this.craftingMode.set( ( (ContainerLevelEmitter) this.cvb ).cmType );
|
this.craftingMode.set( ( (ContainerLevelEmitter) this.cvb ).getCraftingMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.levelMode != null )
|
if( this.levelMode != null )
|
||||||
{
|
{
|
||||||
this.levelMode.set( ( (ContainerLevelEmitter) this.cvb ).lvType );
|
this.levelMode.set( ( (ContainerLevelEmitter) this.cvb ).getLevelMode() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ import appeng.tile.crafting.TileMolecularAssembler;
|
|||||||
public class GuiMAC extends GuiUpgradeable
|
public class GuiMAC extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerMAC container;
|
private final ContainerMAC container;
|
||||||
GuiProgressBar pb;
|
private GuiProgressBar pb;
|
||||||
|
|
||||||
public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te )
|
public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,30 +71,31 @@ import appeng.util.Platform;
|
|||||||
public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfigManagerHost
|
public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfigManagerHost
|
||||||
{
|
{
|
||||||
|
|
||||||
public static int CraftingGridOffsetX;
|
public static int craftingGridOffsetX;
|
||||||
public static int CraftingGridOffsetY;
|
public static int craftingGridOffsetY;
|
||||||
|
|
||||||
private static String memoryText = "";
|
private static String memoryText = "";
|
||||||
final ItemRepo repo;
|
private final ItemRepo repo;
|
||||||
final int offsetX = 9;
|
private final int offsetX = 9;
|
||||||
final int lowerTextureOffset = 0;
|
private final int lowerTextureOffset = 0;
|
||||||
final IConfigManager configSrc;
|
private final IConfigManager configSrc;
|
||||||
final boolean viewCell;
|
private final boolean viewCell;
|
||||||
final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||||
final ContainerMEMonitorable monitorableContainer;
|
private final ContainerMEMonitorable monitorableContainer;
|
||||||
GuiTabButton craftingStatusBtn;
|
private GuiTabButton craftingStatusBtn;
|
||||||
MEGuiTextField searchField;
|
private MEGuiTextField searchField;
|
||||||
GuiText myName;
|
private GuiText myName;
|
||||||
int perRow = 9;
|
private int perRow = 9;
|
||||||
int reservedSpace = 0;
|
private int reservedSpace = 0;
|
||||||
boolean customSortOrder = true;
|
private boolean customSortOrder = true;
|
||||||
int rows = 0;
|
private int rows = 0;
|
||||||
int maxRows = Integer.MAX_VALUE;
|
private int maxRows = Integer.MAX_VALUE;
|
||||||
int standardSize;
|
private int standardSize;
|
||||||
GuiImgButton ViewBox;
|
private GuiImgButton ViewBox;
|
||||||
GuiImgButton SortByBox;
|
private GuiImgButton SortByBox;
|
||||||
GuiImgButton SortDirBox;
|
private GuiImgButton SortDirBox;
|
||||||
GuiImgButton searchBoxSettings;
|
private GuiImgButton searchBoxSettings;
|
||||||
GuiImgButton terminalStyleBox;
|
private GuiImgButton terminalStyleBox;
|
||||||
|
|
||||||
public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||||
{
|
{
|
||||||
@@ -105,8 +106,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
{
|
{
|
||||||
|
|
||||||
super( c );
|
super( c );
|
||||||
this.myScrollBar = new GuiScrollbar();
|
|
||||||
this.repo = new ItemRepo( this.myScrollBar, this );
|
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||||
|
this.setScrollBar( scrollbar );
|
||||||
|
this.repo = new ItemRepo( scrollbar, this );
|
||||||
|
|
||||||
this.xSize = 185;
|
this.xSize = 185;
|
||||||
this.ySize = 204;
|
this.ySize = 204;
|
||||||
@@ -119,7 +122,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
this.standardSize = this.xSize;
|
this.standardSize = this.xSize;
|
||||||
|
|
||||||
this.configSrc = ( (IConfigurableObject) this.inventorySlots ).getConfigManager();
|
this.configSrc = ( (IConfigurableObject) this.inventorySlots ).getConfigManager();
|
||||||
( this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots ).gui = this;
|
( this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots ).setGui( this );
|
||||||
|
|
||||||
this.viewCell = te instanceof IViewCellStorage;
|
this.viewCell = te instanceof IViewCellStorage;
|
||||||
|
|
||||||
@@ -158,8 +161,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
|
|
||||||
private void setScrollBar()
|
private void setScrollBar()
|
||||||
{
|
{
|
||||||
this.myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( this.rows * 18 - 2 );
|
this.getScrollBar().setTop( 18 ).setLeft( 175 ).setHeight( this.rows * 18 - 2 );
|
||||||
this.myScrollBar.setRange( 0, ( this.repo.size() + this.perRow - 1 ) / this.perRow - this.rows, Math.max( 1, this.rows / 6 ) );
|
this.getScrollBar().setRange( 0, ( this.repo.size() + this.perRow - 1 ) / this.perRow - this.rows, Math.max( 1, this.rows / 6 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -196,7 +199,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,13 +207,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
|
|
||||||
if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
|
if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
|
||||||
{
|
{
|
||||||
this.re_init();
|
this.reinitalize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void re_init()
|
private void reinitalize()
|
||||||
{
|
{
|
||||||
this.buttonList.clear();
|
this.buttonList.clear();
|
||||||
this.initGui();
|
this.initGui();
|
||||||
@@ -249,12 +252,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
this.rows = 3;
|
this.rows = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.meSlots.clear();
|
this.getMeSlots().clear();
|
||||||
for( int y = 0; y < this.rows; y++ )
|
for( int y = 0; y < this.rows; y++ )
|
||||||
{
|
{
|
||||||
for( int x = 0; x < this.perRow; x++ )
|
for( int x = 0; x < this.perRow; x++ )
|
||||||
{
|
{
|
||||||
this.meSlots.add( new InternalSlotME( this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18 ) );
|
this.getMeSlots().add( new InternalSlotME( this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +314,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
if( this.viewCell || this instanceof GuiWirelessTerm )
|
if( this.viewCell || this instanceof GuiWirelessTerm )
|
||||||
{
|
{
|
||||||
this.buttonList.add( this.craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus.getLocal(), itemRender ) );
|
this.buttonList.add( this.craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus.getLocal(), itemRender ) );
|
||||||
this.craftingStatusBtn.hideEdge = 13;
|
this.craftingStatusBtn.setHideEdge( 13 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
||||||
@@ -321,13 +324,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
if( this.isSubGui() )
|
if( this.isSubGui() )
|
||||||
{
|
{
|
||||||
this.searchField.setText( memoryText );
|
this.searchField.setText( memoryText );
|
||||||
this.repo.searchString = memoryText;
|
this.repo.setSearchString( memoryText );
|
||||||
this.repo.updateView();
|
this.repo.updateView();
|
||||||
this.setScrollBar();
|
this.setScrollBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
CraftingGridOffsetX = Integer.MAX_VALUE;
|
craftingGridOffsetX = Integer.MAX_VALUE;
|
||||||
CraftingGridOffsetY = Integer.MAX_VALUE;
|
craftingGridOffsetY = Integer.MAX_VALUE;
|
||||||
|
|
||||||
for( final Object s : this.inventorySlots.inventorySlots )
|
for( final Object s : this.inventorySlots.inventorySlots )
|
||||||
{
|
{
|
||||||
@@ -344,14 +347,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
final Slot g = (Slot) s;
|
final Slot g = (Slot) s;
|
||||||
if( g.xDisplayPosition > 0 && g.yDisplayPosition > 0 )
|
if( g.xDisplayPosition > 0 && g.yDisplayPosition > 0 )
|
||||||
{
|
{
|
||||||
CraftingGridOffsetX = Math.min( CraftingGridOffsetX, g.xDisplayPosition );
|
craftingGridOffsetX = Math.min( craftingGridOffsetX, g.xDisplayPosition );
|
||||||
CraftingGridOffsetY = Math.min( CraftingGridOffsetY, g.yDisplayPosition );
|
craftingGridOffsetY = Math.min( craftingGridOffsetY, g.yDisplayPosition );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CraftingGridOffsetX -= 25;
|
craftingGridOffsetX -= 25;
|
||||||
CraftingGridOffsetY -= 6;
|
craftingGridOffsetY -= 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -374,7 +377,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
if( btn == 1 && this.searchField.isMouseIn( xCoord, yCoord ) )
|
if( btn == 1 && this.searchField.isMouseIn( xCoord, yCoord ) )
|
||||||
{
|
{
|
||||||
this.searchField.setText( "" );
|
this.searchField.setText( "" );
|
||||||
this.repo.searchString = "";
|
this.repo.setSearchString( "" );
|
||||||
this.repo.updateView();
|
this.repo.updateView();
|
||||||
this.setScrollBar();
|
this.setScrollBar();
|
||||||
}
|
}
|
||||||
@@ -416,10 +419,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
|
|
||||||
for( int i = 0; i < 5; i++ )
|
for( int i = 0; i < 5; i++ )
|
||||||
{
|
{
|
||||||
if( this.myCurrentViewCells[i] != this.monitorableContainer.cellView[i].getStack() )
|
if( this.myCurrentViewCells[i] != this.monitorableContainer.getCellViewSlot( i ).getStack() )
|
||||||
{
|
{
|
||||||
update = true;
|
update = true;
|
||||||
this.myCurrentViewCells[i] = this.monitorableContainer.cellView[i].getStack();
|
this.myCurrentViewCells[i] = this.monitorableContainer.getCellViewSlot( i ).getStack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,7 +456,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
|
|
||||||
protected void repositionSlot( final AppEngSlot s )
|
protected void repositionSlot( final AppEngSlot s )
|
||||||
{
|
{
|
||||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
|
s.yDisplayPosition = s.getY() + this.ySize - 78 - 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -468,7 +471,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
|
|
||||||
if( this.searchField.textboxKeyTyped( character, key ) )
|
if( this.searchField.textboxKeyTyped( character, key ) )
|
||||||
{
|
{
|
||||||
this.repo.searchString = this.searchField.getText();
|
this.repo.setSearchString( this.searchField.getText() );
|
||||||
this.repo.updateView();
|
this.repo.updateView();
|
||||||
this.setScrollBar();
|
this.setScrollBar();
|
||||||
}
|
}
|
||||||
@@ -482,7 +485,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
@Override
|
@Override
|
||||||
public void updateScreen()
|
public void updateScreen()
|
||||||
{
|
{
|
||||||
this.repo.setPower( this.monitorableContainer.hasPower );
|
this.repo.setPower( this.monitorableContainer.isPowered() );
|
||||||
super.updateScreen();
|
super.updateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,4 +527,34 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||||||
|
|
||||||
this.repo.updateView();
|
this.repo.updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getReservedSpace()
|
||||||
|
{
|
||||||
|
return this.reservedSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setReservedSpace( final int reservedSpace )
|
||||||
|
{
|
||||||
|
this.reservedSpace = reservedSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCustomSortOrder()
|
||||||
|
{
|
||||||
|
return this.customSortOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCustomSortOrder( final boolean customSortOrder )
|
||||||
|
{
|
||||||
|
this.customSortOrder = customSortOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStandardSize()
|
||||||
|
{
|
||||||
|
return this.standardSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setStandardSize( final int standardSize )
|
||||||
|
{
|
||||||
|
this.standardSize = standardSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,19 +50,21 @@ import appeng.util.Platform;
|
|||||||
public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||||
{
|
{
|
||||||
|
|
||||||
final ItemRepo repo;
|
private final ItemRepo repo;
|
||||||
final int rows = 4;
|
private final int rows = 4;
|
||||||
GuiImgButton units;
|
private GuiImgButton units;
|
||||||
int tooltip = -1;
|
private int tooltip = -1;
|
||||||
|
|
||||||
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te )
|
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te )
|
||||||
{
|
{
|
||||||
super( new ContainerNetworkStatus( inventoryPlayer, te ) );
|
super( new ContainerNetworkStatus( inventoryPlayer, te ) );
|
||||||
|
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||||
|
|
||||||
|
this.setScrollBar( scrollbar );
|
||||||
|
this.repo = new ItemRepo( scrollbar, this );
|
||||||
this.ySize = 153;
|
this.ySize = 153;
|
||||||
this.xSize = 195;
|
this.xSize = 195;
|
||||||
this.myScrollBar = new GuiScrollbar();
|
this.repo.setRowSize( 5 );
|
||||||
this.repo = new ItemRepo( this.myScrollBar, this );
|
|
||||||
this.repo.rowSize = 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -132,11 +134,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
|||||||
|
|
||||||
this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
|
||||||
|
|
||||||
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.currentPower, false ), 13, 16, 4210752 );
|
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.getCurrentPower(), false ), 13, 16, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.maxPower, false ), 13, 26, 4210752 );
|
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.getMaxPower(), false ), 13, 26, 4210752 );
|
||||||
|
|
||||||
this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 );
|
this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.getAverageAddition(), true ), 13, 143 - 10, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 );
|
this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.getPowerUsage(), true ), 13, 143 - 20, 4210752 );
|
||||||
|
|
||||||
final int sectionLength = 30;
|
final int sectionLength = 30;
|
||||||
|
|
||||||
@@ -200,9 +202,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
|||||||
|
|
||||||
if( this.tooltip >= 0 && toolTip.length() > 0 )
|
if( this.tooltip >= 0 && toolTip.length() > 0 )
|
||||||
{
|
{
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
|
||||||
this.drawTooltip( toolPosX, toolPosY + 10, 0, toolTip );
|
this.drawTooltip( toolPosX, toolPosY + 10, 0, toolTip );
|
||||||
GL11.glPopAttrib();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +229,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
|||||||
private void setScrollBar()
|
private void setScrollBar()
|
||||||
{
|
{
|
||||||
final int size = this.repo.size();
|
final int size = this.repo.size();
|
||||||
this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 );
|
this.getScrollBar().setTop( 39 ).setLeft( 175 ).setHeight( 78 );
|
||||||
this.myScrollBar.setRange( 0, ( size + 4 ) / 5 - this.rows, 1 );
|
this.getScrollBar().setRange( 0, ( size + 4 ) / 5 - this.rows, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override - NEI
|
// @Override - NEI
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import appeng.core.sync.packets.PacketValueConfig;
|
|||||||
public class GuiNetworkTool extends AEBaseGui
|
public class GuiNetworkTool extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiToggleButton tFacades;
|
private GuiToggleButton tFacades;
|
||||||
|
|
||||||
public GuiNetworkTool( final InventoryPlayer inventoryPlayer, final INetworkTool te )
|
public GuiNetworkTool( final InventoryPlayer inventoryPlayer, final INetworkTool te )
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ public class GuiNetworkTool extends AEBaseGui
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public class GuiNetworkTool extends AEBaseGui
|
|||||||
{
|
{
|
||||||
if( this.tFacades != null )
|
if( this.tFacades != null )
|
||||||
{
|
{
|
||||||
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).facadeMode );
|
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).isFacadeMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
|||||||
{
|
{
|
||||||
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
|
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
|
||||||
this.container = (ContainerPatternTerm) this.inventorySlots;
|
this.container = (ContainerPatternTerm) this.inventorySlots;
|
||||||
this.reservedSpace = 81;
|
this.setReservedSpace( 81 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -110,15 +110,15 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
|||||||
this.buttonList.add( this.tabProcessButton );
|
this.buttonList.add( this.tabProcessButton );
|
||||||
|
|
||||||
this.substitutionsEnabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED );
|
this.substitutionsEnabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED );
|
||||||
this.substitutionsEnabledBtn.halfSize = true;
|
this.substitutionsEnabledBtn.setHalfSize( true );
|
||||||
this.buttonList.add( this.substitutionsEnabledBtn );
|
this.buttonList.add( this.substitutionsEnabledBtn );
|
||||||
|
|
||||||
this.substitutionsDisabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED );
|
this.substitutionsDisabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED );
|
||||||
this.substitutionsDisabledBtn.halfSize = true;
|
this.substitutionsDisabledBtn.setHalfSize( true );
|
||||||
this.buttonList.add( this.substitutionsDisabledBtn );
|
this.buttonList.add( this.substitutionsDisabledBtn );
|
||||||
|
|
||||||
this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE );
|
this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE );
|
||||||
this.clearBtn.halfSize = true;
|
this.clearBtn.setHalfSize( true );
|
||||||
this.buttonList.add( this.clearBtn );
|
this.buttonList.add( this.clearBtn );
|
||||||
|
|
||||||
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
|
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
|
||||||
@@ -128,7 +128,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
|||||||
@Override
|
@Override
|
||||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||||
{
|
{
|
||||||
if( !this.container.craftingMode )
|
if( !this.container.isCraftingMode() )
|
||||||
{
|
{
|
||||||
this.tabCraftButton.visible = false;
|
this.tabCraftButton.visible = false;
|
||||||
this.tabProcessButton.visible = true;
|
this.tabProcessButton.visible = true;
|
||||||
@@ -151,13 +151,13 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
|||||||
}
|
}
|
||||||
|
|
||||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||||
this.fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.reservedSpace, 4210752 );
|
this.fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.getReservedSpace(), 4210752 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBackground()
|
protected String getBackground()
|
||||||
{
|
{
|
||||||
if( this.container.craftingMode )
|
if( this.container.isCraftingMode() )
|
||||||
{
|
{
|
||||||
return "guis/pattern.png";
|
return "guis/pattern.png";
|
||||||
}
|
}
|
||||||
@@ -169,11 +169,11 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
|||||||
{
|
{
|
||||||
if( s.isPlayerSide() )
|
if( s.isPlayerSide() )
|
||||||
{
|
{
|
||||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
|
s.yDisplayPosition = s.getY() + this.ySize - 78 - 5;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 3;
|
s.yDisplayPosition = s.getY() + this.ySize - 78 - 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,19 +53,19 @@ import appeng.tile.storage.TileDrive;
|
|||||||
public class GuiPriority extends AEBaseGui
|
public class GuiPriority extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiNumberBox priority;
|
private GuiNumberBox priority;
|
||||||
GuiTabButton originalGuiBtn;
|
private GuiTabButton originalGuiBtn;
|
||||||
|
|
||||||
GuiButton plus1;
|
private GuiButton plus1;
|
||||||
GuiButton plus10;
|
private GuiButton plus10;
|
||||||
GuiButton plus100;
|
private GuiButton plus100;
|
||||||
GuiButton plus1000;
|
private GuiButton plus1000;
|
||||||
GuiButton minus1;
|
private GuiButton minus1;
|
||||||
GuiButton minus10;
|
private GuiButton minus10;
|
||||||
GuiButton minus100;
|
private GuiButton minus100;
|
||||||
GuiButton minus1000;
|
private GuiButton minus1000;
|
||||||
|
|
||||||
GuiBridge OriginalGui;
|
private GuiBridge OriginalGui;
|
||||||
|
|
||||||
public GuiPriority( final InventoryPlayer inventoryPlayer, final IPriorityHost te )
|
public GuiPriority( final InventoryPlayer inventoryPlayer, final IPriorityHost te )
|
||||||
{
|
{
|
||||||
@@ -240,7 +240,7 @@ public class GuiPriority extends AEBaseGui
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ public class GuiPriority extends AEBaseGui
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import appeng.items.contents.QuartzKnifeObj;
|
|||||||
public class GuiQuartzKnife extends AEBaseGui
|
public class GuiQuartzKnife extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiTextField name;
|
private GuiTextField name;
|
||||||
|
|
||||||
public GuiQuartzKnife( final InventoryPlayer inventoryPlayer, final QuartzKnifeObj te )
|
public GuiQuartzKnife( final InventoryPlayer inventoryPlayer, final QuartzKnifeObj te )
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ public class GuiQuartzKnife extends AEBaseGui
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -37,21 +37,21 @@ import appeng.core.sync.packets.PacketValueConfig;
|
|||||||
public class GuiSecurity extends GuiMEMonitorable
|
public class GuiSecurity extends GuiMEMonitorable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiToggleButton inject;
|
private GuiToggleButton inject;
|
||||||
GuiToggleButton extract;
|
private GuiToggleButton extract;
|
||||||
GuiToggleButton craft;
|
private GuiToggleButton craft;
|
||||||
GuiToggleButton build;
|
private GuiToggleButton build;
|
||||||
GuiToggleButton security;
|
private GuiToggleButton security;
|
||||||
|
|
||||||
public GuiSecurity( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
public GuiSecurity( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||||
{
|
{
|
||||||
super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) );
|
super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) );
|
||||||
this.customSortOrder = false;
|
this.setCustomSortOrder( false );
|
||||||
this.reservedSpace = 33;
|
this.setReservedSpace( 33 );
|
||||||
|
|
||||||
// increase size so that the slot is over the gui.
|
// increase size so that the slot is over the gui.
|
||||||
this.xSize += 56;
|
this.xSize += 56;
|
||||||
this.standardSize = this.xSize;
|
this.setStandardSize( this.xSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -90,7 +90,7 @@ public class GuiSecurity extends GuiMEMonitorable
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class GuiSecurity extends GuiMEMonitorable
|
|||||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||||
{
|
{
|
||||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||||
this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 );
|
this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -124,11 +124,11 @@ public class GuiSecurity extends GuiMEMonitorable
|
|||||||
{
|
{
|
||||||
final ContainerSecurity cs = (ContainerSecurity) this.inventorySlots;
|
final ContainerSecurity cs = (ContainerSecurity) this.inventorySlots;
|
||||||
|
|
||||||
this.inject.setState( ( cs.security & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
|
this.inject.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
|
||||||
this.extract.setState( ( cs.security & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
|
this.extract.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
|
||||||
this.craft.setState( ( cs.security & ( 1 << SecurityPermissions.CRAFT.ordinal() ) ) > 0 );
|
this.craft.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.CRAFT.ordinal() ) ) > 0 );
|
||||||
this.build.setState( ( cs.security & ( 1 << SecurityPermissions.BUILD.ordinal() ) ) > 0 );
|
this.build.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.BUILD.ordinal() ) ) > 0 );
|
||||||
this.security.setState( ( cs.security & ( 1 << SecurityPermissions.SECURITY.ordinal() ) ) > 0 );
|
this.security.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.SECURITY.ordinal() ) ) > 0 );
|
||||||
|
|
||||||
return "guis/security.png";
|
return "guis/security.png";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ import appeng.util.Platform;
|
|||||||
public class GuiSpatialIOPort extends AEBaseGui
|
public class GuiSpatialIOPort extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerSpatialIOPort container;
|
private final ContainerSpatialIOPort container;
|
||||||
GuiImgButton units;
|
private GuiImgButton units;
|
||||||
|
|
||||||
public GuiSpatialIOPort( final InventoryPlayer inventoryPlayer, final TileSpatialIOPort te )
|
public GuiSpatialIOPort( final InventoryPlayer inventoryPlayer, final TileSpatialIOPort te )
|
||||||
{
|
{
|
||||||
@@ -73,10 +73,10 @@ public class GuiSpatialIOPort extends AEBaseGui
|
|||||||
@Override
|
@Override
|
||||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.currentPower, false ), 13, 21, 4210752 );
|
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getCurrentPower(), false ), 13, 21, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.maxPower, false ), 13, 31, 4210752 );
|
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getMaxPower(), false ), 13, 31, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.reqPower, false ), 13, 78, 4210752 );
|
this.fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getRequiredPower(), false ), 13, 78, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + ( ( (float) this.container.eff ) / 100 ) + '%', 13, 88, 4210752 );
|
this.fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + ( ( (float) this.container.getEfficency() ) / 100 ) + '%', 13, 88, 4210752 );
|
||||||
|
|
||||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 );
|
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 );
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ import appeng.parts.misc.PartStorageBus;
|
|||||||
public class GuiStorageBus extends GuiUpgradeable
|
public class GuiStorageBus extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiImgButton rwMode;
|
private GuiImgButton rwMode;
|
||||||
GuiImgButton storageFilter;
|
private GuiImgButton storageFilter;
|
||||||
GuiTabButton priority;
|
private GuiTabButton priority;
|
||||||
GuiImgButton partition;
|
private GuiImgButton partition;
|
||||||
GuiImgButton clear;
|
private GuiImgButton clear;
|
||||||
|
|
||||||
public GuiStorageBus( final InventoryPlayer inventoryPlayer, final PartStorageBus te )
|
public GuiStorageBus( final InventoryPlayer inventoryPlayer, final PartStorageBus te )
|
||||||
{
|
{
|
||||||
@@ -85,17 +85,17 @@ public class GuiStorageBus extends GuiUpgradeable
|
|||||||
|
|
||||||
if( this.fuzzyMode != null )
|
if( this.fuzzyMode != null )
|
||||||
{
|
{
|
||||||
this.fuzzyMode.set( this.cvb.fzMode );
|
this.fuzzyMode.set( this.cvb.getFuzzyMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.storageFilter != null )
|
if( this.storageFilter != null )
|
||||||
{
|
{
|
||||||
this.storageFilter.set( ( (ContainerStorageBus) this.cvb ).storageFilter );
|
this.storageFilter.set( ( (ContainerStorageBus) this.cvb ).getStorageFilter() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.rwMode != null )
|
if( this.rwMode != null )
|
||||||
{
|
{
|
||||||
this.rwMode.set( ( (ContainerStorageBus) this.cvb ).rwMode );
|
this.rwMode.set( ( (ContainerStorageBus) this.cvb ).getReadWriteMode() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ public class GuiStorageBus extends GuiUpgradeable
|
|||||||
}
|
}
|
||||||
catch( final IOException e )
|
catch( final IOException e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,13 +44,13 @@ import appeng.parts.automation.PartImportBus;
|
|||||||
public class GuiUpgradeable extends AEBaseGui
|
public class GuiUpgradeable extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerUpgradeable cvb;
|
protected final ContainerUpgradeable cvb;
|
||||||
final IUpgradeableHost bc;
|
protected final IUpgradeableHost bc;
|
||||||
|
|
||||||
GuiImgButton redstoneMode;
|
protected GuiImgButton redstoneMode;
|
||||||
GuiImgButton fuzzyMode;
|
protected GuiImgButton fuzzyMode;
|
||||||
GuiImgButton craftMode;
|
protected GuiImgButton craftMode;
|
||||||
GuiImgButton schedulingMode;
|
protected GuiImgButton schedulingMode;
|
||||||
|
|
||||||
public GuiUpgradeable( final InventoryPlayer inventoryPlayer, final IUpgradeableHost te )
|
public GuiUpgradeable( final InventoryPlayer inventoryPlayer, final IUpgradeableHost te )
|
||||||
{
|
{
|
||||||
@@ -100,22 +100,22 @@ public class GuiUpgradeable extends AEBaseGui
|
|||||||
|
|
||||||
if( this.redstoneMode != null )
|
if( this.redstoneMode != null )
|
||||||
{
|
{
|
||||||
this.redstoneMode.set( this.cvb.rsMode );
|
this.redstoneMode.set( this.cvb.getRedStoneMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.fuzzyMode != null )
|
if( this.fuzzyMode != null )
|
||||||
{
|
{
|
||||||
this.fuzzyMode.set( this.cvb.fzMode );
|
this.fuzzyMode.set( this.cvb.getFuzzyMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.craftMode != null )
|
if( this.craftMode != null )
|
||||||
{
|
{
|
||||||
this.craftMode.set( this.cvb.cMode );
|
this.craftMode.set( this.cvb.getCraftingMode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.schedulingMode != null )
|
if( this.schedulingMode != null )
|
||||||
{
|
{
|
||||||
this.schedulingMode.set( this.cvb.schedulingMode );
|
this.schedulingMode.set( this.cvb.getSchedulingMode() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ import appeng.tile.misc.TileVibrationChamber;
|
|||||||
public class GuiVibrationChamber extends AEBaseGui
|
public class GuiVibrationChamber extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
final ContainerVibrationChamber cvc;
|
private final ContainerVibrationChamber cvc;
|
||||||
GuiProgressBar pb;
|
private GuiProgressBar pb;
|
||||||
|
|
||||||
public GuiVibrationChamber( final InventoryPlayer inventoryPlayer, final TileVibrationChamber te )
|
public GuiVibrationChamber( final InventoryPlayer inventoryPlayer, final TileVibrationChamber te )
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ public class GuiVibrationChamber extends AEBaseGui
|
|||||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
|
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
|
||||||
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||||
|
|
||||||
this.pb.setFullMsg( this.cvc.aePerTick * this.cvc.getCurrentProgress() / 100 + " AE/t" );
|
this.pb.setFullMsg( this.cvc.getAePerTick() * this.cvc.getCurrentProgress() / 100 + " AE/t" );
|
||||||
|
|
||||||
if( this.cvc.getCurrentProgress() > 0 )
|
if( this.cvc.getCurrentProgress() > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import appeng.util.Platform;
|
|||||||
public class GuiWireless extends AEBaseGui
|
public class GuiWireless extends AEBaseGui
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiImgButton units;
|
private GuiImgButton units;
|
||||||
|
|
||||||
public GuiWireless( final InventoryPlayer inventoryPlayer, final TileWireless te )
|
public GuiWireless( final InventoryPlayer inventoryPlayer, final TileWireless te )
|
||||||
{
|
{
|
||||||
@@ -76,10 +76,10 @@ public class GuiWireless extends AEBaseGui
|
|||||||
|
|
||||||
final ContainerWireless cw = (ContainerWireless) this.inventorySlots;
|
final ContainerWireless cw = (ContainerWireless) this.inventorySlots;
|
||||||
|
|
||||||
if( cw.range > 0 )
|
if( cw.getRange() > 0 )
|
||||||
{
|
{
|
||||||
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m";
|
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.getRange() / 10.0 ) + " m";
|
||||||
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true );
|
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.getDrain(), true );
|
||||||
|
|
||||||
final int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) );
|
final int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) );
|
||||||
final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
|
final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public class GuiWirelessTerm extends GuiMEPortableCell
|
|||||||
public GuiWirelessTerm( final InventoryPlayer inventoryPlayer, final IPortableCell te )
|
public GuiWirelessTerm( final InventoryPlayer inventoryPlayer, final IPortableCell te )
|
||||||
{
|
{
|
||||||
super( inventoryPlayer, te );
|
super( inventoryPlayer, te );
|
||||||
this.maxRows = Integer.MAX_VALUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
|||||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
|
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
|
||||||
private static Map<EnumPair, ButtonAppearance> appearances;
|
private static Map<EnumPair, ButtonAppearance> appearances;
|
||||||
private final Enum buttonSetting;
|
private final Enum buttonSetting;
|
||||||
public boolean halfSize = false;
|
private boolean halfSize = false;
|
||||||
public String fillVar;
|
private String fillVar;
|
||||||
private Enum currentValue;
|
private Enum currentValue;
|
||||||
|
|
||||||
public GuiImgButton( final int x, final int y, final Enum idx, final Enum val )
|
public GuiImgButton( final int x, final int y, final Enum idx, final Enum val )
|
||||||
@@ -362,7 +362,27 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class EnumPair
|
public boolean isHalfSize()
|
||||||
|
{
|
||||||
|
return this.halfSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHalfSize( final boolean halfSize )
|
||||||
|
{
|
||||||
|
this.halfSize = halfSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFillVar()
|
||||||
|
{
|
||||||
|
return this.fillVar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFillVar( final String fillVar )
|
||||||
|
{
|
||||||
|
this.fillVar = fillVar;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class EnumPair
|
||||||
{
|
{
|
||||||
|
|
||||||
final Enum setting;
|
final Enum setting;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import net.minecraft.client.gui.GuiTextField;
|
|||||||
public class GuiNumberBox extends GuiTextField
|
public class GuiNumberBox extends GuiTextField
|
||||||
{
|
{
|
||||||
|
|
||||||
final Class type;
|
private final Class type;
|
||||||
|
|
||||||
public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type )
|
public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class GuiScrollbar implements IScrollSource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRange()
|
private int getRange()
|
||||||
{
|
{
|
||||||
return this.maxScroll - this.minScroll;
|
return this.maxScroll - this.minScroll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
|
|||||||
{
|
{
|
||||||
private final RenderItem itemRenderer;
|
private final RenderItem itemRenderer;
|
||||||
private final String message;
|
private final String message;
|
||||||
public int hideEdge = 0;
|
private int hideEdge = 0;
|
||||||
private int myIcon = -1;
|
private int myIcon = -1;
|
||||||
private ItemStack myItem;
|
private ItemStack myItem;
|
||||||
|
|
||||||
@@ -152,4 +152,14 @@ public class GuiTabButton extends GuiButton implements ITooltip
|
|||||||
{
|
{
|
||||||
return this.visible;
|
return this.visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getHideEdge()
|
||||||
|
{
|
||||||
|
return this.hideEdge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHideEdge( final int hideEdge )
|
||||||
|
{
|
||||||
|
this.hideEdge = hideEdge;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,14 +30,15 @@ import appeng.util.ItemSorters;
|
|||||||
public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
|
public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
|
||||||
{
|
{
|
||||||
|
|
||||||
public final String unlocalizedName;
|
private final String unlocalizedName;
|
||||||
public final AppEngInternalInventory inv;
|
private final AppEngInternalInventory inventory;
|
||||||
public final long id;
|
|
||||||
public final long sortBy;
|
private final long id;
|
||||||
|
private final long sortBy;
|
||||||
|
|
||||||
public ClientDCInternalInv( final int size, final long id, final long sortBy, final String unlocalizedName )
|
public ClientDCInternalInv( final int size, final long id, final long sortBy, final String unlocalizedName )
|
||||||
{
|
{
|
||||||
this.inv = new AppEngInternalInventory( null, size );
|
this.inventory = new AppEngInternalInventory( null, size );
|
||||||
this.unlocalizedName = unlocalizedName;
|
this.unlocalizedName = unlocalizedName;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.sortBy = sortBy;
|
this.sortBy = sortBy;
|
||||||
@@ -58,4 +59,14 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
|
|||||||
{
|
{
|
||||||
return ItemSorters.compareLong( this.sortBy, o.sortBy );
|
return ItemSorters.compareLong( this.sortBy, o.sortBy );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AppEngInternalInventory getInventory()
|
||||||
|
{
|
||||||
|
return this.inventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId()
|
||||||
|
{
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -27,9 +27,9 @@ import appeng.api.storage.data.IAEItemStack;
|
|||||||
public class InternalSlotME
|
public class InternalSlotME
|
||||||
{
|
{
|
||||||
|
|
||||||
public final int offset;
|
private final int offset;
|
||||||
public final int xPos;
|
private final int xPos;
|
||||||
public final int yPos;
|
private final int yPos;
|
||||||
private final ItemRepo repo;
|
private final ItemRepo repo;
|
||||||
|
|
||||||
public InternalSlotME( final ItemRepo def, final int offset, final int displayX, final int displayY )
|
public InternalSlotME( final ItemRepo def, final int offset, final int displayX, final int displayY )
|
||||||
@@ -40,18 +40,28 @@ public class InternalSlotME
|
|||||||
this.yPos = displayY;
|
this.yPos = displayY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStack()
|
ItemStack getStack()
|
||||||
{
|
{
|
||||||
return this.repo.getItem( this.offset );
|
return this.repo.getItem( this.offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAEItemStack getAEStack()
|
IAEItemStack getAEStack()
|
||||||
{
|
{
|
||||||
return this.repo.getReferenceItem( this.offset );
|
return this.repo.getReferenceItem( this.offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPower()
|
boolean hasPower()
|
||||||
{
|
{
|
||||||
return this.repo.hasPower();
|
return this.repo.hasPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getxPosition()
|
||||||
|
{
|
||||||
|
return this.xPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getyPosition()
|
||||||
|
{
|
||||||
|
return this.yPos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||||
@@ -55,10 +57,10 @@ public class ItemRepo
|
|||||||
private final IScrollSource src;
|
private final IScrollSource src;
|
||||||
private final ISortSource sortSrc;
|
private final ISortSource sortSrc;
|
||||||
|
|
||||||
public int rowSize = 9;
|
private int rowSize = 9;
|
||||||
|
|
||||||
public String searchString = "";
|
private String searchString = "";
|
||||||
IPartitionList<IAEItemStack> myPartitionList;
|
private IPartitionList<IAEItemStack> myPartitionList;
|
||||||
private String innerSearch = "";
|
private String innerSearch = "";
|
||||||
private String NEIWord = null;
|
private String NEIWord = null;
|
||||||
private boolean hasPower;
|
private boolean hasPower;
|
||||||
@@ -218,7 +220,7 @@ public class ItemRepo
|
|||||||
final Enum SortBy = this.sortSrc.getSortBy();
|
final Enum SortBy = this.sortSrc.getSortBy();
|
||||||
final Enum SortDir = this.sortSrc.getSortDir();
|
final Enum SortDir = this.sortSrc.getSortDir();
|
||||||
|
|
||||||
ItemSorters.Direction = (appeng.api.config.SortDir) SortDir;
|
ItemSorters.setDirection( (appeng.api.config.SortDir) SortDir );
|
||||||
ItemSorters.init();
|
ItemSorters.init();
|
||||||
|
|
||||||
if( SortBy == SortOrder.MOD )
|
if( SortBy == SortOrder.MOD )
|
||||||
@@ -287,4 +289,24 @@ public class ItemRepo
|
|||||||
{
|
{
|
||||||
this.hasPower = hasPower;
|
this.hasPower = hasPower;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRowSize()
|
||||||
|
{
|
||||||
|
return this.rowSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRowSize( final int rowSize )
|
||||||
|
{
|
||||||
|
this.rowSize = rowSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchString()
|
||||||
|
{
|
||||||
|
return this.searchString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchString( @Nonnull final String searchString )
|
||||||
|
{
|
||||||
|
this.searchString = searchString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ import appeng.util.Platform;
|
|||||||
public class SlotDisconnected extends AppEngSlot
|
public class SlotDisconnected extends AppEngSlot
|
||||||
{
|
{
|
||||||
|
|
||||||
public final ClientDCInternalInv mySlot;
|
private final ClientDCInternalInv mySlot;
|
||||||
|
|
||||||
public SlotDisconnected( final ClientDCInternalInv me, final int which, final int x, final int y )
|
public SlotDisconnected( final ClientDCInternalInv me, final int which, final int x, final int y )
|
||||||
{
|
{
|
||||||
super( me.inv, which, x, y );
|
super( me.getInventory(), which, x, y );
|
||||||
this.mySlot = me;
|
this.mySlot = me;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,4 +104,9 @@ public class SlotDisconnected extends AppEngSlot
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ClientDCInternalInv getSlot()
|
||||||
|
{
|
||||||
|
return this.mySlot;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ import appeng.api.storage.data.IAEItemStack;
|
|||||||
public class SlotME extends Slot
|
public class SlotME extends Slot
|
||||||
{
|
{
|
||||||
|
|
||||||
public final InternalSlotME mySlot;
|
private final InternalSlotME mySlot;
|
||||||
|
|
||||||
public SlotME( final InternalSlotME me )
|
public SlotME( final InternalSlotME me )
|
||||||
{
|
{
|
||||||
super( null, 0, me.xPos, me.yPos );
|
super( null, 0, me.getxPosition(), me.getyPosition() );
|
||||||
this.mySlot = me;
|
this.mySlot = me;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
package appeng.client.render;
|
package appeng.client.render;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
@@ -46,7 +48,7 @@ public class AppEngRenderItem extends RenderItem
|
|||||||
private static final ISlimReadableNumberConverter SLIM_CONVERTER = ReadableNumberConverter.INSTANCE;
|
private static final ISlimReadableNumberConverter SLIM_CONVERTER = ReadableNumberConverter.INSTANCE;
|
||||||
private static final IWideReadableNumberConverter WIDE_CONVERTER = ReadableNumberConverter.INSTANCE;
|
private static final IWideReadableNumberConverter WIDE_CONVERTER = ReadableNumberConverter.INSTANCE;
|
||||||
|
|
||||||
public IAEItemStack aeStack;
|
private IAEItemStack aeStack = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderItemOverlayIntoGUI( final FontRenderer fontRenderer, final TextureManager textureManager, final ItemStack is, final int par4, final int par5, final String par6Str )
|
public void renderItemOverlayIntoGUI( final FontRenderer fontRenderer, final TextureManager textureManager, final ItemStack is, final int par4, final int par5, final String par6Str )
|
||||||
@@ -65,17 +67,21 @@ public class AppEngRenderItem extends RenderItem
|
|||||||
final double health = is.getItem().getDurabilityForDisplay( is );
|
final double health = is.getItem().getDurabilityForDisplay( is );
|
||||||
final int j1 = (int) Math.round( 13.0D - health * 13.0D );
|
final int j1 = (int) Math.round( 13.0D - health * 13.0D );
|
||||||
final int k = (int) Math.round( 255.0D - health * 255.0D );
|
final int k = (int) Math.round( 255.0D - health * 255.0D );
|
||||||
|
|
||||||
GL11.glDisable( GL11.GL_LIGHTING );
|
GL11.glDisable( GL11.GL_LIGHTING );
|
||||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||||
GL11.glDisable( GL11.GL_TEXTURE_2D );
|
GL11.glDisable( GL11.GL_TEXTURE_2D );
|
||||||
GL11.glDisable( GL11.GL_ALPHA_TEST );
|
GL11.glDisable( GL11.GL_ALPHA_TEST );
|
||||||
GL11.glDisable( GL11.GL_BLEND );
|
GL11.glDisable( GL11.GL_BLEND );
|
||||||
|
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
final int l = 255 - k << 16 | k << 8;
|
final int l = 255 - k << 16 | k << 8;
|
||||||
final int i1 = ( 255 - k ) / 4 << 16 | 16128;
|
final int i1 = ( 255 - k ) / 4 << 16 | 16128;
|
||||||
|
|
||||||
this.renderQuad( tessellator, par4 + 2, par5 + 13, 13, 2, 0 );
|
this.renderQuad( tessellator, par4 + 2, par5 + 13, 13, 2, 0 );
|
||||||
this.renderQuad( tessellator, par4 + 2, par5 + 13, 12, 1, i1 );
|
this.renderQuad( tessellator, par4 + 2, par5 + 13, 12, 1, i1 );
|
||||||
this.renderQuad( tessellator, par4 + 2, par5 + 13, j1, 1, l );
|
this.renderQuad( tessellator, par4 + 2, par5 + 13, j1, 1, l );
|
||||||
|
|
||||||
GL11.glEnable( GL11.GL_ALPHA_TEST );
|
GL11.glEnable( GL11.GL_ALPHA_TEST );
|
||||||
GL11.glEnable( GL11.GL_TEXTURE_2D );
|
GL11.glEnable( GL11.GL_TEXTURE_2D );
|
||||||
GL11.glEnable( GL11.GL_LIGHTING );
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
@@ -86,19 +92,23 @@ public class AppEngRenderItem extends RenderItem
|
|||||||
if( is.stackSize == 0 )
|
if( is.stackSize == 0 )
|
||||||
{
|
{
|
||||||
final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
final String craftLabelText = AEConfig.instance.useTerminalUseLargeFont() ? GuiText.LargeFontCraft.getLocal() : GuiText.SmallFontCraft.getLocal();
|
||||||
|
|
||||||
GL11.glDisable( GL11.GL_LIGHTING );
|
GL11.glDisable( GL11.GL_LIGHTING );
|
||||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glScaled( scaleFactor, scaleFactor, scaleFactor );
|
GL11.glScaled( scaleFactor, scaleFactor, scaleFactor );
|
||||||
|
|
||||||
final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor );
|
final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( craftLabelText ) * scaleFactor ) * inverseScaleFactor );
|
||||||
final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
||||||
fontRenderer.drawStringWithShadow( craftLabelText, X, Y, 16777215 );
|
fontRenderer.drawStringWithShadow( craftLabelText, X, Y, 16777215 );
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glEnable( GL11.GL_LIGHTING );
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
||||||
}
|
}
|
||||||
|
|
||||||
final long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize;
|
final long amount = this.aeStack != null ? this.aeStack.getStackSize() : is.stackSize;
|
||||||
|
|
||||||
if( amount != 0 )
|
if( amount != 0 )
|
||||||
{
|
{
|
||||||
final String stackSize = this.getToBeRenderedStackSize( amount );
|
final String stackSize = this.getToBeRenderedStackSize( amount );
|
||||||
@@ -107,9 +117,11 @@ public class AppEngRenderItem extends RenderItem
|
|||||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glScaled( scaleFactor, scaleFactor, scaleFactor );
|
GL11.glScaled( scaleFactor, scaleFactor, scaleFactor );
|
||||||
|
|
||||||
final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor );
|
final int X = (int) ( ( (float) par4 + offset + 16.0f - fontRenderer.getStringWidth( stackSize ) * scaleFactor ) * inverseScaleFactor );
|
||||||
final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
final int Y = (int) ( ( (float) par5 + offset + 16.0f - 7.0f * scaleFactor ) * inverseScaleFactor );
|
||||||
fontRenderer.drawStringWithShadow( stackSize, X, Y, 16777215 );
|
fontRenderer.drawStringWithShadow( stackSize, X, Y, 16777215 );
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glEnable( GL11.GL_LIGHTING );
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
||||||
@@ -141,4 +153,14 @@ public class AppEngRenderItem extends RenderItem
|
|||||||
return WIDE_CONVERTER.toWideReadableForm( originalSize );
|
return WIDE_CONVERTER.toWideReadableForm( originalSize );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IAEItemStack getAeStack()
|
||||||
|
{
|
||||||
|
return this.aeStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAeStack( @Nonnull final IAEItemStack aeStack )
|
||||||
|
{
|
||||||
|
this.aeStack = aeStack;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
setOriMap();
|
setOriMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setOriMap()
|
private static void setOriMap()
|
||||||
{
|
{
|
||||||
// pointed up...
|
// pointed up...
|
||||||
ORIENTATION_MAP[0][3][1] = 0;
|
ORIENTATION_MAP[0][3][1] = 0;
|
||||||
@@ -275,7 +275,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
return ( r << 16 ) | ( g << 8 ) | b;
|
return ( r << 16 ) | ( g << 8 ) | b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getTesrRenderDistance()
|
double getTesrRenderDistance()
|
||||||
{
|
{
|
||||||
return this.renderDistance;
|
return this.renderDistance;
|
||||||
}
|
}
|
||||||
@@ -283,8 +283,8 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
public void renderInventory( final B block, final ItemStack item, final RenderBlocks renderer, final ItemRenderType type, final Object[] data )
|
public void renderInventory( final B block, final ItemStack item, final RenderBlocks renderer, final ItemRenderType type, final Object[] data )
|
||||||
{
|
{
|
||||||
final Tessellator tess = Tessellator.instance;
|
final Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
final BlockRenderInfo info = block.getRendererInstance();
|
final BlockRenderInfo info = block.getRendererInstance();
|
||||||
|
|
||||||
if( info.isValid() )
|
if( info.isValid() )
|
||||||
{
|
{
|
||||||
if( block.hasSubtypes() )
|
if( block.hasSubtypes() )
|
||||||
@@ -312,7 +312,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getOrientation( final ForgeDirection in, final ForgeDirection forward, final ForgeDirection up )
|
static int getOrientation( final ForgeDirection in, final ForgeDirection forward, final ForgeDirection up )
|
||||||
{
|
{
|
||||||
if( in == null || in == ForgeDirection.UNKNOWN // 1
|
if( in == null || in == ForgeDirection.UNKNOWN // 1
|
||||||
|| forward == null || forward == ForgeDirection.UNKNOWN // 2
|
|| forward == null || forward == ForgeDirection.UNKNOWN // 2
|
||||||
@@ -330,8 +330,14 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
|
|
||||||
public void renderInvBlock( final EnumSet<ForgeDirection> sides, final B block, final ItemStack item, final Tessellator tess, final int color, final RenderBlocks renderer )
|
public void renderInvBlock( final EnumSet<ForgeDirection> sides, final B block, final ItemStack item, final Tessellator tess, final int color, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
|
if( block == null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int meta = 0;
|
int meta = 0;
|
||||||
if( block != null && block.hasSubtypes() && item != null )
|
|
||||||
|
if( block.hasSubtypes() && item != null )
|
||||||
{
|
{
|
||||||
meta = item.getItemDamage();
|
meta = item.getItemDamage();
|
||||||
}
|
}
|
||||||
@@ -391,7 +397,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIcon firstNotNull( final IIcon... s )
|
private IIcon firstNotNull( final IIcon... s )
|
||||||
{
|
{
|
||||||
for( final IIcon o : s )
|
for( final IIcon o : s )
|
||||||
{
|
{
|
||||||
@@ -400,6 +406,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExtraBlockTextures.getMissing();
|
return ExtraBlockTextures.getMissing();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,6 +417,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
final boolean o = renderer.renderStandardBlock( block, x, y, z );
|
final boolean o = renderer.renderStandardBlock( block, x, y, z );
|
||||||
|
|
||||||
this.postRenderInWorld( renderer );
|
this.postRenderInWorld( renderer );
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,6 +426,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
|
|
||||||
final BlockRenderInfo info = block.getRendererInstance();
|
final BlockRenderInfo info = block.getRendererInstance();
|
||||||
final IOrientable te = this.getOrientable( block, world, x, y, z );
|
final IOrientable te = this.getOrientable( block, world, x, y, z );
|
||||||
|
|
||||||
if( te != null )
|
if( te != null )
|
||||||
{
|
{
|
||||||
final ForgeDirection forward = te.getForward();
|
final ForgeDirection forward = te.getForward();
|
||||||
@@ -450,13 +459,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
renderer.setRenderBounds( i / 16.0, j / 16.0, k / 16.0, l / 16.0, m / 16.0, n / 16.0 );
|
renderer.setRenderBounds( i / 16.0, j / 16.0, k / 16.0, l / 16.0, m / 16.0, n / 16.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderBlockBounds( final RenderBlocks renderer,
|
protected void renderBlockBounds( final RenderBlocks renderer, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, final ForgeDirection x, final ForgeDirection y, final ForgeDirection z )
|
||||||
|
|
||||||
double minX, double minY, double minZ,
|
|
||||||
|
|
||||||
double maxX, double maxY, double maxZ,
|
|
||||||
|
|
||||||
final ForgeDirection x, final ForgeDirection y, final ForgeDirection z )
|
|
||||||
{
|
{
|
||||||
minX /= 16.0;
|
minX /= 16.0;
|
||||||
minY /= 16.0;
|
minY /= 16.0;
|
||||||
@@ -763,6 +766,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
|||||||
if( itemstack != null )
|
if( itemstack != null )
|
||||||
{
|
{
|
||||||
final EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorldObj(), 0.0D, 0.0D, 0.0D, itemstack );
|
final EntityItem entityitem = new EntityItem( par1EntityItemFrame.getWorldObj(), 0.0D, 0.0D, 0.0D, itemstack );
|
||||||
|
|
||||||
entityitem.getEntityItem().stackSize = 1;
|
entityitem.getEntityItem().stackSize = 1;
|
||||||
|
|
||||||
// set all this stuff and then do shit? meh?
|
// set all this stuff and then do shit? meh?
|
||||||
|
|||||||
@@ -22,14 +22,16 @@ package appeng.client.render;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import appeng.block.AEBaseBlock;
|
||||||
import appeng.client.texture.FlippableIcon;
|
import appeng.client.texture.FlippableIcon;
|
||||||
import appeng.client.texture.TmpFlippableIcon;
|
import appeng.client.texture.TmpFlippableIcon;
|
||||||
|
import appeng.tile.AEBaseTile;
|
||||||
|
|
||||||
|
|
||||||
public class BlockRenderInfo
|
public class BlockRenderInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
public final BaseBlockRender rendererInstance;
|
private final BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> rendererInstance;
|
||||||
private final TmpFlippableIcon tmpTopIcon = new TmpFlippableIcon();
|
private final TmpFlippableIcon tmpTopIcon = new TmpFlippableIcon();
|
||||||
private final TmpFlippableIcon tmpBottomIcon = new TmpFlippableIcon();
|
private final TmpFlippableIcon tmpBottomIcon = new TmpFlippableIcon();
|
||||||
private final TmpFlippableIcon tmpSouthIcon = new TmpFlippableIcon();
|
private final TmpFlippableIcon tmpSouthIcon = new TmpFlippableIcon();
|
||||||
@@ -44,7 +46,7 @@ public class BlockRenderInfo
|
|||||||
private FlippableIcon eastIcon = null;
|
private FlippableIcon eastIcon = null;
|
||||||
private FlippableIcon westIcon = null;
|
private FlippableIcon westIcon = null;
|
||||||
|
|
||||||
public BlockRenderInfo( final BaseBlockRender inst )
|
public BlockRenderInfo( final BaseBlockRender<? extends AEBaseBlock, ? extends AEBaseTile> inst )
|
||||||
{
|
{
|
||||||
this.rendererInstance = inst;
|
this.rendererInstance = inst;
|
||||||
}
|
}
|
||||||
@@ -132,8 +134,13 @@ public class BlockRenderInfo
|
|||||||
return this.topIcon;
|
return this.topIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValid()
|
boolean isValid()
|
||||||
{
|
{
|
||||||
return this.topIcon != null && this.bottomIcon != null && this.southIcon != null && this.northIcon != null && this.eastIcon != null && this.westIcon != null;
|
return this.topIcon != null && this.bottomIcon != null && this.southIcon != null && this.northIcon != null && this.eastIcon != null && this.westIcon != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BaseBlockRender getRendererInstance()
|
||||||
|
{
|
||||||
|
return this.rendererInstance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
|
|
||||||
private final BoundBoxCalculator bbc;
|
private final BoundBoxCalculator bbc;
|
||||||
private final boolean noAlphaPass;
|
private final boolean noAlphaPass;
|
||||||
private final BaseBlockRender bbr;
|
private final BaseBlockRender<AEBaseBlock, AEBaseTile> bbr;
|
||||||
private final Optional<Block> maybeBlock;
|
private final Optional<Block> maybeBlock;
|
||||||
private final Optional<AEBaseBlock> maybeBaseBlock;
|
private final Optional<AEBaseBlock> maybeBaseBlock;
|
||||||
private int renderingForPass;
|
private int renderingForPass;
|
||||||
@@ -253,7 +253,7 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
this.renderingForPass = pass;
|
this.renderingForPass = pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderThis()
|
private boolean renderThis()
|
||||||
{
|
{
|
||||||
if( this.renderingForPass == this.currentPass || this.noAlphaPass )
|
if( this.renderingForPass == this.currentPass || this.noAlphaPass )
|
||||||
{
|
{
|
||||||
@@ -266,23 +266,23 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
@Override
|
@Override
|
||||||
public void normalRendering()
|
public void normalRendering()
|
||||||
{
|
{
|
||||||
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer;
|
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.getRenderer();
|
||||||
rbw.calculations = true;
|
rbw.setCalculations( true );
|
||||||
rbw.useTextures = true;
|
rbw.setUseTextures( true );
|
||||||
rbw.enableAO = false;
|
rbw.enableAO = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ISimplifiedBundle useSimplifiedRendering( final int x, final int y, final int z, final IBoxProvider p, final ISimplifiedBundle sim )
|
public ISimplifiedBundle useSimplifiedRendering( final int x, final int y, final int z, final IBoxProvider p, final ISimplifiedBundle sim )
|
||||||
{
|
{
|
||||||
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer;
|
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.getRenderer();
|
||||||
|
|
||||||
if( sim != null && this.maybeBlock.isPresent() && rbw.similarLighting( this.maybeBlock.get(), rbw.blockAccess, x, y, z, sim ) )
|
if( sim != null && this.maybeBlock.isPresent() && rbw.similarLighting( this.maybeBlock.get(), rbw.blockAccess, x, y, z, sim ) )
|
||||||
{
|
{
|
||||||
rbw.populate( sim );
|
rbw.populate( sim );
|
||||||
rbw.faces = EnumSet.allOf( ForgeDirection.class );
|
rbw.setFaces( EnumSet.allOf( ForgeDirection.class ) );
|
||||||
rbw.calculations = false;
|
rbw.setCalculations( false );
|
||||||
rbw.useTextures = false;
|
rbw.setUseTextures( false );
|
||||||
|
|
||||||
return sim;
|
return sim;
|
||||||
}
|
}
|
||||||
@@ -290,8 +290,8 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
{
|
{
|
||||||
final boolean allFaces = rbw.renderAllFaces;
|
final boolean allFaces = rbw.renderAllFaces;
|
||||||
rbw.renderAllFaces = true;
|
rbw.renderAllFaces = true;
|
||||||
rbw.calculations = true;
|
rbw.setCalculations( true );
|
||||||
rbw.faces.clear();
|
rbw.getFaces().clear();
|
||||||
|
|
||||||
this.bbc.started = false;
|
this.bbc.started = false;
|
||||||
if( p == null )
|
if( p == null )
|
||||||
@@ -339,10 +339,10 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
rbw.renderStandardBlock( block, x, y, z );
|
rbw.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
rbw.faces = EnumSet.allOf( ForgeDirection.class );
|
rbw.setFaces( EnumSet.allOf( ForgeDirection.class ) );
|
||||||
rbw.renderAllFaces = allFaces;
|
rbw.renderAllFaces = allFaces;
|
||||||
rbw.calculations = false;
|
rbw.setCalculations( false );
|
||||||
rbw.useTextures = false;
|
rbw.setUseTextures( false );
|
||||||
|
|
||||||
return rbw.getLightingCache();
|
return rbw.getLightingCache();
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForgeDirection mapRotation( final ForgeDirection dir )
|
private ForgeDirection mapRotation( final ForgeDirection dir )
|
||||||
{
|
{
|
||||||
final ForgeDirection forward = this.az;
|
final ForgeDirection forward = this.az;
|
||||||
final ForgeDirection up = this.ay;
|
final ForgeDirection up = this.ay;
|
||||||
@@ -518,7 +518,7 @@ public final class BusRenderHelper implements IPartRenderHelper
|
|||||||
@Override
|
@Override
|
||||||
public void setFacesToRender( final EnumSet<ForgeDirection> faces )
|
public void setFacesToRender( final EnumSet<ForgeDirection> faces )
|
||||||
{
|
{
|
||||||
BusRenderer.INSTANCE.renderer.renderFaces = faces;
|
BusRenderer.INSTANCE.getRenderer().setRenderFaces( faces );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class BusRenderer implements IItemRenderer
|
|||||||
|
|
||||||
public static final BusRenderer INSTANCE = new BusRenderer();
|
public static final BusRenderer INSTANCE = new BusRenderer();
|
||||||
private static final Map<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
|
private static final Map<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
|
||||||
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
|
private final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
|
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
|
||||||
@@ -74,7 +74,7 @@ public class BusRenderer implements IItemRenderer
|
|||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
GL11.glPushAttrib( GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT );
|
||||||
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
||||||
GL11.glEnable( GL11.GL_TEXTURE_2D );
|
GL11.glEnable( GL11.GL_TEXTURE_2D );
|
||||||
GL11.glEnable( GL11.GL_LIGHTING );
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
@@ -120,13 +120,13 @@ public class BusRenderer implements IItemRenderer
|
|||||||
BusRenderHelper.INSTANCE.setBounds( 0, 0, 0, 1, 1, 1 );
|
BusRenderHelper.INSTANCE.setBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
BusRenderHelper.INSTANCE.setTexture( null );
|
BusRenderHelper.INSTANCE.setTexture( null );
|
||||||
BusRenderHelper.INSTANCE.setInvColor( 0xffffff );
|
BusRenderHelper.INSTANCE.setInvColor( 0xffffff );
|
||||||
this.renderer.blockAccess = ClientHelper.proxy.getWorld();
|
this.getRenderer().blockAccess = ClientHelper.proxy.getWorld();
|
||||||
|
|
||||||
BusRenderHelper.INSTANCE.setOrientation( ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
BusRenderHelper.INSTANCE.setOrientation( ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||||
|
|
||||||
this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0;
|
this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = this.getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0;
|
||||||
this.renderer.useInventoryTint = false;
|
this.getRenderer().useInventoryTint = false;
|
||||||
this.renderer.overrideBlockTexture = null;
|
this.getRenderer().overrideBlockTexture = null;
|
||||||
|
|
||||||
if( item.getItem() instanceof IFacadeItem )
|
if( item.getItem() instanceof IFacadeItem )
|
||||||
{
|
{
|
||||||
@@ -141,12 +141,13 @@ public class BusRenderer implements IItemRenderer
|
|||||||
|
|
||||||
if( fp != null )
|
if( fp != null )
|
||||||
{
|
{
|
||||||
fp.renderInventory( BusRenderHelper.INSTANCE, this.renderer );
|
fp.renderInventory( BusRenderHelper.INSTANCE, this.getRenderer() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final IPart ip = this.getRenderer( item, (IPartItem) item.getItem() );
|
final IPart ip = this.getRenderer( item, (IPartItem) item.getItem() );
|
||||||
|
|
||||||
if( ip != null )
|
if( ip != null )
|
||||||
{
|
{
|
||||||
if( type == ItemRenderType.ENTITY )
|
if( type == ItemRenderType.ENTITY )
|
||||||
@@ -155,22 +156,23 @@ public class BusRenderer implements IItemRenderer
|
|||||||
GL11.glTranslatef( 0.0f, 0.0f, -0.04f * ( 8 - depth ) - 0.06f );
|
GL11.glTranslatef( 0.0f, 0.0f, -0.04f * ( 8 - depth ) - 0.06f );
|
||||||
}
|
}
|
||||||
|
|
||||||
ip.renderInventory( BusRenderHelper.INSTANCE, this.renderer );
|
ip.renderInventory( BusRenderHelper.INSTANCE, this.getRenderer() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0;
|
this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = this.getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0;
|
||||||
|
|
||||||
GL11.glPopAttrib();
|
GL11.glPopAttrib();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public IPart getRenderer( final ItemStack is, final IPartItem c )
|
private IPart getRenderer( final ItemStack is, final IPartItem c )
|
||||||
{
|
{
|
||||||
final int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage();
|
final int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage();
|
||||||
|
|
||||||
IPart part = RENDER_PART.get( id );
|
IPart part = RENDER_PART.get( id );
|
||||||
|
|
||||||
if( part == null )
|
if( part == null )
|
||||||
{
|
{
|
||||||
part = c.createPartFromItemStack( is );
|
part = c.createPartFromItemStack( is );
|
||||||
@@ -182,4 +184,9 @@ public class BusRenderer implements IItemRenderer
|
|||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RenderBlocksWorkaround getRenderer()
|
||||||
|
{
|
||||||
|
return this.renderer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class CableRenderHelper
|
|||||||
public void renderStatic( final CableBusContainer cableBusContainer, final IFacadeContainer iFacadeContainer )
|
public void renderStatic( final CableBusContainer cableBusContainer, final IFacadeContainer iFacadeContainer )
|
||||||
{
|
{
|
||||||
final TileEntity te = cableBusContainer.getTile();
|
final TileEntity te = cableBusContainer.getTile();
|
||||||
final RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.renderer;
|
final RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.getRenderer();
|
||||||
|
|
||||||
if( renderer.overrideBlockTexture != null )
|
if( renderer.overrideBlockTexture != null )
|
||||||
{
|
{
|
||||||
@@ -73,9 +73,9 @@ public class CableRenderHelper
|
|||||||
|
|
||||||
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer );
|
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer );
|
||||||
|
|
||||||
renderer.faces = EnumSet.allOf( ForgeDirection.class );
|
renderer.setFaces( EnumSet.allOf( ForgeDirection.class ) );
|
||||||
renderer.calculations = true;
|
renderer.setCalculations( true );
|
||||||
renderer.useTextures = true;
|
renderer.setUseTextures( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +85,7 @@ public class CableRenderHelper
|
|||||||
* snag list of boxes...
|
* snag list of boxes...
|
||||||
*/
|
*/
|
||||||
final List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
final List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||||
|
|
||||||
for( final ForgeDirection s : ForgeDirection.values() )
|
for( final ForgeDirection s : ForgeDirection.values() )
|
||||||
{
|
{
|
||||||
final IPart part = cableBusContainer.getPart( s );
|
final IPart part = cableBusContainer.getPart( s );
|
||||||
@@ -120,6 +121,7 @@ public class CableRenderHelper
|
|||||||
for( final ForgeDirection s : ForgeDirection.VALID_DIRECTIONS )
|
for( final ForgeDirection s : ForgeDirection.VALID_DIRECTIONS )
|
||||||
{
|
{
|
||||||
final IFacadePart fPart = iFacadeContainer.getFacade( s );
|
final IFacadePart fPart = iFacadeContainer.getFacade( s );
|
||||||
|
|
||||||
if( fPart != null )
|
if( fPart != null )
|
||||||
{
|
{
|
||||||
fPart.setThinFacades( useThinFacades );
|
fPart.setThinFacades( useThinFacades );
|
||||||
@@ -153,10 +155,10 @@ public class CableRenderHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.isFacade = false;
|
renderer.setFacade( false );
|
||||||
renderer.enableAO = false;
|
renderer.enableAO = false;
|
||||||
renderer.setTexture( null );
|
renderer.setTexture( null );
|
||||||
renderer.calculations = true;
|
renderer.setCalculations( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +216,7 @@ public class CableRenderHelper
|
|||||||
for( final ForgeDirection s : ForgeDirection.values() )
|
for( final ForgeDirection s : ForgeDirection.values() )
|
||||||
{
|
{
|
||||||
final IPart part = cableBusContainer.getPart( s );
|
final IPart part = cableBusContainer.getPart( s );
|
||||||
|
|
||||||
if( part != null )
|
if( part != null )
|
||||||
{
|
{
|
||||||
final ForgeDirection ax;
|
final ForgeDirection ax;
|
||||||
@@ -261,7 +264,7 @@ public class CableRenderHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
|
||||||
part.renderDynamic( x, y, z, BusRenderHelper.INSTANCE, BusRenderer.INSTANCE.renderer );
|
part.renderDynamic( x, y, z, BusRenderHelper.INSTANCE, BusRenderer.INSTANCE.getRenderer() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class ItemRenderer implements IItemRenderer
|
|||||||
public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data )
|
public void renderItem( final ItemRenderType type, final ItemStack item, final Object... data )
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
GL11.glPushAttrib( GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT );
|
||||||
GL11.glEnable( GL11.GL_ALPHA_TEST );
|
GL11.glEnable( GL11.GL_ALPHA_TEST );
|
||||||
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
GL11.glEnable( GL11.GL_DEPTH_TEST );
|
||||||
GL11.glEnable( GL11.GL_BLEND );
|
GL11.glEnable( GL11.GL_BLEND );
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ package appeng.client.render;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
@@ -41,18 +42,18 @@ import appeng.core.AELog;
|
|||||||
public class RenderBlocksWorkaround extends RenderBlocks
|
public class RenderBlocksWorkaround extends RenderBlocks
|
||||||
{
|
{
|
||||||
|
|
||||||
final int[] lightHashTmp = new int[27];
|
private final int[] lightHashTmp = new int[27];
|
||||||
public boolean calculations = true;
|
private boolean calculations = true;
|
||||||
public EnumSet<ForgeDirection> renderFaces = EnumSet.allOf( ForgeDirection.class );
|
private EnumSet<ForgeDirection> renderFaces = EnumSet.allOf( ForgeDirection.class );
|
||||||
public EnumSet<ForgeDirection> faces = EnumSet.allOf( ForgeDirection.class );
|
private EnumSet<ForgeDirection> faces = EnumSet.allOf( ForgeDirection.class );
|
||||||
public boolean isFacade = false;
|
private boolean isFacade = false;
|
||||||
public boolean useTextures = true;
|
private boolean useTextures = true;
|
||||||
public float opacity = 1.0f;
|
private float opacity = 1.0f;
|
||||||
Field fBrightness;
|
private Field fBrightness = null;
|
||||||
Field fColor;
|
private Field fColor = null;
|
||||||
private LightingCache lightState = new LightingCache();
|
private LightingCache lightState = new LightingCache();
|
||||||
|
|
||||||
public int getCurrentColor()
|
private int getCurrentColor()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -76,7 +77,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCurrentBrightness()
|
private int getCurrentBrightness()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -100,7 +101,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTexture( final IIcon ico )
|
void setTexture( final IIcon ico )
|
||||||
{
|
{
|
||||||
this.lightState.rXPos = this.lightState.rXNeg = this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico;
|
this.lightState.rXPos = this.lightState.rXNeg = this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico;
|
||||||
}
|
}
|
||||||
@@ -115,31 +116,31 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
this.lightState.rZNeg = rZNeg;
|
this.lightState.rZNeg = rZNeg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderStandardBlockNoCalculations( final Block b, final int x, final int y, final int z )
|
private boolean renderStandardBlockNoCalculations( final Block b, final int x, final int y, final int z )
|
||||||
{
|
{
|
||||||
Tessellator.instance.setBrightness( this.lightState.bXPos );
|
Tessellator.instance.setBrightness( this.lightState.bXPos );
|
||||||
this.restoreAO( this.lightState.aoXPos, this.lightState.foXPos );
|
this.restoreAO( this.lightState.aoXPos, this.lightState.foXPos );
|
||||||
this.renderFaceXPos( b, x, y, z, this.useTextures ? this.lightState.rXPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) );
|
this.renderFaceXPos( b, x, y, z, this.isUseTextures() ? this.lightState.rXPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) );
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( this.lightState.bXNeg );
|
Tessellator.instance.setBrightness( this.lightState.bXNeg );
|
||||||
this.restoreAO( this.lightState.aoXNeg, this.lightState.foXNeg );
|
this.restoreAO( this.lightState.aoXNeg, this.lightState.foXNeg );
|
||||||
this.renderFaceXNeg( b, x, y, z, this.useTextures ? this.lightState.rXNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) );
|
this.renderFaceXNeg( b, x, y, z, this.isUseTextures() ? this.lightState.rXNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) );
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( this.lightState.bYPos );
|
Tessellator.instance.setBrightness( this.lightState.bYPos );
|
||||||
this.restoreAO( this.lightState.aoYPos, this.lightState.foYPos );
|
this.restoreAO( this.lightState.aoYPos, this.lightState.foYPos );
|
||||||
this.renderFaceYPos( b, x, y, z, this.useTextures ? this.lightState.rYPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) );
|
this.renderFaceYPos( b, x, y, z, this.isUseTextures() ? this.lightState.rYPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) );
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( this.lightState.bYNeg );
|
Tessellator.instance.setBrightness( this.lightState.bYNeg );
|
||||||
this.restoreAO( this.lightState.aoYNeg, this.lightState.foYNeg );
|
this.restoreAO( this.lightState.aoYNeg, this.lightState.foYNeg );
|
||||||
this.renderFaceYNeg( b, x, y, z, this.useTextures ? this.lightState.rYNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) );
|
this.renderFaceYNeg( b, x, y, z, this.isUseTextures() ? this.lightState.rYNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) );
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( this.lightState.bZPos );
|
Tessellator.instance.setBrightness( this.lightState.bZPos );
|
||||||
this.restoreAO( this.lightState.aoZPos, this.lightState.foZPos );
|
this.restoreAO( this.lightState.aoZPos, this.lightState.foZPos );
|
||||||
this.renderFaceZPos( b, x, y, z, this.useTextures ? this.lightState.rZPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) );
|
this.renderFaceZPos( b, x, y, z, this.isUseTextures() ? this.lightState.rZPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) );
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( this.lightState.bZNeg );
|
Tessellator.instance.setBrightness( this.lightState.bZNeg );
|
||||||
this.restoreAO( this.lightState.aoZNeg, this.lightState.foZNeg );
|
this.restoreAO( this.lightState.aoZNeg, this.lightState.foZNeg );
|
||||||
this.renderFaceZNeg( b, x, y, z, this.useTextures ? this.lightState.rZNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) );
|
this.renderFaceZNeg( b, x, y, z, this.isUseTextures() ? this.lightState.rZNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -150,7 +151,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
this.brightnessBottomRight = z[1];
|
this.brightnessBottomRight = z[1];
|
||||||
this.brightnessTopLeft = z[2];
|
this.brightnessTopLeft = z[2];
|
||||||
this.brightnessTopRight = z[3];
|
this.brightnessTopRight = z[3];
|
||||||
Tessellator.instance.setColorRGBA_I( z[4], (int) ( this.opacity * 255 ) );
|
Tessellator.instance.setColorRGBA_I( z[4], (int) ( this.getOpacity() * 255 ) );
|
||||||
|
|
||||||
this.colorRedTopLeft = c[0];
|
this.colorRedTopLeft = c[0];
|
||||||
this.colorGreenTopLeft = c[1];
|
this.colorGreenTopLeft = c[1];
|
||||||
@@ -193,7 +194,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if( this.calculations )
|
if( this.isCalculations() )
|
||||||
{
|
{
|
||||||
this.lightState.lightHash = this.getLightingHash( blk, this.blockAccess, x, y, z );
|
this.lightState.lightHash = this.getLightingHash( blk, this.blockAccess, x, y, z );
|
||||||
return super.renderStandardBlock( blk, x, y, z );
|
return super.renderStandardBlock( blk, x, y, z );
|
||||||
@@ -208,7 +209,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
}
|
}
|
||||||
catch( final Throwable t )
|
catch( final Throwable t )
|
||||||
{
|
{
|
||||||
AELog.error( t );
|
AELog.debug( t );
|
||||||
// meh
|
// meh
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -217,14 +218,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
@Override
|
@Override
|
||||||
public void renderFaceYNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
public void renderFaceYNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
||||||
{
|
{
|
||||||
if( this.faces.contains( ForgeDirection.DOWN ) )
|
if( this.getFaces().contains( ForgeDirection.DOWN ) )
|
||||||
{
|
{
|
||||||
if( !this.renderFaces.contains( ForgeDirection.DOWN ) )
|
if( !this.getRenderFaces().contains( ForgeDirection.DOWN ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.isFacade )
|
if( this.isFacade() )
|
||||||
{
|
{
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
@@ -275,14 +276,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
@Override
|
@Override
|
||||||
public void renderFaceYPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
public void renderFaceYPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
||||||
{
|
{
|
||||||
if( this.faces.contains( ForgeDirection.UP ) )
|
if( this.getFaces().contains( ForgeDirection.UP ) )
|
||||||
{
|
{
|
||||||
if( !this.renderFaces.contains( ForgeDirection.UP ) )
|
if( !this.getRenderFaces().contains( ForgeDirection.UP ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.isFacade )
|
if( this.isFacade() )
|
||||||
{
|
{
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
@@ -333,14 +334,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
@Override
|
@Override
|
||||||
public void renderFaceZNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
public void renderFaceZNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
||||||
{
|
{
|
||||||
if( this.faces.contains( ForgeDirection.NORTH ) )
|
if( this.getFaces().contains( ForgeDirection.NORTH ) )
|
||||||
{
|
{
|
||||||
if( !this.renderFaces.contains( ForgeDirection.NORTH ) )
|
if( !this.getRenderFaces().contains( ForgeDirection.NORTH ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.isFacade )
|
if( this.isFacade() )
|
||||||
{
|
{
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
@@ -391,14 +392,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
@Override
|
@Override
|
||||||
public void renderFaceZPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
public void renderFaceZPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
||||||
{
|
{
|
||||||
if( this.faces.contains( ForgeDirection.SOUTH ) )
|
if( this.getFaces().contains( ForgeDirection.SOUTH ) )
|
||||||
{
|
{
|
||||||
if( !this.renderFaces.contains( ForgeDirection.SOUTH ) )
|
if( !this.getRenderFaces().contains( ForgeDirection.SOUTH ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.isFacade )
|
if( this.isFacade() )
|
||||||
{
|
{
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
@@ -449,14 +450,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
@Override
|
@Override
|
||||||
public void renderFaceXNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
public void renderFaceXNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
||||||
{
|
{
|
||||||
if( this.faces.contains( ForgeDirection.WEST ) )
|
if( this.getFaces().contains( ForgeDirection.WEST ) )
|
||||||
{
|
{
|
||||||
if( !this.renderFaces.contains( ForgeDirection.WEST ) )
|
if( !this.getRenderFaces().contains( ForgeDirection.WEST ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.isFacade )
|
if( this.isFacade() )
|
||||||
{
|
{
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
@@ -507,14 +508,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
@Override
|
@Override
|
||||||
public void renderFaceXPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
public void renderFaceXPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
|
||||||
{
|
{
|
||||||
if( this.faces.contains( ForgeDirection.EAST ) )
|
if( this.getFaces().contains( ForgeDirection.EAST ) )
|
||||||
{
|
{
|
||||||
if( !this.renderFaces.contains( ForgeDirection.EAST ) )
|
if( !this.getRenderFaces().contains( ForgeDirection.EAST ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( this.isFacade )
|
if( this.isFacade() )
|
||||||
{
|
{
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
@@ -586,7 +587,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
|
|
||||||
final int out = ( high << 16 ) | low;
|
final int out = ( high << 16 ) | low;
|
||||||
|
|
||||||
Tessellator.instance.setColorRGBA_F( r, g, b, this.opacity );
|
Tessellator.instance.setColorRGBA_F( r, g, b, this.getOpacity() );
|
||||||
Tessellator.instance.setBrightness( out );
|
Tessellator.instance.setBrightness( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,9 +627,68 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
|||||||
return new LightingCache( this.lightState );
|
return new LightingCache( this.lightState );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<ForgeDirection> getFaces()
|
||||||
|
{
|
||||||
|
return this.faces;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFaces( final EnumSet<ForgeDirection> faces )
|
||||||
|
{
|
||||||
|
this.faces = faces;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCalculations()
|
||||||
|
{
|
||||||
|
return this.calculations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCalculations( final boolean calculations )
|
||||||
|
{
|
||||||
|
this.calculations = calculations;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isUseTextures()
|
||||||
|
{
|
||||||
|
return this.useTextures;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setUseTextures( final boolean useTextures )
|
||||||
|
{
|
||||||
|
this.useTextures = useTextures;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFacade()
|
||||||
|
{
|
||||||
|
return this.isFacade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFacade( final boolean isFacade )
|
||||||
|
{
|
||||||
|
this.isFacade = isFacade;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getOpacity()
|
||||||
|
{
|
||||||
|
return this.opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpacity( final float opacity )
|
||||||
|
{
|
||||||
|
this.opacity = opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
private EnumSet<ForgeDirection> getRenderFaces()
|
||||||
|
{
|
||||||
|
return this.renderFaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setRenderFaces( final EnumSet<ForgeDirection> renderFaces )
|
||||||
|
{
|
||||||
|
this.renderFaces = renderFaces;
|
||||||
|
}
|
||||||
|
|
||||||
private static class LightingCache implements ISimplifiedBundle
|
private static class LightingCache implements ISimplifiedBundle
|
||||||
{
|
{
|
||||||
|
|
||||||
public final int[] aoXPos;
|
public final int[] aoXPos;
|
||||||
public final int[] aoXNeg;
|
public final int[] aoXNeg;
|
||||||
public final int[] aoYPos;
|
public final int[] aoYPos;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class SpatialSkyRender extends IRenderHandler
|
|||||||
public void render( final float partialTicks, final WorldClient world, final Minecraft mc )
|
public void render( final float partialTicks, final WorldClient world, final Minecraft mc )
|
||||||
{
|
{
|
||||||
final long now = System.currentTimeMillis();
|
final long now = System.currentTimeMillis();
|
||||||
|
|
||||||
if( now - this.cycle > 2000 )
|
if( now - this.cycle > 2000 )
|
||||||
{
|
{
|
||||||
this.cycle = now;
|
this.cycle = now;
|
||||||
@@ -67,42 +68,37 @@ public class SpatialSkyRender extends IRenderHandler
|
|||||||
fade /= 1000;
|
fade /= 1000;
|
||||||
fade = 0.15f * ( 1.0f - Math.abs( ( fade - 1.0f ) * ( fade - 1.0f ) ) );
|
fade = 0.15f * ( 1.0f - Math.abs( ( fade - 1.0f ) * ( fade - 1.0f ) ) );
|
||||||
|
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
|
||||||
|
|
||||||
GL11.glDisable( GL11.GL_FOG );
|
GL11.glDisable( GL11.GL_FOG );
|
||||||
GL11.glDisable( GL11.GL_ALPHA_TEST );
|
GL11.glDisable( GL11.GL_ALPHA_TEST );
|
||||||
GL11.glDisable( GL11.GL_BLEND );
|
GL11.glDisable( GL11.GL_BLEND );
|
||||||
GL11.glDepthMask( false );
|
GL11.glDepthMask( false );
|
||||||
GL11.glColor4f( 0.0f, 0.0f, 0.0f, 1.0f );
|
GL11.glColor4f( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||||
|
|
||||||
final Tessellator tessellator = Tessellator.instance;
|
final Tessellator tessellator = Tessellator.instance;
|
||||||
|
|
||||||
for( int i = 0; i < 6; ++i )
|
for( int i = 0; i < 6; ++i )
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
if( i == 1 )
|
switch( i )
|
||||||
{
|
{
|
||||||
GL11.glRotatef( 90.0F, 1.0F, 0.0F, 0.0F );
|
case 1:
|
||||||
}
|
GL11.glRotatef( 90.0F, 1.0F, 0.0F, 0.0F );
|
||||||
|
break;
|
||||||
if( i == 2 )
|
case 2:
|
||||||
{
|
GL11.glRotatef( -90.0F, 1.0F, 0.0F, 0.0F );
|
||||||
GL11.glRotatef( -90.0F, 1.0F, 0.0F, 0.0F );
|
break;
|
||||||
}
|
case 3:
|
||||||
|
GL11.glRotatef( 180.0F, 1.0F, 0.0F, 0.0F );
|
||||||
if( i == 3 )
|
break;
|
||||||
{
|
case 4:
|
||||||
GL11.glRotatef( 180.0F, 1.0F, 0.0F, 0.0F );
|
GL11.glRotatef( 90.0F, 0.0F, 0.0F, 1.0F );
|
||||||
}
|
break;
|
||||||
|
case 5:
|
||||||
if( i == 4 )
|
GL11.glRotatef( -90.0F, 0.0F, 0.0F, 1.0F );
|
||||||
{
|
break;
|
||||||
GL11.glRotatef( 90.0F, 0.0F, 0.0F, 1.0F );
|
default:
|
||||||
}
|
break;
|
||||||
|
|
||||||
if( i == 5 )
|
|
||||||
{
|
|
||||||
GL11.glRotatef( -90.0F, 0.0F, 0.0F, 1.0F );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
@@ -112,30 +108,29 @@ public class SpatialSkyRender extends IRenderHandler
|
|||||||
tessellator.addVertexWithUV( 100.0D, -100.0D, 100.0D, 16.0D, 16.0D );
|
tessellator.addVertexWithUV( 100.0D, -100.0D, 100.0D, 16.0D, 16.0D );
|
||||||
tessellator.addVertexWithUV( 100.0D, -100.0D, -100.0D, 16.0D, 0.0D );
|
tessellator.addVertexWithUV( 100.0D, -100.0D, -100.0D, 16.0D, 0.0D );
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glDepthMask( true );
|
|
||||||
|
|
||||||
if( fade > 0.0f )
|
if( fade > 0.0f )
|
||||||
{
|
{
|
||||||
GL11.glDisable( GL11.GL_FOG );
|
|
||||||
GL11.glDisable( GL11.GL_ALPHA_TEST );
|
|
||||||
GL11.glEnable( GL11.GL_BLEND );
|
GL11.glEnable( GL11.GL_BLEND );
|
||||||
GL11.glDepthMask( false );
|
|
||||||
GL11.glEnable( GL11.GL_FOG );
|
|
||||||
GL11.glDisable( GL11.GL_FOG );
|
|
||||||
GL11.glDisable( GL11.GL_ALPHA_TEST );
|
|
||||||
GL11.glDisable( GL11.GL_TEXTURE_2D );
|
GL11.glDisable( GL11.GL_TEXTURE_2D );
|
||||||
|
|
||||||
OpenGlHelper.glBlendFunc( 770, 771, 1, 0 );
|
OpenGlHelper.glBlendFunc( 770, 771, 1, 0 );
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GL11.glDepthMask( false );
|
|
||||||
|
|
||||||
|
GL11.glEnable( GL11.GL_TEXTURE_2D );
|
||||||
GL11.glColor4f( fade, fade, fade, 1.0f );
|
GL11.glColor4f( fade, fade, fade, 1.0f );
|
||||||
GL11.glCallList( this.dspList );
|
GL11.glCallList( this.dspList );
|
||||||
|
|
||||||
|
RenderHelper.enableStandardItemLighting();
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopAttrib();
|
GL11.glEnable( GL11.GL_FOG );
|
||||||
|
GL11.glEnable( GL11.GL_ALPHA_TEST );
|
||||||
|
GL11.glEnable( GL11.GL_BLEND );
|
||||||
|
GL11.glDepthMask( true );
|
||||||
|
|
||||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||||
}
|
}
|
||||||
@@ -159,6 +154,7 @@ public class SpatialSkyRender extends IRenderHandler
|
|||||||
iX *= dist;
|
iX *= dist;
|
||||||
iY *= dist;
|
iY *= dist;
|
||||||
iZ *= dist;
|
iZ *= dist;
|
||||||
|
|
||||||
final double x = iX * 100.0D;
|
final double x = iX * 100.0D;
|
||||||
final double y = iY * 100.0D;
|
final double y = iY * 100.0D;
|
||||||
final double z = iZ * 100.0D;
|
final double z = iZ * 100.0D;
|
||||||
@@ -183,6 +179,7 @@ public class SpatialSkyRender extends IRenderHandler
|
|||||||
final double d23 = d17 * d12 - d20 * d13;
|
final double d23 = d17 * d12 - d20 * d13;
|
||||||
final double d24 = d23 * d9 - d21 * d10;
|
final double d24 = d23 * d9 - d21 * d10;
|
||||||
final double d25 = d21 * d9 + d23 * d10;
|
final double d25 = d21 * d9 + d23 * d10;
|
||||||
|
|
||||||
tessellator.addVertex( x + d24, y + d22, z + d25 );
|
tessellator.addVertex( x + d24, y + d22, z + d25 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import appeng.tile.AEBaseTile;
|
|||||||
public class TESRWrapper extends TileEntitySpecialRenderer
|
public class TESRWrapper extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
|
|
||||||
public final RenderBlocks renderBlocksInstance = new RenderBlocks();
|
private final RenderBlocks renderBlocksInstance = new RenderBlocks();
|
||||||
|
|
||||||
private final BaseBlockRender blkRender;
|
private final BaseBlockRender blkRender;
|
||||||
private final double maxDistance;
|
private final double maxDistance;
|
||||||
@@ -77,9 +77,9 @@ public class TESRWrapper extends TileEntitySpecialRenderer
|
|||||||
}
|
}
|
||||||
catch( final Throwable t )
|
catch( final Throwable t )
|
||||||
{
|
{
|
||||||
AELog.severe( "Hi, Looks like there was a crash while rendering something..." );
|
AELog.error( "Hi, Looks like there was a crash while rendering something..." );
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
AELog.severe( "MC will now crash ( probably )!" );
|
AELog.error( "MC will now crash ( probably )!" );
|
||||||
throw new IllegalStateException( t );
|
throw new IllegalStateException( t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package appeng.client.render;
|
|||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
@@ -41,10 +42,10 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
|
|||||||
{
|
{
|
||||||
|
|
||||||
public static final WorldRender INSTANCE = new WorldRender();
|
public static final WorldRender INSTANCE = new WorldRender();
|
||||||
public final HashMap<AEBaseBlock, BaseBlockRender> blockRenders = new HashMap<AEBaseBlock, BaseBlockRender>();
|
private final Map<AEBaseBlock, BaseBlockRender> blockRenders = new HashMap<AEBaseBlock, BaseBlockRender>();
|
||||||
final int renderID = RenderingRegistry.getNextAvailableRenderId();
|
private final int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||||
private final RenderBlocks renderer = new RenderBlocks();
|
private final RenderBlocks renderer = new RenderBlocks();
|
||||||
boolean hasError = false;
|
private boolean hasError = false;
|
||||||
|
|
||||||
private WorldRender()
|
private WorldRender()
|
||||||
{
|
{
|
||||||
@@ -83,10 +84,10 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
|
|||||||
|
|
||||||
private BaseBlockRender getRender( final AEBaseBlock block )
|
private BaseBlockRender getRender( final AEBaseBlock block )
|
||||||
{
|
{
|
||||||
return block.getRendererInstance().rendererInstance;
|
return block.getRendererInstance().getRendererInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderItemBlock( final ItemStack item, final ItemRenderType type, final Object[] data )
|
void renderItemBlock( final ItemStack item, final ItemRenderType type, final Object[] data )
|
||||||
{
|
{
|
||||||
final Block blk = Block.getBlockFromItem( item.getItem() );
|
final Block blk = Block.getBlockFromItem( item.getItem() );
|
||||||
if( blk instanceof AEBaseBlock )
|
if( blk instanceof AEBaseBlock )
|
||||||
@@ -103,9 +104,9 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
|
|||||||
if( !this.hasError )
|
if( !this.hasError )
|
||||||
{
|
{
|
||||||
this.hasError = true;
|
this.hasError = true;
|
||||||
AELog.severe( "Invalid render - item/block mismatch" );
|
AELog.error( "Invalid render - item/block mismatch" );
|
||||||
AELog.severe( " item: " + item.getUnlocalizedName() );
|
AELog.error( " item: " + item.getUnlocalizedName() );
|
||||||
AELog.severe( " block: " + blk.getUnlocalizedName() );
|
AELog.error( " block: " + blk.getUnlocalizedName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
|
|||||||
{
|
{
|
||||||
final TileMolecularAssembler tma = maBlock.getTileEntity( world, x, y, z );
|
final TileMolecularAssembler tma = maBlock.getTileEntity( world, x, y, z );
|
||||||
|
|
||||||
if( BlockMolecularAssembler.booleanAlphaPass )
|
if( BlockMolecularAssembler.isBooleanAlphaPass() )
|
||||||
{
|
{
|
||||||
if( tma.isPowered() )
|
if( tma.isPowered() )
|
||||||
{
|
{
|
||||||
@@ -126,14 +126,14 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
|
BusRenderer.INSTANCE.getRenderer().blockAccess = renderer.blockAccess;
|
||||||
renderer = BusRenderer.INSTANCE.renderer;
|
renderer = BusRenderer.INSTANCE.getRenderer();
|
||||||
|
|
||||||
this.preRenderInWorld( maBlock, world, x, y, z, renderer );
|
this.preRenderInWorld( maBlock, world, x, y, z, renderer );
|
||||||
|
|
||||||
tma.lightCache = BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.lightCache );
|
tma.setLightCache( BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.getLightCache() ) );
|
||||||
|
|
||||||
BusRenderer.INSTANCE.renderer.isFacade = true;
|
BusRenderer.INSTANCE.getRenderer().setFacade( true );
|
||||||
final IOrientable te = this.getOrientable( maBlock, world, x, y, z );
|
final IOrientable te = this.getOrientable( maBlock, world, x, y, z );
|
||||||
|
|
||||||
final ForgeDirection fdy = te.getUp();
|
final ForgeDirection fdy = te.getUp();
|
||||||
@@ -192,53 +192,59 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
|
|||||||
maBlock.getRendererInstance().setTemporaryRenderIcon( null );
|
maBlock.getRendererInstance().setTemporaryRenderIcon( null );
|
||||||
|
|
||||||
renderer.renderAllFaces = false;
|
renderer.renderAllFaces = false;
|
||||||
BusRenderer.INSTANCE.renderer.isFacade = false;
|
BusRenderer.INSTANCE.getRenderer().setFacade( false );
|
||||||
|
|
||||||
this.postRenderInWorld( renderer );
|
this.postRenderInWorld( renderer );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderCableAt( final double thickness, final IBlockAccess world, final int x, final int y, final int z, final BlockMolecularAssembler block, final RenderBlocks renderer, final double pull, final boolean covered )
|
private void renderCableAt( final double thickness, final IBlockAccess world, final int x, final int y, final int z, final BlockMolecularAssembler block, final RenderBlocks renderer, final double pull, final boolean covered )
|
||||||
{
|
{
|
||||||
IIcon texture = null;
|
IIcon texture = null;
|
||||||
|
|
||||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) );
|
texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered );
|
||||||
|
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.0D, 0.5D - thickness, 0.5D - thickness, 0.5D - thickness - pull, 0.5D + thickness, 0.5D + thickness );
|
renderer.setRenderBounds( 0.0D, 0.5D - thickness, 0.5D - thickness, 0.5D - thickness - pull, 0.5D + thickness, 0.5D + thickness );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) );
|
texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered );
|
||||||
|
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.5D + thickness + pull, 0.5D - thickness, 0.5D - thickness, 1.0D, 0.5D + thickness, 0.5D + thickness );
|
renderer.setRenderBounds( 0.5D + thickness + pull, 0.5D - thickness, 0.5D - thickness, 1.0D, 0.5D + thickness, 0.5D + thickness );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) );
|
texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered );
|
||||||
|
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.0D, 0.5D + thickness, 0.5D + thickness, 0.5D - thickness - pull );
|
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.0D, 0.5D + thickness, 0.5D + thickness, 0.5D - thickness - pull );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) );
|
texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered );
|
||||||
|
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.5D + thickness + pull, 0.5D + thickness, 0.5D + thickness, 1.0D );
|
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.5D + thickness + pull, 0.5D + thickness, 0.5D + thickness, 1.0D );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) );
|
texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered );
|
||||||
|
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.5D - thickness, 0.0D, 0.5D - thickness, 0.5D + thickness, 0.5D - thickness - pull, 0.5D + thickness );
|
renderer.setRenderBounds( 0.5D - thickness, 0.0D, 0.5D - thickness, 0.5D + thickness, 0.5D - thickness - pull, 0.5D + thickness );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) );
|
texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered );
|
||||||
|
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||||
if( texture != null )
|
if( texture != null )
|
||||||
{
|
{
|
||||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D + thickness + pull, 0.5D - thickness, 0.5D + thickness, 1.0D, 0.5D + thickness );
|
renderer.setRenderBounds( 0.5D - thickness, 0.5D + thickness + pull, 0.5D - thickness, 0.5D + thickness, 1.0D, 0.5D + thickness );
|
||||||
@@ -248,9 +254,10 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
|
|||||||
block.getRendererInstance().setTemporaryRenderIcon( null );
|
block.getRendererInstance().setTemporaryRenderIcon( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
IIcon getConnectedCable( final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection side, final boolean covered )
|
private IIcon getConnectedCable( final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection side, final boolean covered )
|
||||||
{
|
{
|
||||||
final int tileYPos = y + side.offsetY;
|
final int tileYPos = y + side.offsetY;
|
||||||
|
|
||||||
if( -1 < tileYPos && tileYPos < 256 )
|
if( -1 < tileYPos && tileYPos < 256 )
|
||||||
{
|
{
|
||||||
final TileEntity ne = world.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
final TileEntity ne = world.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||||
@@ -258,9 +265,11 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
|
|||||||
{
|
{
|
||||||
final IPartHost ph = (IPartHost) ne;
|
final IPartHost ph = (IPartHost) ne;
|
||||||
final IPart pcx = ph.getPart( ForgeDirection.UNKNOWN );
|
final IPart pcx = ph.getPart( ForgeDirection.UNKNOWN );
|
||||||
|
|
||||||
if( pcx instanceof PartCable )
|
if( pcx instanceof PartCable )
|
||||||
{
|
{
|
||||||
final PartCable pc = (PartCable) pcx;
|
final PartCable pc = (PartCable) pcx;
|
||||||
|
|
||||||
if( pc.isConnected( side.getOpposite() ) )
|
if( pc.isConnected( side.getOpposite() ) )
|
||||||
{
|
{
|
||||||
if( covered )
|
if( covered )
|
||||||
|
|||||||
@@ -124,48 +124,59 @@ public class RenderBlockCharger extends BaseBlockRender<BlockCharger, TileCharge
|
|||||||
@Override
|
@Override
|
||||||
public void renderTile( final BlockCharger block, final TileCharger tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
|
public void renderTile( final BlockCharger block, final TileCharger tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
|
if( tile == null )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final ItemStack sis = tile.getStackInSlot( 0 );
|
final ItemStack sis = tile.getStackInSlot( 0 );
|
||||||
|
|
||||||
if( sis != null )
|
if( sis == null )
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
return;
|
||||||
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GL11.glTranslatef( 0.5f, 0.45f, 0.5f );
|
|
||||||
GL11.glScalef( 1.0f / 1.1f, 1.0f / 1.1f, 1.0f / 1.1f );
|
|
||||||
GL11.glScalef( 1.0f, 1.0f, 1.0f );
|
|
||||||
|
|
||||||
final Block blk = Block.getBlockFromItem( sis.getItem() );
|
|
||||||
if( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) )
|
|
||||||
{
|
|
||||||
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
|
|
||||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
|
||||||
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
// << 20 | light << 4;
|
|
||||||
final int br = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );
|
|
||||||
final int var11 = br % 65536;
|
|
||||||
final int var12 = br / 65536;
|
|
||||||
|
|
||||||
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
|
|
||||||
|
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
|
||||||
|
|
||||||
GL11.glDisable( GL11.GL_LIGHTING );
|
|
||||||
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
|
||||||
tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
|
||||||
|
|
||||||
this.doRenderItem( sis, tile );
|
|
||||||
}
|
|
||||||
catch( final Exception err )
|
|
||||||
{
|
|
||||||
AELog.error( err );
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
GL11.glTranslatef( 0.5f, 0.45f, 0.5f );
|
||||||
|
GL11.glScalef( 1.0f / 1.1f, 1.0f / 1.1f, 1.0f / 1.1f );
|
||||||
|
GL11.glScalef( 1.0f, 1.0f, 1.0f );
|
||||||
|
|
||||||
|
final Block blk = Block.getBlockFromItem( sis.getItem() );
|
||||||
|
|
||||||
|
if( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) )
|
||||||
|
{
|
||||||
|
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
|
||||||
|
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
||||||
|
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
|
||||||
|
}
|
||||||
|
final int br = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );
|
||||||
|
final int var11 = br % 65536;
|
||||||
|
final int var12 = br / 65536;
|
||||||
|
|
||||||
|
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
|
||||||
|
|
||||||
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
|
||||||
|
GL11.glDisable( GL11.GL_LIGHTING );
|
||||||
|
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
||||||
|
tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
||||||
|
|
||||||
|
this.doRenderItem( sis, tile );
|
||||||
|
}
|
||||||
|
catch( final Exception err )
|
||||||
|
{
|
||||||
|
AELog.debug( err );
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
|
||||||
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public class RenderBlockController extends BaseBlockRender<BlockController, Tile
|
|||||||
else if( ( xx ? 1 : 0 ) + ( yy ? 1 : 0 ) + ( zz ? 1 : 0 ) >= 2 )
|
else if( ( xx ? 1 : 0 ) + ( yy ? 1 : 0 ) + ( zz ? 1 : 0 ) >= 2 )
|
||||||
{
|
{
|
||||||
final int v = ( Math.abs( x ) + Math.abs( y ) + Math.abs( z ) ) % 2;
|
final int v = ( Math.abs( x ) + Math.abs( y ) + Math.abs( z ) ) % 2;
|
||||||
|
|
||||||
renderer.uvRotateEast = renderer.uvRotateBottom = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
renderer.uvRotateEast = renderer.uvRotateBottom = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||||
|
|
||||||
if( v == 0 )
|
if( v == 0 )
|
||||||
@@ -140,6 +141,7 @@ public class RenderBlockController extends BaseBlockRender<BlockController, Tile
|
|||||||
if( hasPower )
|
if( hasPower )
|
||||||
{
|
{
|
||||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerPowered.getIcon() );
|
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerPowered.getIcon() );
|
||||||
|
|
||||||
if( isConflict )
|
if( isConflict )
|
||||||
{
|
{
|
||||||
lights = ExtraBlockTextures.BlockControllerConflict;
|
lights = ExtraBlockTextures.BlockControllerConflict;
|
||||||
@@ -156,6 +158,7 @@ public class RenderBlockController extends BaseBlockRender<BlockController, Tile
|
|||||||
}
|
}
|
||||||
|
|
||||||
final boolean out = renderer.renderStandardBlock( blk, x, y, z );
|
final boolean out = renderer.renderStandardBlock( blk, x, y, z );
|
||||||
|
|
||||||
if( lights != null )
|
if( lights != null )
|
||||||
{
|
{
|
||||||
Tessellator.instance.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
Tessellator.instance.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
||||||
|
|||||||
@@ -57,21 +57,20 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
@Override
|
@Override
|
||||||
public boolean renderInWorld( final B blk, final IBlockAccess w, final int x, final int y, final int z, RenderBlocks renderer )
|
public boolean renderInWorld( final B blk, final IBlockAccess w, final int x, final int y, final int z, RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
boolean formed = false;
|
final TileCraftingTile craftingTile = blk.getTileEntity( w, x, y, z );
|
||||||
boolean emitsLight = false;
|
|
||||||
|
|
||||||
final TileCraftingTile ct = blk.getTileEntity( w, x, y, z );
|
if( craftingTile == null )
|
||||||
if( ct != null && ct.isFormed() )
|
|
||||||
{
|
{
|
||||||
formed = true;
|
return false;
|
||||||
emitsLight = ct.isPowered();
|
|
||||||
}
|
}
|
||||||
final int meta = w.getBlockMetadata( x, y, z ) & 3;
|
|
||||||
|
|
||||||
|
final boolean formed = craftingTile.isFormed();
|
||||||
|
final boolean emitsLight = craftingTile.isPowered();
|
||||||
|
final int meta = w.getBlockMetadata( x, y, z ) & 3;
|
||||||
final boolean isMonitor = blk.getClass() == BlockCraftingMonitor.class;
|
final boolean isMonitor = blk.getClass() == BlockCraftingMonitor.class;
|
||||||
final IIcon theIcon = blk.getIcon( ForgeDirection.SOUTH.ordinal(), meta | ( formed ? 8 : 0 ) );
|
final IIcon theIcon = blk.getIcon( ForgeDirection.SOUTH.ordinal(), meta | ( formed ? 8 : 0 ) );
|
||||||
|
|
||||||
IIcon nonForward = theIcon;
|
IIcon nonForward = theIcon;
|
||||||
|
|
||||||
if( isMonitor )
|
if( isMonitor )
|
||||||
{
|
{
|
||||||
for( final Block craftingBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
|
for( final Block craftingBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
|
||||||
@@ -82,9 +81,9 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
|
|
||||||
if( formed && renderer.overrideBlockTexture == null )
|
if( formed && renderer.overrideBlockTexture == null )
|
||||||
{
|
{
|
||||||
renderer = BusRenderer.INSTANCE.renderer;
|
renderer = BusRenderer.INSTANCE.getRenderer();
|
||||||
final BusRenderHelper i = BusRenderHelper.INSTANCE;
|
final BusRenderHelper i = BusRenderHelper.INSTANCE;
|
||||||
BusRenderer.INSTANCE.renderer.isFacade = true;
|
BusRenderer.INSTANCE.getRenderer().setFacade( true );
|
||||||
|
|
||||||
renderer.blockAccess = w;
|
renderer.blockAccess = w;
|
||||||
i.setPass( 0 );
|
i.setPass( 0 );
|
||||||
@@ -92,7 +91,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ct.lightCache = i.useSimplifiedRendering( x, y, z, null, ct.lightCache );
|
craftingTile.setLightCache( i.useSimplifiedRendering( x, y, z, null, craftingTile.getLightCache() ) );
|
||||||
}
|
}
|
||||||
catch( final Throwable ignored )
|
catch( final Throwable ignored )
|
||||||
{
|
{
|
||||||
@@ -122,16 +121,17 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
i.setBounds( this.fso( side, lowX, ForgeDirection.WEST ), this.fso( side, lowY, ForgeDirection.DOWN ), this.fso( side, lowZ, ForgeDirection.NORTH ), this.fso( side, highX, ForgeDirection.EAST ), this.fso( side, highY, ForgeDirection.UP ), this.fso( side, highZ, ForgeDirection.SOUTH ) );
|
i.setBounds( this.fso( side, lowX, ForgeDirection.WEST ), this.fso( side, lowY, ForgeDirection.DOWN ), this.fso( side, lowZ, ForgeDirection.NORTH ), this.fso( side, highX, ForgeDirection.EAST ), this.fso( side, highY, ForgeDirection.UP ), this.fso( side, highZ, ForgeDirection.SOUTH ) );
|
||||||
i.prepareBounds( renderer );
|
i.prepareBounds( renderer );
|
||||||
|
|
||||||
boolean LocalEmit = emitsLight;
|
boolean localEmit = emitsLight;
|
||||||
if( blk instanceof BlockCraftingMonitor && ct.getForward() != side )
|
|
||||||
|
if( blk instanceof BlockCraftingMonitor && craftingTile.getForward() != side )
|
||||||
{
|
{
|
||||||
LocalEmit = false;
|
localEmit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.handleSide( blk, meta, x, y, z, i, renderer, ct.getForward() == side ? theIcon : nonForward, LocalEmit, isMonitor, side, w );
|
this.handleSide( blk, meta, x, y, z, i, renderer, craftingTile.getForward() == side ? theIcon : nonForward, localEmit, isMonitor, side, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
BusRenderer.INSTANCE.renderer.isFacade = false;
|
BusRenderer.INSTANCE.getRenderer().setFacade( false );
|
||||||
i.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) );
|
i.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) );
|
||||||
i.normalRendering();
|
i.normalRendering();
|
||||||
|
|
||||||
@@ -150,6 +150,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
private boolean isConnected( final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side )
|
private boolean isConnected( final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection side )
|
||||||
{
|
{
|
||||||
final int tileYPos = y + side.offsetY;
|
final int tileYPos = y + side.offsetY;
|
||||||
|
|
||||||
if( 0 <= tileYPos && tileYPos <= 255 )
|
if( 0 <= tileYPos && tileYPos <= 255 )
|
||||||
{
|
{
|
||||||
final TileEntity tile = w.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
final TileEntity tile = w.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||||
@@ -164,15 +165,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
|
|
||||||
private void renderCorner( final BusRenderHelper i, final RenderBlocks renderer, final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection up, final ForgeDirection east, final ForgeDirection south )
|
private void renderCorner( final BusRenderHelper i, final RenderBlocks renderer, final IBlockAccess w, final int x, final int y, final int z, final ForgeDirection up, final ForgeDirection east, final ForgeDirection south )
|
||||||
{
|
{
|
||||||
if( this.isConnected( w, x, y, z, up ) )
|
if( this.isConnected( w, x, y, z, up ) || this.isConnected( w, x, y, z, east ) || this.isConnected( w, x, y, z, south ) )
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if( this.isConnected( w, x, y, z, east ) )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if( this.isConnected( w, x, y, z, south ) )
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -303,6 +296,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
|
|||||||
if( !( i.getBound( a ) < 0.001 || i.getBound( a ) > 15.999 ) )
|
if( !( i.getBound( a ) < 0.001 || i.getBound( a ) > 15.999 ) )
|
||||||
{
|
{
|
||||||
final double width = 3.0 / 16.0;
|
final double width = 3.0 / 16.0;
|
||||||
|
|
||||||
switch( a )
|
switch( a )
|
||||||
{
|
{
|
||||||
case DOWN:
|
case DOWN:
|
||||||
|
|||||||
@@ -63,27 +63,26 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
|
|||||||
{
|
{
|
||||||
final IAEItemStack ais = tile.getJobProgress();
|
final IAEItemStack ais = tile.getJobProgress();
|
||||||
|
|
||||||
if( tile.dspList == null )
|
if( tile.getDisplayList() == null )
|
||||||
{
|
{
|
||||||
tile.updateList = true;
|
tile.setUpdateList( true );
|
||||||
tile.dspList = GLAllocation.generateDisplayLists( 1 );
|
tile.setDisplayList( GLAllocation.generateDisplayLists( 1 ) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if( ais != null )
|
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
|
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
|
||||||
|
|
||||||
if( tile.updateList )
|
if( tile.isUpdateList() )
|
||||||
{
|
{
|
||||||
tile.updateList = false;
|
tile.setUpdateList( false );
|
||||||
GL11.glNewList( tile.dspList, GL11.GL_COMPILE_AND_EXECUTE );
|
GL11.glNewList( tile.getDisplayList(), GL11.GL_COMPILE_AND_EXECUTE );
|
||||||
this.tesrRenderScreen( tess, tile, ais );
|
this.tesrRenderScreen( tess, tile, ais );
|
||||||
GL11.glEndList();
|
GL11.glEndList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GL11.glCallList( tile.dspList );
|
GL11.glCallList( tile.getDisplayList() );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
@@ -97,8 +96,8 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
|
|||||||
|
|
||||||
ForgeDirection walrus = side.offsetY != 0 ? ForgeDirection.SOUTH : ForgeDirection.UP;
|
ForgeDirection walrus = side.offsetY != 0 ? ForgeDirection.SOUTH : ForgeDirection.UP;
|
||||||
int spin = 0;
|
int spin = 0;
|
||||||
|
|
||||||
int max = 5;
|
int max = 5;
|
||||||
|
|
||||||
while( walrus != cmt.getUp() && max > 0 )
|
while( walrus != cmt.getUp() && max > 0 )
|
||||||
{
|
{
|
||||||
max--;
|
max--;
|
||||||
@@ -107,50 +106,43 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
|
|||||||
}
|
}
|
||||||
max--;
|
max--;
|
||||||
|
|
||||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
|
||||||
GL11.glTranslated( side.offsetX * 0.69, side.offsetY * 0.69, side.offsetZ * 0.69 );
|
GL11.glTranslated( side.offsetX * 0.69, side.offsetY * 0.69, side.offsetZ * 0.69 );
|
||||||
|
|
||||||
final float scale = 0.7f;
|
final float scale = 0.7f;
|
||||||
GL11.glScalef( scale, scale, scale );
|
GL11.glScalef( scale, scale, scale );
|
||||||
|
|
||||||
if( side == ForgeDirection.UP )
|
switch( side )
|
||||||
{
|
{
|
||||||
GL11.glScalef( 1.0f, -1.0f, 1.0f );
|
case UP:
|
||||||
GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );
|
GL11.glScalef( 1.0f, -1.0f, 1.0f );
|
||||||
GL11.glRotatef( spin * 90.0F, 0, 0, 1 );
|
GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );
|
||||||
|
GL11.glRotatef( spin * 90.0F, 0, 0, 1 );
|
||||||
|
break;
|
||||||
|
case DOWN:
|
||||||
|
GL11.glScalef( 1.0f, -1.0f, 1.0f );
|
||||||
|
GL11.glRotatef( -90.0f, 1.0f, 0.0f, 0.0f );
|
||||||
|
GL11.glRotatef( spin * -90.0F, 0, 0, 1 );
|
||||||
|
break;
|
||||||
|
case EAST:
|
||||||
|
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||||
|
GL11.glRotatef( -90.0f, 0.0f, 1.0f, 0.0f );
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||||
|
GL11.glRotatef( 90.0f, 0.0f, 1.0f, 0.0f );
|
||||||
|
break;
|
||||||
|
case NORTH:
|
||||||
|
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||||
|
break;
|
||||||
|
case SOUTH:
|
||||||
|
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||||
|
GL11.glRotatef( 180.0f, 0.0f, 1.0f, 0.0f );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( side == ForgeDirection.DOWN )
|
|
||||||
{
|
|
||||||
GL11.glScalef( 1.0f, -1.0f, 1.0f );
|
|
||||||
GL11.glRotatef( -90.0f, 1.0f, 0.0f, 0.0f );
|
|
||||||
GL11.glRotatef( spin * -90.0F, 0, 0, 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( side == ForgeDirection.EAST )
|
|
||||||
{
|
|
||||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
|
||||||
GL11.glRotatef( -90.0f, 0.0f, 1.0f, 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( side == ForgeDirection.WEST )
|
|
||||||
{
|
|
||||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
|
||||||
GL11.glRotatef( 90.0f, 0.0f, 1.0f, 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( side == ForgeDirection.NORTH )
|
|
||||||
{
|
|
||||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( side == ForgeDirection.SOUTH )
|
|
||||||
{
|
|
||||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
|
||||||
GL11.glRotatef( 180.0f, 0.0f, 1.0f, 0.0f );
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final ItemStack sis = ais.getItemStack();
|
final ItemStack sis = ais.getItemStack();
|
||||||
@@ -159,6 +151,7 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
|
|||||||
final int br = 16 << 20 | 16 << 4;
|
final int br = 16 << 20 | 16 << 4;
|
||||||
final int var11 = br % 65536;
|
final int var11 = br % 65536;
|
||||||
final int var12 = br / 65536;
|
final int var12 = br / 65536;
|
||||||
|
|
||||||
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11 * 0.8F, var12 * 0.8F );
|
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11 * 0.8F, var12 * 0.8F );
|
||||||
|
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
@@ -172,10 +165,13 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
|
|||||||
}
|
}
|
||||||
catch( final Exception e )
|
catch( final Exception e )
|
||||||
{
|
{
|
||||||
AELog.error( e );
|
AELog.debug( e );
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
|
||||||
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
|
|
||||||
GL11.glTranslatef( 0.0f, 0.14f, -0.24f );
|
GL11.glTranslatef( 0.0f, 0.14f, -0.24f );
|
||||||
GL11.glScalef( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
|
GL11.glScalef( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
|
||||||
@@ -185,9 +181,8 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
|
|||||||
|
|
||||||
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||||
final int width = fr.getStringWidth( renderedStackSize );
|
final int width = fr.getStringWidth( renderedStackSize );
|
||||||
|
|
||||||
GL11.glTranslatef( -0.5f * width, 0.0f, -1.0f );
|
GL11.glTranslatef( -0.5f * width, 0.0f, -1.0f );
|
||||||
fr.drawString( renderedStackSize, 0, 0, 0 );
|
fr.drawString( renderedStackSize, 0, 0, 0 );
|
||||||
|
|
||||||
GL11.glPopAttrib();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ public class RenderBlockCrank extends BaseBlockRender<BlockCrank, TileCrank>
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture );
|
Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture );
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
|
|
||||||
@@ -84,12 +83,13 @@ public class RenderBlockCrank extends BaseBlockRender<BlockCrank, TileCrank>
|
|||||||
GL11.glShadeModel( GL11.GL_FLAT );
|
GL11.glShadeModel( GL11.GL_FLAT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.glCullFace( GL11.GL_FRONT );
|
||||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||||
|
|
||||||
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
||||||
|
|
||||||
GL11.glTranslated( 0.5, 0, 0.5 );
|
GL11.glTranslated( 0.5, 0, 0.5 );
|
||||||
GL11.glRotatef( tile.visibleRotation, 0, 1, 0 );
|
GL11.glRotatef( tile.getVisibleRotation(), 0, 1, 0 );
|
||||||
GL11.glTranslated( -0.5, 0, -0.5 );
|
GL11.glTranslated( -0.5, 0, -0.5 );
|
||||||
|
|
||||||
tess.setTranslation( -tile.xCoord, -tile.yCoord, -tile.zCoord );
|
tess.setTranslation( -tile.xCoord, -tile.yCoord, -tile.zCoord );
|
||||||
@@ -107,6 +107,9 @@ public class RenderBlockCrank extends BaseBlockRender<BlockCrank, TileCrank>
|
|||||||
|
|
||||||
tess.draw();
|
tess.draw();
|
||||||
tess.setTranslation( 0, 0, 0 );
|
tess.setTranslation( 0, 0, 0 );
|
||||||
|
|
||||||
|
GL11.glCullFace( GL11.GL_BACK );
|
||||||
|
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public class RenderBlockEnergyCube extends BaseBlockRender<BlockEnergyCell, Tile
|
|||||||
final int meta = world.getBlockMetadata( x, y, z );
|
final int meta = world.getBlockMetadata( x, y, z );
|
||||||
|
|
||||||
renderer.overrideBlockTexture = blk.getIcon( 0, meta );
|
renderer.overrideBlockTexture = blk.getIcon( 0, meta );
|
||||||
|
|
||||||
final boolean out = renderer.renderStandardBlock( blk, x, y, z );
|
final boolean out = renderer.renderStandardBlock( blk, x, y, z );
|
||||||
renderer.overrideBlockTexture = null;
|
renderer.overrideBlockTexture = null;
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import appeng.util.Platform;
|
|||||||
*/
|
*/
|
||||||
public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileInscriber>
|
public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileInscriber>
|
||||||
{
|
{
|
||||||
|
private static final float ITEM_RENDER_SCALE = 1.0f / 1.1f;
|
||||||
|
|
||||||
public RenderBlockInscriber()
|
public RenderBlockInscriber()
|
||||||
{
|
{
|
||||||
@@ -106,14 +107,15 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
|
|||||||
@Override
|
@Override
|
||||||
public boolean renderInWorld( final BlockInscriber block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
public boolean renderInWorld( final BlockInscriber block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
this.preRenderInWorld( block, world, x, y, z, renderer );
|
|
||||||
|
|
||||||
final IOrientable te = this.getOrientable( block, world, x, y, z );
|
final IOrientable te = this.getOrientable( block, world, x, y, z );
|
||||||
|
|
||||||
if( te == null )
|
if( te == null )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.preRenderInWorld( block, world, x, y, z, renderer );
|
||||||
|
|
||||||
final ForgeDirection fdy = te.getUp();
|
final ForgeDirection fdy = te.getUp();
|
||||||
final ForgeDirection fdz = te.getForward();
|
final ForgeDirection fdz = te.getForward();
|
||||||
final ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite();
|
final ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite();
|
||||||
@@ -149,12 +151,16 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
|
|||||||
@Override
|
@Override
|
||||||
public void renderTile( final BlockInscriber block, final TileInscriber tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
|
public void renderTile( final BlockInscriber block, final TileInscriber tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
|
// render inscriber
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
||||||
|
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
GL11.glDisable( GL11.GL_LIGHTING );
|
GL11.glDisable( GL11.GL_LIGHTING );
|
||||||
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
||||||
|
|
||||||
|
// render sides of stamps
|
||||||
GL11.glCullFace( GL11.GL_FRONT );
|
GL11.glCullFace( GL11.GL_FRONT );
|
||||||
|
|
||||||
final Minecraft mc = Minecraft.getMinecraft();
|
final Minecraft mc = Minecraft.getMinecraft();
|
||||||
@@ -169,13 +175,13 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
|
|||||||
|
|
||||||
long absoluteProgress = 0;
|
long absoluteProgress = 0;
|
||||||
|
|
||||||
if( tile.smash )
|
if( tile.isSmash() )
|
||||||
{
|
{
|
||||||
final long currentTime = System.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
absoluteProgress = currentTime - tile.clientStart;
|
absoluteProgress = currentTime - tile.getClientStart();
|
||||||
if( absoluteProgress > 800 )
|
if( absoluteProgress > 800 )
|
||||||
{
|
{
|
||||||
tile.smash = false;
|
tile.setSmash( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,11 +225,11 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
|
|||||||
|
|
||||||
tess.draw();
|
tess.draw();
|
||||||
|
|
||||||
GL11.glCullFace( GL11.GL_BACK );
|
|
||||||
GL11.glEnable( GL11.GL_LIGHTING );
|
|
||||||
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
// render items.
|
||||||
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
|
||||||
int items = 0;
|
int items = 0;
|
||||||
if( tile.getStackInSlot( 0 ) != null )
|
if( tile.getStackInSlot( 0 ) != null )
|
||||||
{
|
{
|
||||||
@@ -259,32 +265,45 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
|
|||||||
this.renderItem( tile.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer );
|
this.renderItem( tile.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer );
|
||||||
this.renderItem( tile.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer );
|
this.renderItem( tile.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.glEnable( GL11.GL_LIGHTING );
|
||||||
|
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
|
||||||
|
GL11.glCullFace( GL11.GL_BACK );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderItem( ItemStack sis, final float o, final AEBaseBlock block, final AEBaseTile tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
|
private void renderItem( ItemStack sis, final float o, final AEBaseBlock block, final AEBaseTile tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
if( sis != null )
|
if( sis != null )
|
||||||
{
|
{
|
||||||
sis = sis.copy();
|
sis = sis.copy();
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
// fix to inscriber
|
||||||
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// move to center
|
||||||
GL11.glTranslatef( 0.5f, 0.5f + o, 0.5f );
|
GL11.glTranslatef( 0.5f, 0.5f + o, 0.5f );
|
||||||
GL11.glScalef( 1.0f / 1.1f, 1.0f / 1.1f, 1.0f / 1.1f );
|
|
||||||
GL11.glScalef( 1.0f, 1.0f, 1.0f );
|
// set scale
|
||||||
|
GL11.glScalef( ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE );
|
||||||
|
|
||||||
final Block blk = Block.getBlockFromItem( sis.getItem() );
|
final Block blk = Block.getBlockFromItem( sis.getItem() );
|
||||||
|
|
||||||
|
// is a block
|
||||||
if( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) )
|
if( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) )
|
||||||
{
|
{
|
||||||
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
|
// rotate block in angle to make it more plastic
|
||||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
GL11.glRotatef( 22.5f, 1f, 0f, 0f );
|
||||||
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
|
GL11.glRotatef( -33.75f, 0f, 1f, 0f );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// rotate item to match the inventory icon orientation.
|
||||||
|
GL11.glRotatef( -90.0f, 1f, 0f, 0f );
|
||||||
|
GL11.glRotatef( 180.0f, 0f, 1f, 0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glRotatef( 90.0f, 1, 0, 0 );
|
|
||||||
|
|
||||||
// << 20 | light << 4;
|
// << 20 | light << 4;
|
||||||
final int br = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );
|
final int br = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );
|
||||||
@@ -293,17 +312,13 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
|
|||||||
|
|
||||||
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
|
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
|
||||||
|
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
|
||||||
|
|
||||||
GL11.glDisable( GL11.GL_LIGHTING );
|
|
||||||
GL11.glDisable( GL12.GL_RESCALE_NORMAL );
|
|
||||||
tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
||||||
|
|
||||||
this.doRenderItem( sis, tile );
|
this.doRenderItem( sis, tile );
|
||||||
}
|
}
|
||||||
catch( final Exception err )
|
catch( final Exception err )
|
||||||
{
|
{
|
||||||
AELog.error( err );
|
AELog.debug( err );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
|
|||||||
{
|
{
|
||||||
final TilePaint tp = imb.getTileEntity( world, x, y, z );
|
final TilePaint tp = imb.getTileEntity( world, x, y, z );
|
||||||
boolean out = false;
|
boolean out = false;
|
||||||
|
|
||||||
if( tp != null )
|
if( tp != null )
|
||||||
{
|
{
|
||||||
// super.renderInWorld( imb, world, x, y, z, renderer );
|
// super.renderInWorld( imb, world, x, y, z, renderer );
|
||||||
@@ -79,19 +80,19 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
|
|||||||
final int lumen = 14 << 20 | 14 << 4;
|
final int lumen = 14 << 20 | 14 << 4;
|
||||||
for( final Splotch s : tp.getDots() )
|
for( final Splotch s : tp.getDots() )
|
||||||
{
|
{
|
||||||
if( !validSides.contains( s.side ) )
|
if( !validSides.contains( s.getSide() ) )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( s.lumen )
|
if( s.isLumen() )
|
||||||
{
|
{
|
||||||
tess.setColorOpaque_I( s.color.whiteVariant );
|
tess.setColorOpaque_I( s.getColor().whiteVariant );
|
||||||
tess.setBrightness( lumen );
|
tess.setBrightness( lumen );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tess.setColorOpaque_I( s.color.mediumVariant );
|
tess.setColorOpaque_I( s.getColor().mediumVariant );
|
||||||
tess.setBrightness( brightness );
|
tess.setBrightness( brightness );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,13 +107,13 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
|
|||||||
pos_x = Math.max( buffer, Math.min( 1.0 - buffer, pos_x ) );
|
pos_x = Math.max( buffer, Math.min( 1.0 - buffer, pos_x ) );
|
||||||
pos_y = Math.max( buffer, Math.min( 1.0 - buffer, pos_y ) );
|
pos_y = Math.max( buffer, Math.min( 1.0 - buffer, pos_y ) );
|
||||||
|
|
||||||
if( s.side == ForgeDirection.SOUTH || s.side == ForgeDirection.NORTH )
|
if( s.getSide() == ForgeDirection.SOUTH || s.getSide() == ForgeDirection.NORTH )
|
||||||
{
|
{
|
||||||
pos_x += x;
|
pos_x += x;
|
||||||
pos_y += y;
|
pos_y += y;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( s.side == ForgeDirection.UP || s.side == ForgeDirection.DOWN )
|
else if( s.getSide() == ForgeDirection.UP || s.getSide() == ForgeDirection.DOWN )
|
||||||
{
|
{
|
||||||
pos_x += x;
|
pos_x += x;
|
||||||
pos_y += z;
|
pos_y += z;
|
||||||
@@ -126,7 +127,7 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
|
|||||||
|
|
||||||
final IIcon ico = icoSet[s.getSeed() % icoSet.length];
|
final IIcon ico = icoSet[s.getSeed() % icoSet.length];
|
||||||
|
|
||||||
switch( s.side )
|
switch( s.getSide() )
|
||||||
{
|
{
|
||||||
case UP:
|
case UP:
|
||||||
offset = 1.0 - offset;
|
offset = 1.0 - offset;
|
||||||
|
|||||||
@@ -42,17 +42,22 @@ public class RenderBlockQuartzAccelerator extends BaseBlockRender<BlockQuartzGro
|
|||||||
public boolean renderInWorld( final BlockQuartzGrowthAccelerator blk, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
public boolean renderInWorld( final BlockQuartzGrowthAccelerator blk, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
final TileEntity te = world.getTileEntity( x, y, z );
|
final TileEntity te = world.getTileEntity( x, y, z );
|
||||||
|
|
||||||
if( te instanceof TileQuartzGrowthAccelerator )
|
if( te instanceof TileQuartzGrowthAccelerator )
|
||||||
{
|
{
|
||||||
if( ( (TileQuartzGrowthAccelerator) te ).hasPower )
|
final TileQuartzGrowthAccelerator tileCGA = (TileQuartzGrowthAccelerator) te;
|
||||||
|
|
||||||
|
if( tileCGA.isPowered() )
|
||||||
{
|
{
|
||||||
final IIcon top_Bottom = ExtraBlockTextures.BlockQuartzGrowthAcceleratorOn.getIcon();
|
final IIcon top_Bottom = ExtraBlockTextures.BlockQuartzGrowthAcceleratorOn.getIcon();
|
||||||
final IIcon side = ExtraBlockTextures.BlockQuartzGrowthAcceleratorSideOn.getIcon();
|
final IIcon side = ExtraBlockTextures.BlockQuartzGrowthAcceleratorSideOn.getIcon();
|
||||||
|
|
||||||
blk.getRendererInstance().setTemporaryRenderIcons( top_Bottom, top_Bottom, side, side, side, side );
|
blk.getRendererInstance().setTemporaryRenderIcons( top_Bottom, top_Bottom, side, side, side, side );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean out = super.renderInWorld( blk, world, x, y, z, renderer );
|
final boolean out = super.renderInWorld( blk, world, x, y, z, renderer );
|
||||||
|
|
||||||
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|||||||
@@ -85,12 +85,7 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
|
|||||||
@Override
|
@Override
|
||||||
public void renderTile( final BlockSkyChest block, final TileSkyChest skyChest, final Tessellator tess, final double x, final double y, final double z, final float partialTick, final RenderBlocks renderer )
|
public void renderTile( final BlockSkyChest block, final TileSkyChest skyChest, final Tessellator tess, final double x, final double y, final double z, final float partialTick, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
if( skyChest == null )
|
if( skyChest == null || !skyChest.hasWorldObj() )
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !skyChest.hasWorldObj() )
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,28 +104,28 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
|
|||||||
GL11.glTranslatef( -0.0F, -1.0F, -1.0F );
|
GL11.glTranslatef( -0.0F, -1.0F, -1.0F );
|
||||||
|
|
||||||
final long now = System.currentTimeMillis();
|
final long now = System.currentTimeMillis();
|
||||||
final long distance = now - skyChest.lastEvent;
|
final long distance = now - skyChest.getLastEvent();
|
||||||
|
|
||||||
if( skyChest.playerOpen > 0 )
|
if( skyChest.getPlayerOpen() > 0 )
|
||||||
{
|
{
|
||||||
skyChest.lidAngle += distance * 0.0001;
|
skyChest.setLidAngle( skyChest.getLidAngle() + distance * 0.0001f );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
skyChest.lidAngle -= distance * 0.0001;
|
skyChest.setLidAngle( skyChest.getLidAngle() - distance * 0.0001f );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( skyChest.lidAngle > 0.5f )
|
if( skyChest.getLidAngle() > 0.5f )
|
||||||
{
|
{
|
||||||
skyChest.lidAngle = 0.5f;
|
skyChest.setLidAngle( 0.5f );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( skyChest.lidAngle < 0.0f )
|
if( skyChest.getLidAngle() < 0.0f )
|
||||||
{
|
{
|
||||||
skyChest.lidAngle = 0.0f;
|
skyChest.setLidAngle( 0.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
float lidAngle = skyChest.lidAngle;
|
float lidAngle = skyChest.getLidAngle();
|
||||||
lidAngle = 1.0F - lidAngle;
|
lidAngle = 1.0F - lidAngle;
|
||||||
lidAngle = 1.0F - lidAngle * lidAngle * lidAngle;
|
lidAngle = 1.0F - lidAngle * lidAngle * lidAngle;
|
||||||
|
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ import appeng.tile.misc.TileSkyCompass;
|
|||||||
|
|
||||||
public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, TileSkyCompass>
|
public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, TileSkyCompass>
|
||||||
{
|
{
|
||||||
|
private static final ResourceLocation TEXTURE_SKY_COMPASS = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
|
||||||
|
|
||||||
final ModelCompass model = new ModelCompass();
|
private final ModelCompass model = new ModelCompass();
|
||||||
float r = 0;
|
|
||||||
|
|
||||||
public RenderBlockSkyCompass()
|
public RenderBlockSkyCompass()
|
||||||
{
|
{
|
||||||
@@ -58,8 +58,8 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
if( type == ItemRenderType.INVENTORY )
|
if( type == ItemRenderType.INVENTORY )
|
||||||
{
|
{
|
||||||
boolean isGood = false;
|
boolean isGood = false;
|
||||||
|
|
||||||
final IInventory inv = Minecraft.getMinecraft().thePlayer.inventory;
|
final IInventory inv = Minecraft.getMinecraft().thePlayer.inventory;
|
||||||
|
|
||||||
for( int x = 0; x < inv.getSizeInventory(); x++ )
|
for( int x = 0; x < inv.getSizeInventory(); x++ )
|
||||||
{
|
{
|
||||||
if( inv.getStackInSlot( x ) == is )
|
if( inv.getStackInSlot( x ) == is )
|
||||||
@@ -77,9 +77,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
|
GL11.glEnable( GL12.GL_RESCALE_NORMAL );
|
||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
|
|
||||||
final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
|
Minecraft.getMinecraft().getTextureManager().bindTexture( TEXTURE_SKY_COMPASS );
|
||||||
|
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture( loc );
|
|
||||||
|
|
||||||
if( type == ItemRenderType.ENTITY )
|
if( type == ItemRenderType.ENTITY )
|
||||||
{
|
{
|
||||||
@@ -109,6 +107,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
}
|
}
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
|
|
||||||
if( type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY || type == ItemRenderType.EQUIPPED )
|
if( type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY || type == ItemRenderType.EQUIPPED )
|
||||||
{
|
{
|
||||||
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer p = Minecraft.getMinecraft().thePlayer;
|
||||||
@@ -133,9 +132,9 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cr.hasResult )
|
if( cr.isValidResult() )
|
||||||
{
|
{
|
||||||
if( cr.spin )
|
if( cr.isSpin() )
|
||||||
{
|
{
|
||||||
now %= 100000;
|
now %= 100000;
|
||||||
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
|
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
|
||||||
@@ -146,13 +145,15 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
{
|
{
|
||||||
final float offRads = rYaw / 180.0f * (float) Math.PI;
|
final float offRads = rYaw / 180.0f * (float) Math.PI;
|
||||||
final float adjustment = (float) Math.PI * 0.74f;
|
final float adjustment = (float) Math.PI * 0.74f;
|
||||||
this.model.renderAll( (float) this.flipidiy( cr.rad + offRads + adjustment ) );
|
|
||||||
|
this.model.renderAll( (float) this.flipidiy( cr.getRad() + offRads + adjustment ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final float offRads = rYaw / 180.0f * (float) Math.PI;
|
final float offRads = rYaw / 180.0f * (float) Math.PI;
|
||||||
final float adjustment = (float) Math.PI * -0.74f;
|
final float adjustment = (float) Math.PI * -0.74f;
|
||||||
this.model.renderAll( (float) this.flipidiy( cr.rad + offRads + adjustment ) );
|
|
||||||
|
this.model.renderAll( (float) this.flipidiy( cr.getRad() + offRads + adjustment ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,9 +196,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||||
GL11.glCullFace( GL11.GL_FRONT );
|
GL11.glCullFace( GL11.GL_FRONT );
|
||||||
|
|
||||||
final ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
|
Minecraft.getMinecraft().getTextureManager().bindTexture( TEXTURE_SKY_COMPASS );
|
||||||
|
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture( loc );
|
|
||||||
|
|
||||||
this.applyTESRRotation( x, y, z, skyCompass.getUp(), skyCompass.getForward() );
|
this.applyTESRRotation( x, y, z, skyCompass.getUp(), skyCompass.getForward() );
|
||||||
|
|
||||||
@@ -205,8 +204,8 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
GL11.glTranslatef( 0.5F, -1.5F, -0.5F );
|
GL11.glTranslatef( 0.5F, -1.5F, -0.5F );
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
|
|
||||||
CompassResult cr = null;
|
CompassResult cr = null;
|
||||||
|
|
||||||
if( skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN )
|
if( skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN )
|
||||||
{
|
{
|
||||||
cr = CompassManager.INSTANCE.getCompassDirection( 0, skyCompass.xCoord, skyCompass.yCoord, skyCompass.zCoord );
|
cr = CompassManager.INSTANCE.getCompassDirection( 0, skyCompass.xCoord, skyCompass.yCoord, skyCompass.zCoord );
|
||||||
@@ -216,16 +215,16 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
|
|||||||
cr = new CompassResult( false, true, 0 );
|
cr = new CompassResult( false, true, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cr.hasResult )
|
if( cr.isValidResult() )
|
||||||
{
|
{
|
||||||
if( cr.spin )
|
if( cr.isSpin() )
|
||||||
{
|
{
|
||||||
now %= 100000;
|
now %= 100000;
|
||||||
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
|
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.model.renderAll( (float) ( skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy( cr.rad ) : cr.rad ) );
|
this.model.renderAll( (float) ( skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy( cr.getRad() ) : cr.getRad() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public class RenderBlockWireless extends BaseBlockRender<BlockWireless, TileWire
|
|||||||
this.centerZ = 0;
|
this.centerZ = 0;
|
||||||
this.hasChan = false;
|
this.hasChan = false;
|
||||||
this.hasPower = false;
|
this.hasPower = false;
|
||||||
|
|
||||||
final BlockRenderInfo ri = blk.getRendererInstance();
|
final BlockRenderInfo ri = blk.getRendererInstance();
|
||||||
final Tessellator tess = Tessellator.instance;
|
final Tessellator tess = Tessellator.instance;
|
||||||
|
|
||||||
@@ -111,10 +112,11 @@ public class RenderBlockWireless extends BaseBlockRender<BlockWireless, TileWire
|
|||||||
{
|
{
|
||||||
final TileWireless tw = blk.getTileEntity( world, x, y, z );
|
final TileWireless tw = blk.getTileEntity( world, x, y, z );
|
||||||
this.blk = blk;
|
this.blk = blk;
|
||||||
|
|
||||||
if( tw != null )
|
if( tw != null )
|
||||||
{
|
{
|
||||||
this.hasChan = ( tw.clientFlags & ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG ) ) == ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG );
|
this.hasChan = ( tw.getClientFlags() & ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG ) ) == ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG );
|
||||||
this.hasPower = ( tw.clientFlags & TileWireless.POWERED_FLAG ) == TileWireless.POWERED_FLAG;
|
this.hasPower = ( tw.getClientFlags() & TileWireless.POWERED_FLAG ) == TileWireless.POWERED_FLAG;
|
||||||
|
|
||||||
final BlockRenderInfo ri = blk.getRendererInstance();
|
final BlockRenderInfo ri = blk.getRendererInstance();
|
||||||
|
|
||||||
|
|||||||
@@ -58,15 +58,15 @@ public class RenderDrive extends BaseBlockRender<BlockDrive, TileDrive>
|
|||||||
public boolean renderInWorld( final BlockDrive imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
public boolean renderInWorld( final BlockDrive imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
final TileDrive sp = imb.getTileEntity( world, x, y, z );
|
final TileDrive sp = imb.getTileEntity( world, x, y, z );
|
||||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
|
||||||
|
|
||||||
final ForgeDirection up = sp.getUp();
|
final ForgeDirection up = sp.getUp();
|
||||||
final ForgeDirection forward = sp.getForward();
|
final ForgeDirection forward = sp.getForward();
|
||||||
final ForgeDirection west = Platform.crossProduct( forward, up );
|
final ForgeDirection west = Platform.crossProduct( forward, up );
|
||||||
|
|
||||||
final boolean result = super.renderInWorld( imb, world, x, y, z, renderer );
|
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
final Tessellator tess = Tessellator.instance;
|
|
||||||
|
|
||||||
|
final boolean result = super.renderInWorld( imb, world, x, y, z, renderer );
|
||||||
|
|
||||||
|
final Tessellator tess = Tessellator.instance;
|
||||||
final IIcon ico = ExtraBlockTextures.MEStorageCellTextures.getIcon();
|
final IIcon ico = ExtraBlockTextures.MEStorageCellTextures.getIcon();
|
||||||
|
|
||||||
final int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 );
|
final int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 );
|
||||||
@@ -76,6 +76,7 @@ public class RenderDrive extends BaseBlockRender<BlockDrive, TileDrive>
|
|||||||
for( int xx = 0; xx < 2; xx++ )
|
for( int xx = 0; xx < 2; xx++ )
|
||||||
{
|
{
|
||||||
final int stat = sp.getCellStatus( yy * 2 + ( 1 - xx ) );
|
final int stat = sp.getCellStatus( yy * 2 + ( 1 - xx ) );
|
||||||
|
|
||||||
this.selectFace( renderer, west, up, forward, 2 + xx * 7, 7 + xx * 7, 1 + yy * 3, 3 + yy * 3 );
|
this.selectFace( renderer, west, up, forward, 2 + xx * 7, 7 + xx * 7, 1 + yy * 3, 3 + yy * 3 );
|
||||||
|
|
||||||
int spin = 0;
|
int spin = 0;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
|
|||||||
public void renderInventory( final BlockChest block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj )
|
public void renderInventory( final BlockChest block, final ItemStack is, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj )
|
||||||
{
|
{
|
||||||
Tessellator.instance.setBrightness( 0 );
|
Tessellator.instance.setBrightness( 0 );
|
||||||
|
|
||||||
renderer.overrideBlockTexture = ExtraBlockTextures.getMissing();
|
renderer.overrideBlockTexture = ExtraBlockTextures.getMissing();
|
||||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||||
|
|
||||||
@@ -67,13 +68,14 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
|
|||||||
public boolean renderInWorld( final BlockChest imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
public boolean renderInWorld( final BlockChest imb, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
final TileChest sp = imb.getTileEntity( world, x, y, z );
|
final TileChest sp = imb.getTileEntity( world, x, y, z );
|
||||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
|
||||||
|
|
||||||
if( sp == null )
|
if( sp == null )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||||
|
|
||||||
final ForgeDirection up = sp.getUp();
|
final ForgeDirection up = sp.getUp();
|
||||||
final ForgeDirection forward = sp.getForward();
|
final ForgeDirection forward = sp.getForward();
|
||||||
final ForgeDirection west = Platform.crossProduct( forward, up );
|
final ForgeDirection west = Platform.crossProduct( forward, up );
|
||||||
@@ -97,6 +99,7 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
|
|||||||
|
|
||||||
final int offsetU = -4;
|
final int offsetU = -4;
|
||||||
final FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) );
|
final FlippableIcon flippableIcon = new FlippableIcon( new OffsetIcon( ExtraBlockTextures.MEStorageCellTextures.getIcon(), offsetU, offsetV ) );
|
||||||
|
|
||||||
if( forward == ForgeDirection.EAST && ( up == ForgeDirection.NORTH || up == ForgeDirection.SOUTH ) )
|
if( forward == ForgeDirection.EAST && ( up == ForgeDirection.NORTH || up == ForgeDirection.SOUTH ) )
|
||||||
{
|
{
|
||||||
flippableIcon.setFlip( true, false );
|
flippableIcon.setFlip( true, false );
|
||||||
@@ -118,13 +121,6 @@ public class RenderMEChest extends BaseBlockRender<BlockChest, TileChest>
|
|||||||
flippableIcon.setFlip( true, false );
|
flippableIcon.setFlip( true, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* 1.7.2
|
|
||||||
* else if ( forward == ForgeDirection.EAST && up == ForgeDirection.UP ) flippableIcon.setFlip( true, false );
|
|
||||||
* else if (
|
|
||||||
* forward == ForgeDirection.NORTH && up == ForgeDirection.UP ) flippableIcon.setFlip( true, false );
|
|
||||||
*/
|
|
||||||
|
|
||||||
this.renderFace( x, y, z, imb, flippableIcon, renderer, forward );
|
this.renderFace( x, y, z, imb, flippableIcon, renderer, forward );
|
||||||
|
|
||||||
if( stat != 0 )
|
if( stat != 0 )
|
||||||
|
|||||||
@@ -45,14 +45,19 @@ import appeng.tile.qnb.TileQuantumBridge;
|
|||||||
|
|
||||||
public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBridge>
|
public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBridge>
|
||||||
{
|
{
|
||||||
|
private static final float DEFAULT_RENDER_MIN = 2.0f / 16.0f;
|
||||||
|
private static final float DEFAULT_RENDER_MAX = 14.0f / 16.0f;
|
||||||
|
|
||||||
|
private static final float CORNER_POWERED_RENDER_MIN = 3.9f / 16.0f;
|
||||||
|
private static final float CORNER_POWERED_RENDER_MAX = 12.1f / 16.0f;
|
||||||
|
|
||||||
|
private static final float CENTER_POWERED_RENDER_MIN = -0.01f / 16.0f;
|
||||||
|
private static final float CENTER_POWERED_RENDER_MAX = 16.01f / 16.0f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventory( final BlockQuantumBase block, final ItemStack item, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj )
|
public void renderInventory( final BlockQuantumBase block, final ItemStack item, final RenderBlocks renderer, final ItemRenderType type, final Object[] obj )
|
||||||
{
|
{
|
||||||
final float minPx = 2.0f / 16.0f;
|
renderer.setRenderBounds( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
final float maxPx = 14.0f / 16.0f;
|
|
||||||
renderer.setRenderBounds( minPx, minPx, minPx, maxPx, maxPx, maxPx );
|
|
||||||
|
|
||||||
super.renderInventory( block, item, renderer, type, obj );
|
super.renderInventory( block, item, renderer, type, obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +65,7 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
|
|||||||
public boolean renderInWorld( final BlockQuantumBase block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
public boolean renderInWorld( final BlockQuantumBase block, final IBlockAccess world, final int x, final int y, final int z, final RenderBlocks renderer )
|
||||||
{
|
{
|
||||||
final TileQuantumBridge tqb = block.getTileEntity( world, x, y, z );
|
final TileQuantumBridge tqb = block.getTileEntity( world, x, y, z );
|
||||||
|
|
||||||
if( tqb == null )
|
if( tqb == null )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -86,37 +92,28 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
|
|||||||
this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transCoveredCable.getIconIndex( parts.cableCovered().stack( AEColor.Transparent, 1 ) ), 0.1875D, sides );
|
this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transCoveredCable.getIconIndex( parts.cableCovered().stack( AEColor.Transparent, 1 ) ), 0.1875D, sides );
|
||||||
}
|
}
|
||||||
|
|
||||||
final float renderMin = 2.0f / 16.0f;
|
renderer.setRenderBounds( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
final float renderMax = 14.0f / 16.0f;
|
|
||||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( !tqb.isFormed() )
|
if( !tqb.isFormed() )
|
||||||
{
|
{
|
||||||
final float renderMin = 2.0f / 16.0f;
|
renderer.setRenderBounds( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
final float renderMax = 14.0f / 16.0f;
|
|
||||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
}
|
}
|
||||||
else if( tqb.isCorner() )
|
else if( tqb.isCorner() )
|
||||||
{
|
{
|
||||||
final Item transCoveredCable = parts.cableCovered().item( AEColor.Transparent );
|
final Item transCoveredCable = parts.cableCovered().item( AEColor.Transparent );
|
||||||
|
|
||||||
this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transCoveredCable.getIconIndex( parts.cableCovered().stack( AEColor.Transparent, 1 ) ), 0.05D, tqb.getConnections() );
|
this.renderCableAt( 0.188D, world, x, y, z, block, renderer, transCoveredCable.getIconIndex( parts.cableCovered().stack( AEColor.Transparent, 1 ) ), 0.05D, tqb.getConnections() );
|
||||||
|
|
||||||
float renderMin = 4.0f / 16.0f;
|
renderer.setRenderBounds( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
float renderMax = 12.0f / 16.0f;
|
|
||||||
|
|
||||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
|
|
||||||
if( tqb.isPowered() )
|
if( tqb.isPowered() )
|
||||||
{
|
{
|
||||||
|
renderer.setRenderBounds( CORNER_POWERED_RENDER_MIN, CORNER_POWERED_RENDER_MIN, CORNER_POWERED_RENDER_MIN, CORNER_POWERED_RENDER_MAX, CORNER_POWERED_RENDER_MAX, CORNER_POWERED_RENDER_MAX );
|
||||||
renderMin = 3.9f / 16.0f;
|
|
||||||
renderMax = 12.1f / 16.0f;
|
|
||||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
|
||||||
|
|
||||||
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
||||||
final int bn = 15;
|
final int bn = 15;
|
||||||
@@ -129,22 +126,18 @@ public class RenderQNB extends BaseBlockRender<BlockQuantumBase, TileQuantumBrid
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float renderMin = 2.0f / 16.0f;
|
renderer.setRenderBounds( 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 1, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
|
||||||
float renderMax = 14.0f / 16.0f;
|
|
||||||
renderer.setRenderBounds( 0, renderMin, renderMin, 1, renderMax, renderMax );
|
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
|
|
||||||
renderer.setRenderBounds( renderMin, 0, renderMin, renderMax, 1, renderMax );
|
renderer.setRenderBounds( DEFAULT_RENDER_MIN, 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, 1, DEFAULT_RENDER_MAX );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
|
|
||||||
renderer.setRenderBounds( renderMin, renderMin, 0, renderMax, renderMax, 1 );
|
renderer.setRenderBounds( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 0, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, 1 );
|
||||||
renderer.renderStandardBlock( block, x, y, z );
|
renderer.renderStandardBlock( block, x, y, z );
|
||||||
|
|
||||||
if( tqb.isPowered() )
|
if( tqb.isPowered() )
|
||||||
{
|
{
|
||||||
renderMin = -0.01f / 16.0f;
|
renderer.setRenderBounds( CENTER_POWERED_RENDER_MIN, CENTER_POWERED_RENDER_MIN, CENTER_POWERED_RENDER_MIN, CENTER_POWERED_RENDER_MAX, CENTER_POWERED_RENDER_MAX, CENTER_POWERED_RENDER_MAX );
|
||||||
renderMax = 16.01f / 16.0f;
|
|
||||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
|
||||||
|
|
||||||
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
||||||
final int bn = 15;
|
final int bn = 15;
|
||||||
|
|||||||
@@ -38,23 +38,28 @@ import appeng.tile.AEBaseTile;
|
|||||||
public class RenderQuartzGlass extends BaseBlockRender<BlockQuartzGlass, AEBaseTile>
|
public class RenderQuartzGlass extends BaseBlockRender<BlockQuartzGlass, AEBaseTile>
|
||||||
{
|
{
|
||||||
|
|
||||||
static byte[][][] offsets;
|
private static final byte[][][] OFFSETS = generateOffsets();
|
||||||
|
|
||||||
public RenderQuartzGlass()
|
public RenderQuartzGlass()
|
||||||
{
|
{
|
||||||
super( false, 0 );
|
super( false, 0 );
|
||||||
if( offsets == null )
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[][][] generateOffsets()
|
||||||
|
{
|
||||||
|
final Random r = new Random( 924 );
|
||||||
|
final byte[][][] offset = new byte[10][10][10];
|
||||||
|
|
||||||
|
for( int x = 0; x < 10; x++ )
|
||||||
{
|
{
|
||||||
final Random r = new Random( 924 );
|
for( int y = 0; y < 10; y++ )
|
||||||
offsets = new byte[10][10][10];
|
|
||||||
for( int x = 0; x < 10; x++ )
|
|
||||||
{
|
{
|
||||||
for( int y = 0; y < 10; y++ )
|
r.nextBytes( offset[x][y] );
|
||||||
{
|
|
||||||
r.nextBytes( offsets[x][y] );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -75,10 +80,10 @@ public class RenderQuartzGlass extends BaseBlockRender<BlockQuartzGlass, AEBaseT
|
|||||||
final int cy = Math.abs( y % 10 );
|
final int cy = Math.abs( y % 10 );
|
||||||
final int cz = Math.abs( z % 10 );
|
final int cz = Math.abs( z % 10 );
|
||||||
|
|
||||||
final int u = offsets[cx][cy][cz] % 4;
|
final int u = OFFSETS[cx][cy][cz] % 4;
|
||||||
final int v = offsets[9 - cx][9 - cy][9 - cz] % 4;
|
final int v = OFFSETS[9 - cx][9 - cy][9 - cz] % 4;
|
||||||
|
|
||||||
switch( Math.abs( ( offsets[cx][cy][cz] + ( x + y + z ) ) % 4 ) )
|
switch( Math.abs( ( OFFSETS[cx][cy][cz] + ( x + y + z ) ) % 4 ) )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
renderer.overrideBlockTexture = new OffsetIcon( imb.getIcon( 0, 0 ), u / 2, v / 2 );
|
renderer.overrideBlockTexture = new OffsetIcon( imb.getIcon( 0, 0 ), u / 2, v / 2 );
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user