Basic reformat, hit once, hope never again
This commit is contained in:
@@ -47,90 +47,17 @@ import appeng.parts.networking.PartCable;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvider
|
||||
{
|
||||
|
||||
IIcon getConnectedCable(IBlockAccess world, int x, int y, int z, ForgeDirection side, boolean covered)
|
||||
public RenderBlockAssembler()
|
||||
{
|
||||
final int tileYPos = y + side.offsetY;
|
||||
if ( -1 < tileYPos && tileYPos < 256 )
|
||||
{
|
||||
TileEntity ne = world.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||
if ( ne instanceof IGridHost && ne instanceof IPartHost )
|
||||
{
|
||||
IPartHost ph = (IPartHost) ne;
|
||||
IPart pcx = ph.getPart( ForgeDirection.UNKNOWN );
|
||||
if ( pcx instanceof PartCable )
|
||||
{
|
||||
PartCable pc = (PartCable) pcx;
|
||||
if ( pc.isConnected( side.getOpposite() ) )
|
||||
{
|
||||
if ( covered )
|
||||
return pc.getCoveredTexture( pc.getCableColor() );
|
||||
return pc.getGlassTexture( pc.getCableColor() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void renderCableAt(double Thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, double pull, boolean covered)
|
||||
{
|
||||
IIcon texture = null;
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) );
|
||||
if ( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) );
|
||||
if ( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) );
|
||||
if ( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) );
|
||||
if ( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) );
|
||||
if ( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) );
|
||||
if ( texture != null )
|
||||
{
|
||||
renderer.setRenderBounds( 0.5D - Thickness, 0.5D + Thickness + pull, 0.5D - Thickness, 0.5D + Thickness, 1.0D, 0.5D + Thickness );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
}
|
||||
|
||||
public RenderBlockAssembler() {
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
renderer.setOverrideBlockTexture( blk.getIcon( 0, 0 ) );
|
||||
|
||||
@@ -177,14 +104,14 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
BlockMolecularAssembler blk = (BlockMolecularAssembler) block;
|
||||
TileMolecularAssembler tma = blk.getTileEntity( world, x, y, z );
|
||||
|
||||
if ( BlockMolecularAssembler.booleanAlphaPass )
|
||||
if( BlockMolecularAssembler.booleanAlphaPass )
|
||||
{
|
||||
if ( tma.isPowered() )
|
||||
if( tma.isPowered() )
|
||||
{
|
||||
this.renderBlockBounds( renderer, 1, 1, 1, 15, 15, 15, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
TaughtIcon lights = new TaughtIcon( ExtraBlockTextures.BlockMolecularAssemblerLights.getIcon(), -2.0f );
|
||||
@@ -274,8 +201,83 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide
|
||||
return true;
|
||||
}
|
||||
|
||||
public void renderCableAt( double Thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, double pull, boolean covered )
|
||||
{
|
||||
IIcon texture = null;
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.WEST, covered ) );
|
||||
if( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.EAST, covered ) );
|
||||
if( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.NORTH, covered ) );
|
||||
if( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.SOUTH, covered ) );
|
||||
if( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.DOWN, covered ) );
|
||||
if( texture != null )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture = this.getConnectedCable( world, x, y, z, ForgeDirection.UP, covered ) );
|
||||
if( texture != null )
|
||||
{
|
||||
renderer.setRenderBounds( 0.5D - Thickness, 0.5D + Thickness + pull, 0.5D - Thickness, 0.5D + Thickness, 1.0D, 0.5D + Thickness );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
}
|
||||
|
||||
IIcon getConnectedCable( IBlockAccess world, int x, int y, int z, ForgeDirection side, boolean covered )
|
||||
{
|
||||
final int tileYPos = y + side.offsetY;
|
||||
if( -1 < tileYPos && tileYPos < 256 )
|
||||
{
|
||||
TileEntity ne = world.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||
if( ne instanceof IGridHost && ne instanceof IPartHost )
|
||||
{
|
||||
IPartHost ph = (IPartHost) ne;
|
||||
IPart pcx = ph.getPart( ForgeDirection.UNKNOWN );
|
||||
if( pcx instanceof PartCable )
|
||||
{
|
||||
PartCable pc = (PartCable) pcx;
|
||||
if( pc.isConnected( side.getOpposite() ) )
|
||||
{
|
||||
if( covered )
|
||||
return pc.getCoveredTexture( pc.getCableColor() );
|
||||
return pc.getGlassTexture( pc.getCableColor() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes(IPartCollisionHelper bch)
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 0, 0, 0, 16, 16, 16 );
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -42,15 +43,17 @@ import appeng.core.AELog;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class RenderBlockCharger extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockCharger() {
|
||||
public RenderBlockCharger()
|
||||
{
|
||||
super( true, 30 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
@@ -78,11 +81,10 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||
|
||||
renderer.renderAllFaces = false;
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
this.preRenderInWorld( block, world, x, y, z, renderer );
|
||||
|
||||
@@ -124,13 +126,13 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer)
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
|
||||
{
|
||||
ItemStack sis = null;
|
||||
if ( tile instanceof IInventory )
|
||||
sis = ((IInventory) tile).getStackInSlot( 0 );
|
||||
if( tile instanceof IInventory )
|
||||
sis = ( (IInventory) tile ).getStackInSlot( 0 );
|
||||
|
||||
if ( sis != null )
|
||||
if( sis != null )
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
|
||||
@@ -142,7 +144,7 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||
GL11.glScalef( 1.0f, 1.0f, 1.0f );
|
||||
|
||||
Block blk = Block.getBlockFromItem( sis.getItem() );
|
||||
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 );
|
||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
||||
@@ -162,7 +164,7 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||
|
||||
this.doRenderItem( sis, tile );
|
||||
}
|
||||
catch (Exception err)
|
||||
catch( Exception err )
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
@@ -170,5 +172,4 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -28,15 +29,17 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.networking.TileController;
|
||||
|
||||
|
||||
public class RenderBlockController extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockController() {
|
||||
public RenderBlockController()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
|
||||
boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController;
|
||||
@@ -49,12 +52,12 @@ public class RenderBlockController extends BaseBlockRender
|
||||
|
||||
ExtraBlockTextures lights = null;
|
||||
|
||||
if ( xx && !yy && !zz )
|
||||
if( xx && !yy && !zz )
|
||||
{
|
||||
if ( hasPower )
|
||||
if( hasPower )
|
||||
{
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerColumnPowered.getIcon() );
|
||||
if ( isConflict )
|
||||
if( isConflict )
|
||||
lights = ExtraBlockTextures.BlockControllerColumnConflict;
|
||||
else
|
||||
lights = ExtraBlockTextures.BlockControllerColumnLights;
|
||||
@@ -67,12 +70,12 @@ public class RenderBlockController extends BaseBlockRender
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
}
|
||||
else if ( !xx && yy && !zz )
|
||||
else if( !xx && yy && !zz )
|
||||
{
|
||||
if ( hasPower )
|
||||
if( hasPower )
|
||||
{
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerColumnPowered.getIcon() );
|
||||
if ( isConflict )
|
||||
if( isConflict )
|
||||
lights = ExtraBlockTextures.BlockControllerColumnConflict;
|
||||
else
|
||||
lights = ExtraBlockTextures.BlockControllerColumnLights;
|
||||
@@ -83,12 +86,12 @@ public class RenderBlockController extends BaseBlockRender
|
||||
renderer.uvRotateEast = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
}
|
||||
else if ( !xx && !yy && zz )
|
||||
else if( !xx && !yy && zz )
|
||||
{
|
||||
if ( hasPower )
|
||||
if( hasPower )
|
||||
{
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerColumnPowered.getIcon() );
|
||||
if ( isConflict )
|
||||
if( isConflict )
|
||||
lights = ExtraBlockTextures.BlockControllerColumnConflict;
|
||||
else
|
||||
lights = ExtraBlockTextures.BlockControllerColumnLights;
|
||||
@@ -100,33 +103,32 @@ public class RenderBlockController extends BaseBlockRender
|
||||
renderer.uvRotateSouth = 1;
|
||||
renderer.uvRotateTop = 0;
|
||||
}
|
||||
else if ( (xx ? 1 : 0) + (yy ? 1 : 0) + (zz ? 1 : 0) >= 2 )
|
||||
else if( ( xx ? 1 : 0 ) + ( yy ? 1 : 0 ) + ( zz ? 1 : 0 ) >= 2 )
|
||||
{
|
||||
int v = (Math.abs( x ) + Math.abs( y ) + Math.abs( z )) % 2;
|
||||
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;
|
||||
|
||||
if ( v == 0 )
|
||||
if( v == 0 )
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerInsideA.getIcon() );
|
||||
else
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerInsideB.getIcon() );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( hasPower )
|
||||
if( hasPower )
|
||||
{
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.BlockControllerPowered.getIcon() );
|
||||
if ( isConflict )
|
||||
if( isConflict )
|
||||
lights = ExtraBlockTextures.BlockControllerConflict;
|
||||
else
|
||||
lights = ExtraBlockTextures.BlockControllerLights;
|
||||
}
|
||||
else
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
|
||||
}
|
||||
|
||||
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.setBrightness( 14 << 20 | 14 << 4 );
|
||||
@@ -143,9 +145,9 @@ public class RenderBlockController extends BaseBlockRender
|
||||
return out;
|
||||
}
|
||||
|
||||
private TileEntity getTileEntity(IBlockAccess world, int x, int y, int z)
|
||||
private TileEntity getTileEntity( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
if ( y >= 0 )
|
||||
if( y >= 0 )
|
||||
return world.getTileEntity( x, y, z );
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -40,26 +41,29 @@ import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
|
||||
|
||||
public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
{
|
||||
|
||||
protected RenderBlockCraftingCPU(boolean useTESR, int range) {
|
||||
protected RenderBlockCraftingCPU( boolean useTESR, int range )
|
||||
{
|
||||
super( useTESR, range );
|
||||
}
|
||||
|
||||
public RenderBlockCraftingCPU() {
|
||||
public RenderBlockCraftingCPU()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess w, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess w, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
IIcon theIcon = null;
|
||||
boolean formed = false;
|
||||
boolean emitsLight = false;
|
||||
|
||||
TileCraftingTile ct = blk.getTileEntity( w, x, y, z );
|
||||
if ( ct != null && ct.isFormed() )
|
||||
if( ct != null && ct.isFormed() )
|
||||
{
|
||||
formed = true;
|
||||
emitsLight = ct.isPowered();
|
||||
@@ -67,18 +71,18 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
int meta = w.getBlockMetadata( x, y, z ) & 3;
|
||||
|
||||
boolean isMonitor = blk.getClass() == BlockCraftingMonitor.class;
|
||||
theIcon = blk.getIcon( ForgeDirection.SOUTH.ordinal(), meta | (formed ? 8 : 0) );
|
||||
theIcon = blk.getIcon( ForgeDirection.SOUTH.ordinal(), meta | ( formed ? 8 : 0 ) );
|
||||
|
||||
IIcon nonForward = theIcon;
|
||||
if ( isMonitor )
|
||||
if( isMonitor )
|
||||
{
|
||||
for ( Block craftingBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
|
||||
for( Block craftingBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
|
||||
{
|
||||
nonForward = craftingBlock.getIcon( 0, meta | ( formed ? 8 : 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( formed && renderer.overrideBlockTexture == null )
|
||||
if( formed && renderer.overrideBlockTexture == null )
|
||||
{
|
||||
renderer = BusRenderer.INSTANCE.renderer;
|
||||
BusRenderHelper i = BusRenderHelper.INSTANCE;
|
||||
@@ -92,7 +96,7 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
{
|
||||
ct.lightCache = i.useSimplifiedRendering( x, y, z, null, ct.lightCache );
|
||||
}
|
||||
catch (Throwable ignored)
|
||||
catch( Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -115,14 +119,13 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.NORTH );
|
||||
this.renderCorner( i, renderer, w, x, y, z, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.SOUTH );
|
||||
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
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 );
|
||||
|
||||
boolean LocalEmit = emitsLight;
|
||||
if ( blk instanceof BlockCraftingMonitor && ct.getForward() != side )
|
||||
if( blk instanceof BlockCraftingMonitor && ct.getForward() != side )
|
||||
LocalEmit = false;
|
||||
|
||||
this.handleSide( blk, meta, x, y, z, i, renderer, ct.getForward() == side ? theIcon : nonForward, LocalEmit, isMonitor, side, w );
|
||||
@@ -144,74 +147,75 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
}
|
||||
}
|
||||
|
||||
private void renderCorner(BusRenderHelper i, RenderBlocks renderer, IBlockAccess w, int x, int y, int z, ForgeDirection up, ForgeDirection east,
|
||||
ForgeDirection south)
|
||||
private boolean isConnected( IBlockAccess w, int x, int y, int z, ForgeDirection side )
|
||||
{
|
||||
if ( this.isConnected( w, x, y, z, up ) )
|
||||
final int tileYPos = y + side.offsetY;
|
||||
if( 0 <= tileYPos && tileYPos <= 255 )
|
||||
{
|
||||
final TileEntity tile = w.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||
|
||||
return tile instanceof TileCraftingTile;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderCorner( BusRenderHelper i, RenderBlocks renderer, IBlockAccess w, int x, int y, int z, ForgeDirection up, ForgeDirection east, ForgeDirection south )
|
||||
{
|
||||
if( this.isConnected( w, x, y, z, up ) )
|
||||
return;
|
||||
if ( this.isConnected( w, x, y, z, east ) )
|
||||
if( this.isConnected( w, x, y, z, east ) )
|
||||
return;
|
||||
if ( this.isConnected( w, x, y, z, south ) )
|
||||
if( this.isConnected( w, x, y, z, south ) )
|
||||
return;
|
||||
|
||||
i.setBounds( this.gso( east, 3, ForgeDirection.WEST ), this.gso( up, 3, ForgeDirection.DOWN ), this.gso( south, 3, ForgeDirection.NORTH ),
|
||||
this.gso( east, 13, ForgeDirection.EAST ), this.gso( up, 13, ForgeDirection.UP ), this.gso( south, 13, ForgeDirection.SOUTH ) );
|
||||
i.setBounds( this.gso( east, 3, ForgeDirection.WEST ), this.gso( up, 3, ForgeDirection.DOWN ), this.gso( south, 3, ForgeDirection.NORTH ), this.gso( east, 13, ForgeDirection.EAST ), this.gso( up, 13, ForgeDirection.UP ), this.gso( south, 13, ForgeDirection.SOUTH ) );
|
||||
i.prepareBounds( renderer );
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingUnitRing.getIcon() );
|
||||
i.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
}
|
||||
|
||||
private float gso(ForgeDirection side, float def, ForgeDirection target)
|
||||
private float fso( ForgeDirection side, float def, ForgeDirection target )
|
||||
{
|
||||
if ( side != target )
|
||||
if( side == target )
|
||||
{
|
||||
if ( side.offsetX > 0 || side.offsetY > 0 || side.offsetZ > 0 )
|
||||
if( side.offsetX > 0 || side.offsetY > 0 || side.offsetZ > 0 )
|
||||
return 16;
|
||||
return 0;
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
private float fso(ForgeDirection side, float def, ForgeDirection target)
|
||||
private void handleSide( AEBaseBlock blk, int meta, int x, int y, int z, BusRenderHelper i, RenderBlocks renderer, IIcon color, boolean emitsLight, boolean isMonitor, ForgeDirection side, IBlockAccess w )
|
||||
{
|
||||
if ( side == target )
|
||||
{
|
||||
if ( side.offsetX > 0 || side.offsetY > 0 || side.offsetZ > 0 )
|
||||
return 16;
|
||||
return 0;
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
private void handleSide(AEBaseBlock blk, int meta, int x, int y, int z, BusRenderHelper i, RenderBlocks renderer, IIcon color, boolean emitsLight,
|
||||
boolean isMonitor, ForgeDirection side, IBlockAccess w)
|
||||
{
|
||||
if ( this.isConnected( w, x, y, z, side ) )
|
||||
if( this.isConnected( w, x, y, z, side ) )
|
||||
return;
|
||||
|
||||
i.setFacesToRender( EnumSet.of( side ) );
|
||||
|
||||
if ( meta == 0 && blk.getClass() == BlockCraftingUnit.class )
|
||||
if( meta == 0 && blk.getClass() == BlockCraftingUnit.class )
|
||||
{
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingUnitFit.getIcon() );
|
||||
i.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( color == ExtraBlockTextures.BlockCraftingMonitorFit_Light.getIcon() )
|
||||
if( color == ExtraBlockTextures.BlockCraftingMonitorFit_Light.getIcon() )
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingMonitorOuter.getIcon() );
|
||||
else
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingFitSolid.getIcon() );
|
||||
|
||||
i.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
|
||||
if ( color != null )
|
||||
if( color != null )
|
||||
{
|
||||
i.setTexture( color );
|
||||
|
||||
if ( !emitsLight )
|
||||
if( !emitsLight )
|
||||
{
|
||||
if ( color == ExtraBlockTextures.BlockCraftingMonitorFit_Light.getIcon() )
|
||||
if( color == ExtraBlockTextures.BlockCraftingMonitorFit_Light.getIcon() )
|
||||
{
|
||||
int b = w.getLightBrightnessForSkyBlocks( x + side.offsetX, y + side.offsetY, z + side.offsetZ, 0 );
|
||||
|
||||
@@ -233,7 +237,7 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isMonitor )
|
||||
if( isMonitor )
|
||||
{
|
||||
TileCraftingMonitorTile sr = blk.getTileEntity( w, x, y, z );
|
||||
AEColor col = sr.getColor();
|
||||
@@ -257,68 +261,66 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
i.renderFace( x, y, z, color, side, renderer );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (ForgeDirection a : ForgeDirection.VALID_DIRECTIONS)
|
||||
for( ForgeDirection a : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if ( a == side || a == side.getOpposite() )
|
||||
if( a == side || a == side.getOpposite() )
|
||||
continue;
|
||||
|
||||
if ( (side.offsetX != 0 || side.offsetZ != 0)
|
||||
&& (a == ForgeDirection.NORTH || a == ForgeDirection.EAST || a == ForgeDirection.WEST || a == ForgeDirection.SOUTH) )
|
||||
if( ( side.offsetX != 0 || side.offsetZ != 0 ) && ( a == ForgeDirection.NORTH || a == ForgeDirection.EAST || a == ForgeDirection.WEST || a == ForgeDirection.SOUTH ) )
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingUnitRingLongRotated.getIcon() );
|
||||
else if ( (side.offsetY != 0) && (a == ForgeDirection.EAST || a == ForgeDirection.WEST) )
|
||||
else if( ( side.offsetY != 0 ) && ( a == ForgeDirection.EAST || a == ForgeDirection.WEST ) )
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingUnitRingLongRotated.getIcon() );
|
||||
else
|
||||
i.setTexture( ExtraBlockTextures.BlockCraftingUnitRingLong.getIcon() );
|
||||
|
||||
double width = 3.0 / 16.0;
|
||||
|
||||
if ( !(i.getBound( a ) < 0.001 || i.getBound( a ) > 15.999) )
|
||||
if( !( i.getBound( a ) < 0.001 || i.getBound( a ) > 15.999 ) )
|
||||
{
|
||||
switch (a)
|
||||
switch( a )
|
||||
{
|
||||
case DOWN:
|
||||
renderer.renderMinY = 0;
|
||||
renderer.renderMaxY = width;
|
||||
break;
|
||||
case EAST:
|
||||
renderer.renderMaxX = 1;
|
||||
renderer.renderMinX = 1.0 - width;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateEast = 1;
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.renderMinZ = 0;
|
||||
renderer.renderMaxZ = width;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 1;
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.renderMaxZ = 1;
|
||||
renderer.renderMinZ = 1.0 - width;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 1;
|
||||
break;
|
||||
case UP:
|
||||
renderer.renderMaxY = 1;
|
||||
renderer.renderMinY = 1.0 - width;
|
||||
break;
|
||||
case WEST:
|
||||
renderer.renderMinX = 0;
|
||||
renderer.renderMaxX = width;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateEast = 1;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
case DOWN:
|
||||
renderer.renderMinY = 0;
|
||||
renderer.renderMaxY = width;
|
||||
break;
|
||||
case EAST:
|
||||
renderer.renderMaxX = 1;
|
||||
renderer.renderMinX = 1.0 - width;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateEast = 1;
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.renderMinZ = 0;
|
||||
renderer.renderMaxZ = width;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 1;
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.renderMaxZ = 1;
|
||||
renderer.renderMinZ = 1.0 - width;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 1;
|
||||
break;
|
||||
case UP:
|
||||
renderer.renderMaxY = 1;
|
||||
renderer.renderMinY = 1.0 - width;
|
||||
break;
|
||||
case WEST:
|
||||
renderer.renderMinX = 0;
|
||||
renderer.renderMaxX = width;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateEast = 1;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
}
|
||||
|
||||
i.renderBlockCurrentBounds( x, y, z, renderer );
|
||||
@@ -327,18 +329,14 @@ public class RenderBlockCraftingCPU extends BaseBlockRender
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isConnected(IBlockAccess w, int x, int y, int z, ForgeDirection side)
|
||||
private float gso( ForgeDirection side, float def, ForgeDirection target )
|
||||
{
|
||||
final int tileYPos = y + side.offsetY;
|
||||
if ( 0 <= tileYPos && tileYPos <= 255)
|
||||
if( side != target )
|
||||
{
|
||||
final TileEntity tile = w.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||
|
||||
return tile instanceof TileCraftingTile;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
if( side.offsetX > 0 || side.offsetY > 0 || side.offsetZ > 0 )
|
||||
return 16;
|
||||
return 0;
|
||||
}
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,33 +45,34 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
{
|
||||
private static final ReadableNumberConverter NUMBER_CONVERTER = ReadableNumberConverter.INSTANCE;
|
||||
|
||||
public RenderBlockCraftingCPUMonitor() {
|
||||
public RenderBlockCraftingCPUMonitor()
|
||||
{
|
||||
super( true, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer)
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
|
||||
{
|
||||
if ( Platform.isDrawing( tess ) )
|
||||
if( Platform.isDrawing( tess ) )
|
||||
return;
|
||||
|
||||
if ( tile instanceof TileCraftingMonitorTile )
|
||||
if( tile instanceof TileCraftingMonitorTile )
|
||||
{
|
||||
TileCraftingMonitorTile cmt = (TileCraftingMonitorTile) tile;
|
||||
IAEItemStack ais = cmt.getJobProgress();
|
||||
|
||||
if ( cmt.dspList == null )
|
||||
if( cmt.dspList == null )
|
||||
{
|
||||
cmt.updateList = true;
|
||||
cmt.dspList = GLAllocation.generateDisplayLists( 1 );
|
||||
}
|
||||
|
||||
if ( ais != null )
|
||||
if( ais != null )
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
|
||||
|
||||
if ( cmt.updateList )
|
||||
if( cmt.updateList )
|
||||
{
|
||||
cmt.updateList = false;
|
||||
GL11.glNewList( cmt.dspList, GL11.GL_COMPILE_AND_EXECUTE );
|
||||
@@ -86,7 +87,7 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
private void tesrRenderScreen(Tessellator tess, TileCraftingMonitorTile cmt, IAEItemStack ais)
|
||||
private void tesrRenderScreen( Tessellator tess, TileCraftingMonitorTile cmt, IAEItemStack ais )
|
||||
{
|
||||
ForgeDirection side = cmt.getForward();
|
||||
|
||||
@@ -94,7 +95,7 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
int spin = 0;
|
||||
|
||||
int max = 5;
|
||||
while (walrus != cmt.getUp() && max > 0)
|
||||
while( walrus != cmt.getUp() && max > 0 )
|
||||
{
|
||||
max--;
|
||||
spin++;
|
||||
@@ -108,38 +109,38 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
float scale = 0.7f;
|
||||
GL11.glScalef( scale, scale, scale );
|
||||
|
||||
if ( side == ForgeDirection.UP )
|
||||
if( side == ForgeDirection.UP )
|
||||
{
|
||||
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.DOWN )
|
||||
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 )
|
||||
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 )
|
||||
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 )
|
||||
if( side == ForgeDirection.NORTH )
|
||||
{
|
||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||
}
|
||||
|
||||
if ( side == ForgeDirection.SOUTH )
|
||||
if( side == ForgeDirection.SOUTH )
|
||||
{
|
||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||
GL11.glRotatef( 180.0f, 0.0f, 1.0f, 0.0f );
|
||||
@@ -164,9 +165,8 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
tess.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
||||
|
||||
ClientHelper.proxy.doRenderItem( sis, cmt.getWorldObj() );
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch( Exception e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -186,5 +186,4 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -35,15 +36,17 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
|
||||
|
||||
public class RenderBlockCrank extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockCrank() {
|
||||
public RenderBlockCrank()
|
||||
{
|
||||
super( true, 60 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
renderer.renderAllFaces = true;
|
||||
|
||||
@@ -57,22 +60,22 @@ public class RenderBlockCrank extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderBlocks)
|
||||
public void renderTile( AEBaseBlock blk, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderBlocks )
|
||||
{
|
||||
TileCrank tc = (TileCrank) tile;
|
||||
if ( tc.getUp() == null || tc.getUp() == ForgeDirection.UNKNOWN )
|
||||
if( tc.getUp() == null || tc.getUp() == ForgeDirection.UNKNOWN )
|
||||
return;
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture( TextureMap.locationBlocksTexture );
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
if ( Minecraft.isAmbientOcclusionEnabled() )
|
||||
if( Minecraft.isAmbientOcclusionEnabled() )
|
||||
GL11.glShadeModel( GL11.GL_SMOOTH );
|
||||
else
|
||||
GL11.glShadeModel( GL11.GL_FLAT );
|
||||
@@ -102,5 +105,4 @@ public class RenderBlockCrank extends BaseBlockRender
|
||||
tess.setTranslation( 0, 0, 0 );
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -27,25 +28,27 @@ import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
|
||||
|
||||
public class RenderBlockEnergyCube extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockEnergyCube() {
|
||||
public RenderBlockEnergyCube()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
IAEItemPowerStorage myItem = (IAEItemPowerStorage) is.getItem();
|
||||
double internalCurrentPower = myItem.getAECurrentPower( is );
|
||||
double internalMaxPower = myItem.getAEMaxPower( is );
|
||||
|
||||
int meta = (int) (8.0 * (internalCurrentPower / internalMaxPower));
|
||||
int meta = (int) ( 8.0 * ( internalCurrentPower / internalMaxPower ) );
|
||||
|
||||
if ( meta > 7 )
|
||||
if( meta > 7 )
|
||||
meta = 7;
|
||||
if ( meta < 0 )
|
||||
if( meta < 0 )
|
||||
meta = 0;
|
||||
|
||||
renderer.setOverrideBlockTexture( blk.getIcon( 0, meta ) );
|
||||
@@ -54,7 +57,7 @@ public class RenderBlockEnergyCube extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
int meta = world.getBlockMetadata( x, y, z );
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -46,15 +47,17 @@ import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class RenderBlockInscriber extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockInscriber() {
|
||||
public RenderBlockInscriber()
|
||||
{
|
||||
super( true, 30 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
@@ -95,14 +98,15 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
this.preRenderInWorld( block, world, x, y, z, renderer );
|
||||
|
||||
BlockInscriber blk = (BlockInscriber) block;
|
||||
|
||||
IOrientable te = this.getOrientable( block, world, x, y, z );
|
||||
if ( te == null ) return false;
|
||||
if( te == null )
|
||||
return false;
|
||||
|
||||
ForgeDirection fdy = te.getUp();
|
||||
ForgeDirection fdz = te.getForward();
|
||||
@@ -137,7 +141,7 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer)
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
|
||||
{
|
||||
TileInscriber inv = (TileInscriber) tile;
|
||||
|
||||
@@ -163,19 +167,19 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
float base = 0.4f;
|
||||
|
||||
long absoluteProgress = 0;
|
||||
if ( inv.smash )
|
||||
if( inv.smash )
|
||||
{
|
||||
long currentTime = System.currentTimeMillis();
|
||||
absoluteProgress = currentTime - inv.clientStart;
|
||||
if ( absoluteProgress > 800 )
|
||||
if( absoluteProgress > 800 )
|
||||
inv.smash = false;
|
||||
}
|
||||
|
||||
float relativeProgress = absoluteProgress % 800 / 400.0f;
|
||||
float progress = relativeProgress;
|
||||
|
||||
if ( progress > 1.0f )
|
||||
progress = 1.0f - (progress - 1.0f);
|
||||
if( progress > 1.0f )
|
||||
progress = 1.0f - ( progress - 1.0f );
|
||||
press -= progress / 5.0f;
|
||||
|
||||
IIcon ic = ExtraBlockTextures.BlockInscriberInside.getIcon();
|
||||
@@ -189,8 +193,8 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
|
||||
tess.addVertexWithUV( TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 ) );
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle + press, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 ) );
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 - 16 * (press - base) ) );
|
||||
tess.addVertexWithUV( TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 - 16 * (press - base) ) );
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) );
|
||||
tess.addVertexWithUV( TwoPx, middle + base, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) );
|
||||
|
||||
middle -= 2.0f * 0.02f;
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle - press, TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 2 ) );
|
||||
@@ -200,29 +204,29 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle - press, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 ) );
|
||||
tess.addVertexWithUV( TwoPx, middle - press, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 ) );
|
||||
tess.addVertexWithUV( TwoPx, middle - base, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 - 16 * (press - base) ) );
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle + -base, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 - 16 * (press - base) ) );
|
||||
tess.addVertexWithUV( TwoPx, middle - base, 1.0 - TwoPx, ic.getInterpolatedU( 14 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) );
|
||||
tess.addVertexWithUV( 1.0 - TwoPx, middle + -base, 1.0 - TwoPx, ic.getInterpolatedU( 2 ), ic.getInterpolatedV( 3 - 16 * ( press - base ) ) );
|
||||
|
||||
tess.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
int items = 0;
|
||||
if ( inv.getStackInSlot( 0 ) != null )
|
||||
if( inv.getStackInSlot( 0 ) != null )
|
||||
items++;
|
||||
if ( inv.getStackInSlot( 1 ) != null )
|
||||
if( inv.getStackInSlot( 1 ) != null )
|
||||
items++;
|
||||
if ( inv.getStackInSlot( 2 ) != null )
|
||||
if( inv.getStackInSlot( 2 ) != null )
|
||||
items++;
|
||||
|
||||
if ( relativeProgress > 1.0f || items == 0 )
|
||||
if( relativeProgress > 1.0f || items == 0 )
|
||||
{
|
||||
ItemStack is = inv.getStackInSlot( 3 );
|
||||
|
||||
if ( is == null )
|
||||
if( is == null )
|
||||
{
|
||||
InscriberRecipe ir = inv.getTask();
|
||||
if ( ir != null )
|
||||
if( ir != null )
|
||||
is = ir.output.copy();
|
||||
}
|
||||
|
||||
@@ -234,13 +238,11 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
this.renderItem( inv.getStackInSlot( 1 ), -press, block, tile, tess, x, y, z, f, renderer );
|
||||
this.renderItem( inv.getStackInSlot( 2 ), 0.0f, block, tile, tess, x, y, z, f, renderer );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void renderItem(ItemStack sis, float o, AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f,
|
||||
RenderBlocks renderer)
|
||||
public void renderItem( ItemStack sis, float o, AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
|
||||
{
|
||||
if ( sis != null )
|
||||
if( sis != null )
|
||||
{
|
||||
sis = sis.copy();
|
||||
GL11.glPushMatrix();
|
||||
@@ -253,7 +255,7 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
GL11.glScalef( 1.0f, 1.0f, 1.0f );
|
||||
|
||||
Block blk = Block.getBlockFromItem( sis.getItem() );
|
||||
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 );
|
||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
||||
@@ -275,7 +277,7 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
|
||||
this.doRenderItem( sis, tile );
|
||||
}
|
||||
catch (Exception err)
|
||||
catch( Exception err )
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
@@ -283,5 +285,4 @@ public class RenderBlockInscriber extends BaseBlockRender
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -29,20 +30,22 @@ import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
|
||||
|
||||
public class RenderBlockInterface extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockInterface() {
|
||||
public RenderBlockInterface()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileInterface ti = block.getTileEntity( world, x, y, z );
|
||||
BlockRenderInfo info = block.getRendererInstance();
|
||||
|
||||
if ( ti != null && ti.getForward() != ForgeDirection.UNKNOWN )
|
||||
if( ti != null && ti.getForward() != ForgeDirection.UNKNOWN )
|
||||
{
|
||||
IIcon side = ExtraBlockTextures.BlockInterfaceAlternateArrow.getIcon();
|
||||
info.setTemporaryRenderIcons( ExtraBlockTextures.BlockInterfaceAlternate.getIcon(), block.getIcon( 0, 0 ), side, side, side, side );
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -34,25 +35,27 @@ import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.helpers.Splotch;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
|
||||
|
||||
public class RenderBlockPaint extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockPaint() {
|
||||
public RenderBlockPaint()
|
||||
{
|
||||
super( false, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TilePaint tp = imb.getTileEntity( world, x, y, z );
|
||||
boolean out = false;
|
||||
if ( tp != null )
|
||||
if( tp != null )
|
||||
{
|
||||
// super.renderInWorld( imb, world, x, y, z, renderer );
|
||||
|
||||
@@ -67,18 +70,18 @@ public class RenderBlockPaint extends BaseBlockRender
|
||||
|
||||
EnumSet<ForgeDirection> validSides = EnumSet.noneOf( ForgeDirection.class );
|
||||
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
if ( tp.isSideValid( side ) )
|
||||
if( tp.isSideValid( side ) )
|
||||
validSides.add( side );
|
||||
}
|
||||
|
||||
for (Splotch s : tp.getDots())
|
||||
for( Splotch s : tp.getDots() )
|
||||
{
|
||||
if ( !validSides.contains( s.side ) )
|
||||
if( !validSides.contains( s.side ) )
|
||||
continue;
|
||||
|
||||
if ( s.lumen )
|
||||
if( s.lumen )
|
||||
{
|
||||
tess.setColorOpaque_I( s.color.whiteVariant );
|
||||
tess.setBrightness( lumen );
|
||||
@@ -100,13 +103,13 @@ public class RenderBlockPaint extends BaseBlockRender
|
||||
pos_x = Math.max( H, Math.min( 1.0 - H, pos_x ) );
|
||||
pos_y = Math.max( H, Math.min( 1.0 - H, pos_y ) );
|
||||
|
||||
if ( s.side == ForgeDirection.SOUTH || s.side == ForgeDirection.NORTH )
|
||||
if( s.side == ForgeDirection.SOUTH || s.side == ForgeDirection.NORTH )
|
||||
{
|
||||
pos_x += x;
|
||||
pos_y += y;
|
||||
}
|
||||
|
||||
else if ( s.side == ForgeDirection.UP || s.side == ForgeDirection.DOWN )
|
||||
else if( s.side == ForgeDirection.UP || s.side == ForgeDirection.DOWN )
|
||||
{
|
||||
pos_x += x;
|
||||
pos_y += z;
|
||||
@@ -120,54 +123,54 @@ public class RenderBlockPaint extends BaseBlockRender
|
||||
|
||||
IIcon ico = icoSet[s.getSeed() % icoSet.length];
|
||||
|
||||
switch (s.side)
|
||||
switch( s.side )
|
||||
{
|
||||
case UP:
|
||||
offset = 1.0 - offset;
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
case UP:
|
||||
offset = 1.0 - offset;
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
case DOWN:
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, y + offset, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x + H, y + offset, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
offset = 1.0 - offset;
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
case EAST:
|
||||
offset = 1.0 - offset;
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
case WEST:
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y - H, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y - H, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x + H, pos_y + H, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( x + offset, pos_x - H, pos_y + H, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
offset = 1.0 - offset;
|
||||
tess.addVertexWithUV( pos_x + H, pos_y - H, z + offset, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, pos_y - H, z + offset, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, pos_y + H, z + offset, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x + H, pos_y + H, z + offset, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
case SOUTH:
|
||||
offset = 1.0 - offset;
|
||||
tess.addVertexWithUV( pos_x + H, pos_y - H, z + offset, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, pos_y - H, z + offset, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x - H, pos_y + H, z + offset, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x + H, pos_y + H, z + offset, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
tess.addVertexWithUV( pos_x - H, pos_y - H, z + offset, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, pos_y - H, z + offset, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, pos_y + H, z + offset, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x - H, pos_y + H, z + offset, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
case NORTH:
|
||||
tess.addVertexWithUV( pos_x - H, pos_y - H, z + offset, ico.getMinU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, pos_y - H, z + offset, ico.getMaxU(), ico.getMinV() );
|
||||
tess.addVertexWithUV( pos_x + H, pos_y + H, z + offset, ico.getMaxU(), ico.getMaxV() );
|
||||
tess.addVertexWithUV( pos_x - H, pos_y + H, z + offset, ico.getMinU(), ico.getMaxV() );
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -28,20 +29,22 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||
|
||||
|
||||
public class RenderBlockQuartzAccelerator extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockQuartzAccelerator() {
|
||||
public RenderBlockQuartzAccelerator()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
if ( te instanceof TileQuartzGrowthAccelerator )
|
||||
if( te instanceof TileQuartzGrowthAccelerator )
|
||||
{
|
||||
if ( ((TileQuartzGrowthAccelerator) te).hasPower )
|
||||
if( ( (TileQuartzGrowthAccelerator) te ).hasPower )
|
||||
{
|
||||
IIcon top_Bottom = ExtraBlockTextures.BlockQuartzGrowthAcceleratorOn.getIcon();
|
||||
IIcon side = ExtraBlockTextures.BlockQuartzGrowthAcceleratorSideOn.getIcon();
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -34,23 +35,25 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
|
||||
|
||||
public class RenderBlockSkyChest extends BaseBlockRender
|
||||
{
|
||||
|
||||
final ModelChest model = new ModelChest();
|
||||
|
||||
public RenderBlockSkyChest() {
|
||||
public RenderBlockSkyChest()
|
||||
{
|
||||
super( true, 80 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
ResourceLocation loc;
|
||||
if ( is.getItemDamage() == 1 )
|
||||
if( is.getItemDamage() == 1 )
|
||||
loc = new ResourceLocation( "appliedenergistics2", "textures/models/skyblockchest.png" );
|
||||
else
|
||||
loc = new ResourceLocation( "appliedenergistics2", "textures/models/skychest.png" );
|
||||
@@ -62,37 +65,37 @@ public class RenderBlockSkyChest extends BaseBlockRender
|
||||
GL11.glScalef( 1.0F, -1F, -1F );
|
||||
GL11.glTranslatef( -0.0F, -1.0F, -1.0F );
|
||||
|
||||
this.model.chestLid.offsetY = -(0.9f / 16.0f);
|
||||
this.model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F);
|
||||
this.model.chestLid.offsetY = -( 0.9f / 16.0f );
|
||||
this.model.chestLid.rotateAngleX = -( ( lidAngle * 3.141593F ) / 2.0F );
|
||||
this.model.renderAll();
|
||||
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer)
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer )
|
||||
{
|
||||
if ( !(tile instanceof TileSkyChest) )
|
||||
if( !( tile instanceof TileSkyChest ) )
|
||||
return;
|
||||
|
||||
TileSkyChest skyChest = (TileSkyChest) tile;
|
||||
|
||||
if ( !skyChest.hasWorldObj() )
|
||||
if( !skyChest.hasWorldObj() )
|
||||
return;
|
||||
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
ResourceLocation loc;
|
||||
|
||||
if ( tile.getWorldObj().getBlockMetadata( tile.xCoord, tile.yCoord, tile.zCoord ) == 1 )
|
||||
if( tile.getWorldObj().getBlockMetadata( tile.xCoord, tile.yCoord, tile.zCoord ) == 1 )
|
||||
loc = new ResourceLocation( "appliedenergistics2", "textures/models/skyblockchest.png" );
|
||||
else
|
||||
loc = new ResourceLocation( "appliedenergistics2", "textures/models/skychest.png" );
|
||||
@@ -107,26 +110,26 @@ public class RenderBlockSkyChest extends BaseBlockRender
|
||||
long now = System.currentTimeMillis();
|
||||
long distance = now - skyChest.lastEvent;
|
||||
|
||||
if ( skyChest.playerOpen > 0 )
|
||||
if( skyChest.playerOpen > 0 )
|
||||
skyChest.lidAngle += distance * 0.0001;
|
||||
else
|
||||
skyChest.lidAngle -= distance * 0.0001;
|
||||
|
||||
if ( skyChest.lidAngle > 0.5f )
|
||||
if( skyChest.lidAngle > 0.5f )
|
||||
skyChest.lidAngle = 0.5f;
|
||||
|
||||
if ( skyChest.lidAngle < 0.0f )
|
||||
if( skyChest.lidAngle < 0.0f )
|
||||
skyChest.lidAngle = 0.0f;
|
||||
|
||||
float lidAngle = skyChest.lidAngle;
|
||||
lidAngle = 1.0F - lidAngle;
|
||||
lidAngle = 1.0F - lidAngle * lidAngle * lidAngle;
|
||||
|
||||
this.model.chestLid.offsetY = -(1.01f / 16.0f);
|
||||
this.model.chestLid.rotateAngleX = -((lidAngle * 3.141593F) / 2.0F);
|
||||
this.model.chestLid.offsetY = -( 1.01f / 16.0f );
|
||||
this.model.chestLid.rotateAngleX = -( ( lidAngle * 3.141593F ) / 2.0F );
|
||||
this.model.renderAll();
|
||||
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -39,40 +40,42 @@ import appeng.hooks.CompassResult;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
|
||||
|
||||
public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
{
|
||||
|
||||
float r = 0;
|
||||
final ModelCompass model = new ModelCompass();
|
||||
float r = 0;
|
||||
|
||||
public RenderBlockSkyCompass() {
|
||||
public RenderBlockSkyCompass()
|
||||
{
|
||||
super( true, 80 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
if ( type == ItemRenderType.INVENTORY )
|
||||
if( type == ItemRenderType.INVENTORY )
|
||||
{
|
||||
boolean isGood = false;
|
||||
|
||||
IInventory inv = Minecraft.getMinecraft().thePlayer.inventory;
|
||||
for (int x = 0; x < inv.getSizeInventory(); x++)
|
||||
if ( inv.getStackInSlot( x ) == is )
|
||||
for( int x = 0; x < inv.getSizeInventory(); x++ )
|
||||
if( inv.getStackInSlot( x ) == is )
|
||||
isGood = true;
|
||||
|
||||
if ( !isGood )
|
||||
if( !isGood )
|
||||
type = ItemRenderType.FIRST_PERSON_MAP;
|
||||
}
|
||||
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture( loc );
|
||||
|
||||
if ( type == ItemRenderType.ENTITY )
|
||||
if( type == ItemRenderType.ENTITY )
|
||||
{
|
||||
GL11.glRotatef( -90.0f, 0.0f, 0.0f, 1.0f );
|
||||
GL11.glScalef( 1.0F, -1F, -1F );
|
||||
@@ -81,25 +84,25 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
if( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
GL11.glRotatef( 15.3f, 0.0f, 0.0f, 1.0f );
|
||||
|
||||
GL11.glScalef( 1.0F, -1F, -1F );
|
||||
GL11.glScalef( 2.5f, 2.5f, 2.5f );
|
||||
|
||||
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
if( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
GL11.glTranslatef( 0.3F, -1.65F, -0.19F );
|
||||
else
|
||||
GL11.glTranslatef( 0.2F, -1.65F, -0.19F );
|
||||
}
|
||||
|
||||
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;
|
||||
float rYaw = p.rotationYaw;
|
||||
|
||||
if ( type == ItemRenderType.EQUIPPED )
|
||||
if( type == ItemRenderType.EQUIPPED )
|
||||
{
|
||||
p = (EntityPlayer) obj[1];
|
||||
rYaw = p.renderYawOffset;
|
||||
@@ -110,20 +113,20 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
int z = (int) p.posZ;
|
||||
CompassResult cr = CompassManager.INSTANCE.getCompassDirection( 0, x, y, z );
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int j = 0; j < 3; j++)
|
||||
for( int i = 0; i < 3; i++ )
|
||||
for( int j = 0; j < 3; j++ )
|
||||
CompassManager.INSTANCE.getCompassDirection( 0, x + i - 1, y, z + j - 1 );
|
||||
|
||||
if ( cr.hasResult )
|
||||
if( cr.hasResult )
|
||||
{
|
||||
if ( cr.spin )
|
||||
if( cr.spin )
|
||||
{
|
||||
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
|
||||
{
|
||||
if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
if( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
|
||||
{
|
||||
float offRads = rYaw / 180.0f * (float) Math.PI;
|
||||
float adjustment = (float) Math.PI * 0.74f;
|
||||
@@ -140,38 +143,37 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
else
|
||||
{
|
||||
now %= 1000000;
|
||||
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
|
||||
this.model.renderAll( ( now / 500000.0f ) * (float) Math.PI * 500.0f );
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
now %= 100000;
|
||||
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
|
||||
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
|
||||
}
|
||||
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer)
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer )
|
||||
{
|
||||
if ( !(tile instanceof TileSkyCompass) )
|
||||
if( !( tile instanceof TileSkyCompass ) )
|
||||
return;
|
||||
|
||||
TileSkyCompass skyCompass = (TileSkyCompass) tile;
|
||||
|
||||
if ( !skyCompass.hasWorldObj() )
|
||||
if( !skyCompass.hasWorldObj() )
|
||||
return;
|
||||
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
|
||||
@@ -186,33 +188,32 @@ public class RenderBlockSkyCompass extends BaseBlockRender
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
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, tile.xCoord, tile.yCoord, tile.zCoord );
|
||||
else
|
||||
cr = new CompassResult( false, true, 0 );
|
||||
|
||||
if ( cr.hasResult )
|
||||
if( cr.hasResult )
|
||||
{
|
||||
if ( cr.spin )
|
||||
if( cr.spin )
|
||||
{
|
||||
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
|
||||
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.rad ) : cr.rad ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
now %= 1000000;
|
||||
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
|
||||
this.model.renderAll( ( now / 500000.0f ) * (float) Math.PI * 500.0f );
|
||||
}
|
||||
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */);
|
||||
GL11.glDisable( 32826 /* GL_RESCALE_NORMAL_EXT */ );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
}
|
||||
|
||||
private double flipidiy(double rad)
|
||||
private double flipidiy( double rad )
|
||||
{
|
||||
double x = Math.cos( rad );
|
||||
double y = Math.sin( rad );
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -38,15 +39,24 @@ import appeng.client.texture.OffsetIcon;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class RenderBlockWireless extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderBlockWireless() {
|
||||
int centerX = 0;
|
||||
int centerY = 0;
|
||||
int centerZ = 0;
|
||||
AEBaseBlock blk;
|
||||
boolean hasChan = false;
|
||||
boolean hasPower = false;
|
||||
|
||||
public RenderBlockWireless()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
this.blk = blk;
|
||||
this.centerX = 0;
|
||||
@@ -81,43 +91,30 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
|
||||
int s = 1;
|
||||
|
||||
for (ForgeDirection side : sides)
|
||||
for( ForgeDirection side : sides )
|
||||
{
|
||||
this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2
|
||||
+ (side.offsetZ != 0 ? side.offsetZ * 2 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 4 : 2),
|
||||
8 + (side.offsetY != 0 ? side.offsetY * 4 : 2), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, ForgeDirection.EAST, ForgeDirection.UP,
|
||||
ForgeDirection.SOUTH );
|
||||
this.renderBlockBounds( renderer, 8 + ( side.offsetX != 0 ? side.offsetX * 2 : -2 ), 8 + ( side.offsetY != 0 ? side.offsetY * 2 : -2 ), 2 + ( side.offsetZ != 0 ? side.offsetZ * 2 : -1 ) + s, 8 + ( side.offsetX != 0 ? side.offsetX * 4 : 2 ), 8 + ( side.offsetY != 0 ? side.offsetY * 4 : 2 ), 2 + ( side.offsetZ != 0 ? side.offsetZ * 5 : 1 ) + s, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
|
||||
}
|
||||
|
||||
s = 3;
|
||||
for (ForgeDirection side : sides)
|
||||
for( ForgeDirection side : sides )
|
||||
{
|
||||
this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1
|
||||
+ (side.offsetZ != 0 ? side.offsetZ * 4 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 5 : 1),
|
||||
8 + (side.offsetY != 0 ? side.offsetY * 5 : 1), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, ForgeDirection.EAST, ForgeDirection.UP,
|
||||
ForgeDirection.SOUTH );
|
||||
this.renderBlockBounds( renderer, 8 + ( side.offsetX != 0 ? side.offsetX * 4 : -1 ), 8 + ( side.offsetY != 0 ? side.offsetY * 4 : -1 ), 1 + ( side.offsetZ != 0 ? side.offsetZ * 4 : -1 ) + s, 8 + ( side.offsetX != 0 ? side.offsetX * 5 : 1 ), 8 + ( side.offsetY != 0 ? side.offsetY * 5 : 1 ), 2 + ( side.offsetZ != 0 ? side.offsetZ * 5 : 1 ) + s, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
|
||||
this.renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );
|
||||
}
|
||||
}
|
||||
|
||||
int centerX = 0;
|
||||
int centerY = 0;
|
||||
int centerZ = 0;
|
||||
AEBaseBlock blk;
|
||||
boolean hasChan = false;
|
||||
boolean hasPower = false;
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileWireless tw = blk.getTileEntity( world, x, y, z );
|
||||
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.hasPower = (tw.clientFlags & TileWireless.POWERED_FLAG) == TileWireless.POWERED_FLAG;
|
||||
this.hasChan = ( tw.clientFlags & ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG ) ) == ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG );
|
||||
this.hasPower = ( tw.clientFlags & TileWireless.POWERED_FLAG ) == TileWireless.POWERED_FLAG;
|
||||
|
||||
BlockRenderInfo ri = blk.getRendererInstance();
|
||||
|
||||
@@ -151,20 +148,16 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
|
||||
int s = 1;
|
||||
|
||||
for (ForgeDirection side : sides)
|
||||
for( ForgeDirection side : sides )
|
||||
{
|
||||
this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2
|
||||
+ (side.offsetZ != 0 ? side.offsetZ * 2 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 4 : 2),
|
||||
8 + (side.offsetY != 0 ? side.offsetY * 4 : 2), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz );
|
||||
this.renderBlockBounds( renderer, 8 + ( side.offsetX != 0 ? side.offsetX * 2 : -2 ), 8 + ( side.offsetY != 0 ? side.offsetY * 2 : -2 ), 2 + ( side.offsetZ != 0 ? side.offsetZ * 2 : -1 ) + s, 8 + ( side.offsetX != 0 ? side.offsetX * 4 : 2 ), 8 + ( side.offsetY != 0 ? side.offsetY * 4 : 2 ), 2 + ( side.offsetZ != 0 ? side.offsetZ * 5 : 1 ) + s, fdx, fdy, fdz );
|
||||
super.renderInWorld( blk, world, x, y, z, renderer );
|
||||
}
|
||||
|
||||
s = 3;
|
||||
for (ForgeDirection side : sides)
|
||||
for( ForgeDirection side : sides )
|
||||
{
|
||||
this.renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1
|
||||
+ (side.offsetZ != 0 ? side.offsetZ * 4 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 5 : 1),
|
||||
8 + (side.offsetY != 0 ? side.offsetY * 5 : 1), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz );
|
||||
this.renderBlockBounds( renderer, 8 + ( side.offsetX != 0 ? side.offsetX * 4 : -1 ), 8 + ( side.offsetY != 0 ? side.offsetY * 4 : -1 ), 1 + ( side.offsetZ != 0 ? side.offsetZ * 4 : -1 ) + s, 8 + ( side.offsetX != 0 ? side.offsetX * 5 : 1 ), 8 + ( side.offsetY != 0 ? side.offsetY * 5 : 1 ), 2 + ( side.offsetZ != 0 ? side.offsetZ * 5 : 1 ) + s, fdx, fdy, fdz );
|
||||
super.renderInWorld( blk, world, x, y, z, renderer );
|
||||
}
|
||||
|
||||
@@ -173,13 +166,13 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
// ExtraTextures.BlockChargerInside.getIcon(), r, r );
|
||||
this.renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );
|
||||
|
||||
if ( this.hasChan )
|
||||
if( this.hasChan )
|
||||
{
|
||||
int l = 14;
|
||||
Tessellator.instance.setBrightness( l << 20 | l << 4 );
|
||||
Tessellator.instance.setColorOpaque_I( AEColor.Transparent.blackVariant );
|
||||
}
|
||||
else if ( this.hasPower )
|
||||
else if( this.hasPower )
|
||||
{
|
||||
int l = 9;
|
||||
Tessellator.instance.setBrightness( l << 20 | l << 4 );
|
||||
@@ -191,17 +184,17 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
Tessellator.instance.setColorOpaque_I( 0x000000 );
|
||||
}
|
||||
|
||||
if ( ForgeDirection.UP != fdz.getOpposite() )
|
||||
if( ForgeDirection.UP != fdz.getOpposite() )
|
||||
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.UP );
|
||||
if ( ForgeDirection.DOWN != fdz.getOpposite() )
|
||||
if( ForgeDirection.DOWN != fdz.getOpposite() )
|
||||
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.DOWN );
|
||||
if ( ForgeDirection.EAST != fdz.getOpposite() )
|
||||
if( ForgeDirection.EAST != fdz.getOpposite() )
|
||||
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.EAST );
|
||||
if ( ForgeDirection.WEST != fdz.getOpposite() )
|
||||
if( ForgeDirection.WEST != fdz.getOpposite() )
|
||||
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.WEST );
|
||||
if ( ForgeDirection.SOUTH != fdz.getOpposite() )
|
||||
if( ForgeDirection.SOUTH != fdz.getOpposite() )
|
||||
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.SOUTH );
|
||||
if ( ForgeDirection.NORTH != fdz.getOpposite() )
|
||||
if( ForgeDirection.NORTH != fdz.getOpposite() )
|
||||
super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.NORTH );
|
||||
|
||||
ri.setTemporaryRenderIcon( null );
|
||||
@@ -211,45 +204,45 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
return true;
|
||||
}
|
||||
|
||||
private void renderTorchAtAngle(RenderBlocks renderer, ForgeDirection x, ForgeDirection y, ForgeDirection z)
|
||||
private void renderTorchAtAngle( RenderBlocks renderer, ForgeDirection x, ForgeDirection y, ForgeDirection z )
|
||||
{
|
||||
IIcon r = (this.hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : this.blk.getIcon( 0, 0 ));
|
||||
IIcon r = ( this.hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : this.blk.getIcon( 0, 0 ) );
|
||||
IIcon sides = new OffsetIcon( r, 0.0f, -2.0f );
|
||||
|
||||
switch (z)
|
||||
switch( z )
|
||||
{
|
||||
case DOWN:
|
||||
renderer.uvRotateNorth = 3;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
renderer.uvRotateWest = 3;
|
||||
break;
|
||||
case EAST:
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateNorth = 2;
|
||||
renderer.uvRotateSouth = 1;
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
break;
|
||||
case WEST:
|
||||
renderer.uvRotateTop = 2;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateEast = 1;
|
||||
renderer.uvRotateWest = 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case DOWN:
|
||||
renderer.uvRotateNorth = 3;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
renderer.uvRotateWest = 3;
|
||||
break;
|
||||
case EAST:
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateNorth = 2;
|
||||
renderer.uvRotateSouth = 1;
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
break;
|
||||
case WEST:
|
||||
renderer.uvRotateTop = 2;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateEast = 1;
|
||||
renderer.uvRotateWest = 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Tessellator.instance.setColorOpaque_I( 0xffffff );
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -34,15 +35,17 @@ import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class RenderDrive extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderDrive() {
|
||||
public RenderDrive()
|
||||
{
|
||||
super( false, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
renderer.overrideBlockTexture = ExtraBlockTextures.getMissing();
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||
@@ -52,7 +55,7 @@ public class RenderDrive extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileDrive sp = imb.getTileEntity( world, x, y, z );
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
@@ -68,219 +71,149 @@ public class RenderDrive extends BaseBlockRender
|
||||
|
||||
int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 );
|
||||
|
||||
for (int yy = 0; yy < 5; yy++)
|
||||
for( int yy = 0; yy < 5; yy++ )
|
||||
{
|
||||
for (int xx = 0; xx < 2; xx++)
|
||||
for( int xx = 0; xx < 2; xx++ )
|
||||
{
|
||||
int stat = sp.getCellStatus( yy * 2 + (1 - xx) );
|
||||
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 );
|
||||
|
||||
int spin = 0;
|
||||
|
||||
switch (forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3)
|
||||
switch( forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3 )
|
||||
{
|
||||
case 1:
|
||||
switch (up)
|
||||
{
|
||||
case UP:
|
||||
spin = 3;
|
||||
case 1:
|
||||
switch( up )
|
||||
{
|
||||
case UP:
|
||||
spin = 3;
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 1;
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 0;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 1;
|
||||
case -1:
|
||||
switch( up )
|
||||
{
|
||||
case UP:
|
||||
spin = 1;
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 3;
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 0;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 0;
|
||||
case -2:
|
||||
switch( up )
|
||||
{
|
||||
case EAST:
|
||||
spin = 1;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 3;
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 2;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 0;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 2;
|
||||
case 2:
|
||||
switch( up )
|
||||
{
|
||||
case EAST:
|
||||
spin = 1;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 3;
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 0;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 0;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case -1:
|
||||
switch (up)
|
||||
{
|
||||
case UP:
|
||||
spin = 1;
|
||||
case 3:
|
||||
switch( up )
|
||||
{
|
||||
case UP:
|
||||
spin = 2;
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 0;
|
||||
break;
|
||||
case EAST:
|
||||
spin = 3;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 1;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 3;
|
||||
case -3:
|
||||
switch( up )
|
||||
{
|
||||
case UP:
|
||||
spin = 2;
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 0;
|
||||
break;
|
||||
case EAST:
|
||||
spin = 1;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 3;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 0;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case -2:
|
||||
switch (up)
|
||||
{
|
||||
case EAST:
|
||||
spin = 1;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 3;
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 2;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 0;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (up)
|
||||
{
|
||||
case EAST:
|
||||
spin = 1;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 3;
|
||||
break;
|
||||
case NORTH:
|
||||
spin = 0;
|
||||
break;
|
||||
case SOUTH:
|
||||
spin = 0;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (up)
|
||||
{
|
||||
case UP:
|
||||
spin = 2;
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 0;
|
||||
break;
|
||||
case EAST:
|
||||
spin = 3;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 1;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case -3:
|
||||
switch (up)
|
||||
{
|
||||
case UP:
|
||||
spin = 2;
|
||||
break;
|
||||
case DOWN:
|
||||
spin = 0;
|
||||
break;
|
||||
case EAST:
|
||||
spin = 1;
|
||||
break;
|
||||
case WEST:
|
||||
spin = 3;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
double u1 = ico.getInterpolatedU( (spin % 4 < 2) ? 1 : 6 );
|
||||
double u2 = ico.getInterpolatedU( ((spin + 1) % 4 < 2) ? 1 : 6 );
|
||||
double u3 = ico.getInterpolatedU( ((spin + 2) % 4 < 2) ? 1 : 6 );
|
||||
double u4 = ico.getInterpolatedU( ((spin + 3) % 4 < 2) ? 1 : 6 );
|
||||
double u1 = ico.getInterpolatedU( ( spin % 4 < 2 ) ? 1 : 6 );
|
||||
double u2 = ico.getInterpolatedU( ( ( spin + 1 ) % 4 < 2 ) ? 1 : 6 );
|
||||
double u3 = ico.getInterpolatedU( ( ( spin + 2 ) % 4 < 2 ) ? 1 : 6 );
|
||||
double u4 = ico.getInterpolatedU( ( ( spin + 3 ) % 4 < 2 ) ? 1 : 6 );
|
||||
|
||||
int m = 1;
|
||||
int mx = 3;
|
||||
if ( stat == 0 )
|
||||
if( stat == 0 )
|
||||
{
|
||||
m = 4;
|
||||
mx = 5;
|
||||
}
|
||||
|
||||
double v1 = ico.getInterpolatedV( ((spin + 1) % 4 < 2) ? m : mx );
|
||||
double v2 = ico.getInterpolatedV( ((spin + 2) % 4 < 2) ? m : mx );
|
||||
double v3 = ico.getInterpolatedV( ((spin + 3) % 4 < 2) ? m : mx );
|
||||
double v4 = ico.getInterpolatedV( ((spin) % 4 < 2) ? m : mx );
|
||||
double v1 = ico.getInterpolatedV( ( ( spin + 1 ) % 4 < 2 ) ? m : mx );
|
||||
double v2 = ico.getInterpolatedV( ( ( spin + 2 ) % 4 < 2 ) ? m : mx );
|
||||
double v3 = ico.getInterpolatedV( ( ( spin + 3 ) % 4 < 2 ) ? m : mx );
|
||||
double v4 = ico.getInterpolatedV( ( ( spin ) % 4 < 2 ) ? m : mx );
|
||||
|
||||
tess.setBrightness( b );
|
||||
tess.setColorOpaque_I( 0xffffff );
|
||||
switch (forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3)
|
||||
switch( forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3 )
|
||||
{
|
||||
case 1:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case -1:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case -2:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case 2:
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case 3:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4 );
|
||||
break;
|
||||
case -3:
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4 );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (forward == ForgeDirection.UP && up == ForgeDirection.SOUTH) || forward == ForgeDirection.DOWN )
|
||||
this.selectFace( renderer, west, up, forward, 3 + xx * 7, 4 + xx * 7, 1 + yy * 3, 2 + yy * 3 );
|
||||
else
|
||||
this.selectFace( renderer, west, up, forward, 5 + xx * 7, 6 + xx * 7, 2 + yy * 3, 3 + yy * 3 );
|
||||
|
||||
if ( stat != 0 )
|
||||
{
|
||||
IIcon whiteIcon = ExtraBlockTextures.White.getIcon();
|
||||
u1 = whiteIcon.getInterpolatedU( (spin % 4 < 2) ? 1 : 6 );
|
||||
u2 = whiteIcon.getInterpolatedU( ((spin + 1) % 4 < 2) ? 1 : 6 );
|
||||
u3 = whiteIcon.getInterpolatedU( ((spin + 2) % 4 < 2) ? 1 : 6 );
|
||||
u4 = whiteIcon.getInterpolatedU( ((spin + 3) % 4 < 2) ? 1 : 6 );
|
||||
|
||||
v1 = whiteIcon.getInterpolatedV( ((spin + 1) % 4 < 2) ? 1 : 3 );
|
||||
v2 = whiteIcon.getInterpolatedV( ((spin + 2) % 4 < 2) ? 1 : 3 );
|
||||
v3 = whiteIcon.getInterpolatedV( ((spin + 3) % 4 < 2) ? 1 : 3 );
|
||||
v4 = whiteIcon.getInterpolatedV( ((spin) % 4 < 2) ? 1 : 3 );
|
||||
|
||||
if ( sp.isPowered() )
|
||||
tess.setBrightness( 15 << 20 | 15 << 4 );
|
||||
else
|
||||
tess.setBrightness( 0 );
|
||||
|
||||
if ( stat == 1 )
|
||||
Tessellator.instance.setColorOpaque_I( 0x00ff00 );
|
||||
if ( stat == 2 )
|
||||
Tessellator.instance.setColorOpaque_I( 0xffaa00 );
|
||||
if ( stat == 3 )
|
||||
Tessellator.instance.setColorOpaque_I( 0xff0000 );
|
||||
|
||||
switch (forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3)
|
||||
{
|
||||
case 1:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
@@ -317,6 +250,76 @@ public class RenderDrive extends BaseBlockRender
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4 );
|
||||
break;
|
||||
}
|
||||
|
||||
if( ( forward == ForgeDirection.UP && up == ForgeDirection.SOUTH ) || forward == ForgeDirection.DOWN )
|
||||
this.selectFace( renderer, west, up, forward, 3 + xx * 7, 4 + xx * 7, 1 + yy * 3, 2 + yy * 3 );
|
||||
else
|
||||
this.selectFace( renderer, west, up, forward, 5 + xx * 7, 6 + xx * 7, 2 + yy * 3, 3 + yy * 3 );
|
||||
|
||||
if( stat != 0 )
|
||||
{
|
||||
IIcon whiteIcon = ExtraBlockTextures.White.getIcon();
|
||||
u1 = whiteIcon.getInterpolatedU( ( spin % 4 < 2 ) ? 1 : 6 );
|
||||
u2 = whiteIcon.getInterpolatedU( ( ( spin + 1 ) % 4 < 2 ) ? 1 : 6 );
|
||||
u3 = whiteIcon.getInterpolatedU( ( ( spin + 2 ) % 4 < 2 ) ? 1 : 6 );
|
||||
u4 = whiteIcon.getInterpolatedU( ( ( spin + 3 ) % 4 < 2 ) ? 1 : 6 );
|
||||
|
||||
v1 = whiteIcon.getInterpolatedV( ( ( spin + 1 ) % 4 < 2 ) ? 1 : 3 );
|
||||
v2 = whiteIcon.getInterpolatedV( ( ( spin + 2 ) % 4 < 2 ) ? 1 : 3 );
|
||||
v3 = whiteIcon.getInterpolatedV( ( ( spin + 3 ) % 4 < 2 ) ? 1 : 3 );
|
||||
v4 = whiteIcon.getInterpolatedV( ( ( spin ) % 4 < 2 ) ? 1 : 3 );
|
||||
|
||||
if( sp.isPowered() )
|
||||
tess.setBrightness( 15 << 20 | 15 << 4 );
|
||||
else
|
||||
tess.setBrightness( 0 );
|
||||
|
||||
if( stat == 1 )
|
||||
Tessellator.instance.setColorOpaque_I( 0x00ff00 );
|
||||
if( stat == 2 )
|
||||
Tessellator.instance.setColorOpaque_I( 0xffaa00 );
|
||||
if( stat == 3 )
|
||||
Tessellator.instance.setColorOpaque_I( 0xff0000 );
|
||||
|
||||
switch( forward.offsetX + forward.offsetY * 2 + forward.offsetZ * 3 )
|
||||
{
|
||||
case 1:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case -1:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case -2:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case 2:
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMinZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMinZ, u4, v4 );
|
||||
break;
|
||||
case 3:
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4 );
|
||||
break;
|
||||
case -3:
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMinY, z + renderer.renderMaxZ, u1, v1 );
|
||||
tess.addVertexWithUV( x + renderer.renderMinX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u2, v2 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMaxY, z + renderer.renderMaxZ, u3, v3 );
|
||||
tess.addVertexWithUV( x + renderer.renderMaxX, y + renderer.renderMinY, z + renderer.renderMaxZ, u4, v4 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -39,35 +40,37 @@ import appeng.client.texture.OffsetIcon;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class RenderMEChest extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderMEChest() {
|
||||
public RenderMEChest()
|
||||
{
|
||||
super( false, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
Tessellator.instance.setBrightness( 0 );
|
||||
renderer.overrideBlockTexture = ExtraBlockTextures.getMissing();
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||
|
||||
renderer.overrideBlockTexture = ExtraBlockTextures.MEChest.getIcon();
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, this.adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ),
|
||||
renderer );
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, this.adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ), renderer );
|
||||
|
||||
renderer.overrideBlockTexture = null;
|
||||
super.renderInventory( block, is, renderer, type, obj );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileChest sp = imb.getTileEntity( world, x, y, z );
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
|
||||
if ( sp == null ) return false;
|
||||
if( sp == null )
|
||||
return false;
|
||||
|
||||
ForgeDirection up = sp.getUp();
|
||||
ForgeDirection forward = sp.getForward();
|
||||
@@ -82,7 +85,7 @@ public class RenderMEChest extends BaseBlockRender
|
||||
|
||||
int offsetU = -4;
|
||||
int offsetV = 8;
|
||||
if ( stat == 0 )
|
||||
if( stat == 0 )
|
||||
offsetV = 3;
|
||||
|
||||
int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 );
|
||||
@@ -90,15 +93,15 @@ public class RenderMEChest extends BaseBlockRender
|
||||
Tessellator.instance.setColorOpaque_I( 0xffffff );
|
||||
|
||||
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 );
|
||||
else if ( forward == ForgeDirection.NORTH && up == ForgeDirection.EAST )
|
||||
else if( forward == ForgeDirection.NORTH && up == ForgeDirection.EAST )
|
||||
flippableIcon.setFlip( false, true );
|
||||
else if ( forward == ForgeDirection.NORTH && up == ForgeDirection.WEST )
|
||||
else if( forward == ForgeDirection.NORTH && up == ForgeDirection.WEST )
|
||||
flippableIcon.setFlip( true, false );
|
||||
else if ( forward == ForgeDirection.DOWN && up == ForgeDirection.EAST )
|
||||
else if( forward == ForgeDirection.DOWN && up == ForgeDirection.EAST )
|
||||
flippableIcon.setFlip( false, true );
|
||||
else if ( forward == ForgeDirection.DOWN )
|
||||
else if( forward == ForgeDirection.DOWN )
|
||||
flippableIcon.setFlip( true, false );
|
||||
|
||||
/*
|
||||
@@ -110,27 +113,27 @@ public class RenderMEChest extends BaseBlockRender
|
||||
|
||||
this.renderFace( x, y, z, imb, flippableIcon, renderer, forward );
|
||||
|
||||
if ( stat != 0 )
|
||||
if( stat != 0 )
|
||||
{
|
||||
b = 0;
|
||||
if ( sp.isPowered() )
|
||||
if( sp.isPowered() )
|
||||
{
|
||||
b = 15 << 20 | 15 << 4;
|
||||
}
|
||||
|
||||
Tessellator.instance.setBrightness( b );
|
||||
if ( stat == 1 )
|
||||
if( stat == 1 )
|
||||
Tessellator.instance.setColorOpaque_I( 0x00ff00 );
|
||||
if ( stat == 2 )
|
||||
if( stat == 2 )
|
||||
Tessellator.instance.setColorOpaque_I( 0xffaa00 );
|
||||
if ( stat == 3 )
|
||||
if( stat == 3 )
|
||||
Tessellator.instance.setColorOpaque_I( 0xff0000 );
|
||||
this.selectFace( renderer, west, up, forward, 9, 10, 11, 12 );
|
||||
this.renderFace( x, y, z, imb, ExtraBlockTextures.White.getIcon(), renderer, forward );
|
||||
}
|
||||
|
||||
b = world.getLightBrightnessForSkyBlocks( x + up.offsetX, y + up.offsetY, z + up.offsetZ, 0 );
|
||||
if ( sp.isPowered() )
|
||||
if( sp.isPowered() )
|
||||
{
|
||||
b = 15 << 20 | 15 << 4;
|
||||
}
|
||||
@@ -145,7 +148,7 @@ public class RenderMEChest extends BaseBlockRender
|
||||
IIcon ico = ch == null ? null : ch.getTopTexture_Light();
|
||||
this.renderFace( x, y, z, imb, ico == null ? ExtraBlockTextures.MEChest.getIcon() : ico, renderer, up );
|
||||
|
||||
if ( ico != null )
|
||||
if( ico != null )
|
||||
{
|
||||
Tessellator.instance.setColorOpaque_I( sp.getColor().mediumVariant );
|
||||
ico = ch == null ? null : ch.getTopTexture_Medium();
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -26,23 +27,24 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
|
||||
|
||||
public class RenderNull extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderNull() {
|
||||
public RenderNull()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
|
||||
@@ -41,61 +42,12 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
|
||||
|
||||
public class RenderQNB extends BaseBlockRender
|
||||
{
|
||||
|
||||
public void renderCableAt(double thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, IIcon texture, double pull,
|
||||
Collection<ForgeDirection> connections)
|
||||
{
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||
|
||||
if ( connections.contains( ForgeDirection.UNKNOWN ) )
|
||||
{
|
||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.5D - thickness, 0.5D + thickness, 0.5D + thickness, 0.5D + thickness );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
|
||||
if ( connections.contains( ForgeDirection.WEST ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( connections.contains( ForgeDirection.EAST ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( connections.contains( ForgeDirection.NORTH ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( connections.contains( ForgeDirection.SOUTH ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( connections.contains( ForgeDirection.DOWN ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( connections.contains( ForgeDirection.UP ) )
|
||||
{
|
||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D + thickness + pull, 0.5D - thickness, 0.5D + thickness, 1.0D, 0.5D + thickness );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack item, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
float minPx = 2.0f / 16.0f;
|
||||
float maxPx = 14.0f / 16.0f;
|
||||
@@ -105,10 +57,10 @@ public class RenderQNB extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileQuantumBridge tqb = block.getTileEntity( world, x, y, z );
|
||||
if ( tqb == null )
|
||||
if( tqb == null )
|
||||
return false;
|
||||
|
||||
renderer.renderAllFaces = true;
|
||||
@@ -117,11 +69,11 @@ public class RenderQNB extends BaseBlockRender
|
||||
final IBlocks blocks = definitions.blocks();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
for ( Block linkBlock : blocks.quantumLink().maybeBlock().asSet() )
|
||||
for( Block linkBlock : blocks.quantumLink().maybeBlock().asSet() )
|
||||
{
|
||||
if ( tqb.getBlockType() == linkBlock )
|
||||
if( tqb.getBlockType() == linkBlock )
|
||||
{
|
||||
if ( tqb.isFormed() )
|
||||
if( tqb.isFormed() )
|
||||
{
|
||||
EnumSet<ForgeDirection> sides = tqb.getConnections();
|
||||
|
||||
@@ -139,18 +91,17 @@ public class RenderQNB extends BaseBlockRender
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !tqb.isFormed() )
|
||||
if( !tqb.isFormed() )
|
||||
{
|
||||
float renderMin = 2.0f / 16.0f;
|
||||
float renderMax = 14.0f / 16.0f;
|
||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
else if ( tqb.isCorner() )
|
||||
else if( tqb.isCorner() )
|
||||
{
|
||||
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;
|
||||
float renderMax = 12.0f / 16.0f;
|
||||
@@ -158,7 +109,7 @@ public class RenderQNB extends BaseBlockRender
|
||||
renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
|
||||
if ( tqb.isPowered() )
|
||||
if( tqb.isPowered() )
|
||||
{
|
||||
|
||||
renderMin = 3.9f / 16.0f;
|
||||
@@ -168,9 +119,8 @@ public class RenderQNB extends BaseBlockRender
|
||||
int bn = 15;
|
||||
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
||||
Tessellator.instance.setBrightness( bn << 20 | bn << 4 );
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
|
||||
this.renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingCornerLight.getIcon(), renderer, side );
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -186,7 +136,7 @@ public class RenderQNB extends BaseBlockRender
|
||||
renderer.setRenderBounds( renderMin, renderMin, 0, renderMax, renderMax, 1 );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
|
||||
if ( tqb.isPowered() )
|
||||
if( tqb.isPowered() )
|
||||
{
|
||||
renderMin = -0.01f / 16.0f;
|
||||
renderMax = 16.01f / 16.0f;
|
||||
@@ -195,7 +145,7 @@ public class RenderQNB extends BaseBlockRender
|
||||
int bn = 15;
|
||||
Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
||||
Tessellator.instance.setBrightness( bn << 20 | bn << 4 );
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
|
||||
this.renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingEdgeLight.getIcon(), renderer, side );
|
||||
}
|
||||
}
|
||||
@@ -205,4 +155,53 @@ public class RenderQNB extends BaseBlockRender
|
||||
renderer.renderAllFaces = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void renderCableAt( double thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, IIcon texture, double pull, Collection<ForgeDirection> connections )
|
||||
{
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||
|
||||
if( connections.contains( ForgeDirection.UNKNOWN ) )
|
||||
{
|
||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D - thickness, 0.5D - thickness, 0.5D + thickness, 0.5D + thickness, 0.5D + thickness );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
|
||||
if( connections.contains( ForgeDirection.WEST ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if( connections.contains( ForgeDirection.EAST ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if( connections.contains( ForgeDirection.NORTH ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if( connections.contains( ForgeDirection.SOUTH ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if( connections.contains( ForgeDirection.DOWN ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
if( connections.contains( ForgeDirection.UP ) )
|
||||
{
|
||||
renderer.setRenderBounds( 0.5D - thickness, 0.5D + thickness + pull, 0.5D - thickness, 0.5D + thickness, 1.0D, 0.5D + thickness );
|
||||
renderer.renderStandardBlock( block, x, y, z );
|
||||
}
|
||||
|
||||
block.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -32,117 +33,27 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.client.texture.OffsetIcon;
|
||||
|
||||
|
||||
public class RenderQuartzGlass extends BaseBlockRender
|
||||
{
|
||||
|
||||
static byte[][][] offsets;
|
||||
|
||||
public RenderQuartzGlass() {
|
||||
public RenderQuartzGlass()
|
||||
{
|
||||
super( false, 0 );
|
||||
if ( offsets == null )
|
||||
if( offsets == null )
|
||||
{
|
||||
Random r = new Random( 924 );
|
||||
offsets = new byte[10][10][10];
|
||||
for (int x = 0; x < 10; x++)
|
||||
for (int y = 0; y < 10; y++)
|
||||
for( int x = 0; x < 10; x++ )
|
||||
for( int y = 0; y < 10; y++ )
|
||||
r.nextBytes( offsets[x][y] );
|
||||
}
|
||||
}
|
||||
|
||||
boolean isFlush(AEBaseBlock imb, IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return this.isGlass( imb, world, x, y, z );
|
||||
}
|
||||
|
||||
boolean isGlass(AEBaseBlock imb, IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return this.isQuartzGlass( world, x, y, z ) || this.isVibrantQuartzGlass( world, x, y, z );
|
||||
}
|
||||
|
||||
private boolean isQuartzGlass( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().quartzGlass().isSameAs( world, x, y, z );
|
||||
}
|
||||
|
||||
private boolean isVibrantQuartzGlass( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().quartzVibrantGlass().isSameAs( world, x, y, z );
|
||||
}
|
||||
|
||||
void renderEdge(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer, ForgeDirection side, ForgeDirection direction)
|
||||
{
|
||||
if ( !this.isFlush( imb, world, x + side.offsetX, y + side.offsetY, z + side.offsetZ ) )
|
||||
{
|
||||
if ( !this.isFlush( imb, world, x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ ) )
|
||||
{
|
||||
float minX = 0.5f + (side.offsetX + direction.offsetX) / 2.0f;
|
||||
float minY = 0.5f + (side.offsetY + direction.offsetY) / 2.0f;
|
||||
float minZ = 0.5f + (side.offsetZ + direction.offsetZ) / 2.0f;
|
||||
float maxX = 0.5f + (side.offsetX + direction.offsetX) / 2.0f;
|
||||
float maxY = 0.5f + (side.offsetY + direction.offsetY) / 2.0f;
|
||||
float maxZ = 0.5f + (side.offsetZ + direction.offsetZ) / 2.0f;
|
||||
|
||||
if ( 0 == side.offsetX && 0 == direction.offsetX )
|
||||
{
|
||||
minX = 0.0f;
|
||||
maxX = 1.0f;
|
||||
}
|
||||
if ( 0 == side.offsetY && 0 == direction.offsetY )
|
||||
{
|
||||
minY = 0.0f;
|
||||
maxY = 1.0f;
|
||||
}
|
||||
if ( 0 == side.offsetZ && 0 == direction.offsetZ )
|
||||
{
|
||||
minZ = 0.0f;
|
||||
maxZ = 1.0f;
|
||||
}
|
||||
|
||||
if ( maxX <= 0.001f )
|
||||
maxX += 0.9f / 16.0f;
|
||||
if ( maxY <= 0.001f )
|
||||
maxY += 0.9f / 16.0f;
|
||||
if ( maxZ <= 0.001f )
|
||||
maxZ += 0.9f / 16.0f;
|
||||
|
||||
if ( minX >= 0.999f )
|
||||
minX -= 0.9f / 16.0f;
|
||||
if ( minY >= 0.999f )
|
||||
minY -= 0.9f / 16.0f;
|
||||
if ( minZ >= 0.999f )
|
||||
minZ -= 0.9f / 16.0f;
|
||||
|
||||
renderer.setRenderBounds( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
|
||||
switch (side)
|
||||
{
|
||||
case WEST:
|
||||
renderer.renderFaceXNeg( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case EAST:
|
||||
renderer.renderFaceXPos( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.renderFaceZNeg( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.renderFaceZPos( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case DOWN:
|
||||
renderer.renderFaceYNeg( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case UP:
|
||||
renderer.renderFaceYPos( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
renderer.overrideBlockTexture = ExtraBlockTextures.GlassFrame.getIcon();
|
||||
super.renderInventory( block, is, renderer, type, obj );
|
||||
@@ -151,7 +62,7 @@ public class RenderQuartzGlass extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
|
||||
@@ -162,20 +73,20 @@ public class RenderQuartzGlass extends BaseBlockRender
|
||||
int u = offsets[cx][cy][cz] % 4;
|
||||
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:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( imb.getIcon( 0, 0 ), u / 2, v / 2 );
|
||||
break;
|
||||
case 1:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( ExtraBlockTextures.BlockQuartzGlassB.getIcon(), u / 2, v / 2 );
|
||||
break;
|
||||
case 2:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( ExtraBlockTextures.BlockQuartzGlassC.getIcon(), u, v );
|
||||
break;
|
||||
case 3:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( ExtraBlockTextures.BlockQuartzGlassD.getIcon(), u, v );
|
||||
break;
|
||||
case 0:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( imb.getIcon( 0, 0 ), u / 2, v / 2 );
|
||||
break;
|
||||
case 1:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( ExtraBlockTextures.BlockQuartzGlassB.getIcon(), u / 2, v / 2 );
|
||||
break;
|
||||
case 2:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( ExtraBlockTextures.BlockQuartzGlassC.getIcon(), u, v );
|
||||
break;
|
||||
case 3:
|
||||
renderer.overrideBlockTexture = new OffsetIcon( ExtraBlockTextures.BlockQuartzGlassD.getIcon(), u, v );
|
||||
break;
|
||||
}
|
||||
|
||||
boolean result = renderer.renderStandardBlock( imb, x, y, z );
|
||||
@@ -214,4 +125,95 @@ public class RenderQuartzGlass extends BaseBlockRender
|
||||
return result;
|
||||
}
|
||||
|
||||
void renderEdge( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer, ForgeDirection side, ForgeDirection direction )
|
||||
{
|
||||
if( !this.isFlush( imb, world, x + side.offsetX, y + side.offsetY, z + side.offsetZ ) )
|
||||
{
|
||||
if( !this.isFlush( imb, world, x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ ) )
|
||||
{
|
||||
float minX = 0.5f + ( side.offsetX + direction.offsetX ) / 2.0f;
|
||||
float minY = 0.5f + ( side.offsetY + direction.offsetY ) / 2.0f;
|
||||
float minZ = 0.5f + ( side.offsetZ + direction.offsetZ ) / 2.0f;
|
||||
float maxX = 0.5f + ( side.offsetX + direction.offsetX ) / 2.0f;
|
||||
float maxY = 0.5f + ( side.offsetY + direction.offsetY ) / 2.0f;
|
||||
float maxZ = 0.5f + ( side.offsetZ + direction.offsetZ ) / 2.0f;
|
||||
|
||||
if( 0 == side.offsetX && 0 == direction.offsetX )
|
||||
{
|
||||
minX = 0.0f;
|
||||
maxX = 1.0f;
|
||||
}
|
||||
if( 0 == side.offsetY && 0 == direction.offsetY )
|
||||
{
|
||||
minY = 0.0f;
|
||||
maxY = 1.0f;
|
||||
}
|
||||
if( 0 == side.offsetZ && 0 == direction.offsetZ )
|
||||
{
|
||||
minZ = 0.0f;
|
||||
maxZ = 1.0f;
|
||||
}
|
||||
|
||||
if( maxX <= 0.001f )
|
||||
maxX += 0.9f / 16.0f;
|
||||
if( maxY <= 0.001f )
|
||||
maxY += 0.9f / 16.0f;
|
||||
if( maxZ <= 0.001f )
|
||||
maxZ += 0.9f / 16.0f;
|
||||
|
||||
if( minX >= 0.999f )
|
||||
minX -= 0.9f / 16.0f;
|
||||
if( minY >= 0.999f )
|
||||
minY -= 0.9f / 16.0f;
|
||||
if( minZ >= 0.999f )
|
||||
minZ -= 0.9f / 16.0f;
|
||||
|
||||
renderer.setRenderBounds( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
|
||||
switch( side )
|
||||
{
|
||||
case WEST:
|
||||
renderer.renderFaceXNeg( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case EAST:
|
||||
renderer.renderFaceXPos( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.renderFaceZNeg( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.renderFaceZPos( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case DOWN:
|
||||
renderer.renderFaceYNeg( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
case UP:
|
||||
renderer.renderFaceYPos( imb, x, y, z, ExtraBlockTextures.GlassFrame.getIcon() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean isFlush( AEBaseBlock imb, IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return this.isGlass( imb, world, x, y, z );
|
||||
}
|
||||
|
||||
boolean isGlass( AEBaseBlock imb, IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return this.isQuartzGlass( world, x, y, z ) || this.isVibrantQuartzGlass( world, x, y, z );
|
||||
}
|
||||
|
||||
private boolean isQuartzGlass( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().quartzGlass().isSameAs( world, x, y, z );
|
||||
}
|
||||
|
||||
private boolean isVibrantQuartzGlass( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return AEApi.instance().definitions().blocks().quartzVibrantGlass().isSameAs( world, x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -28,15 +29,17 @@ import appeng.block.solids.OreQuartz;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
|
||||
|
||||
public class RenderQuartzOre extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderQuartzOre() {
|
||||
public RenderQuartzOre()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
super.renderInventory( blk, is, renderer, type, obj );
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( ExtraBlockTextures.OreQuartzStone.getIcon() );
|
||||
@@ -45,7 +48,7 @@ public class RenderQuartzOre extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
OreQuartz blk = (OreQuartz) block;
|
||||
blk.setEnhanceBrightness( true );
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -34,15 +35,17 @@ import appeng.block.AEBaseBlock;
|
||||
import appeng.block.misc.BlockQuartzTorch;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
|
||||
|
||||
public class RenderQuartzTorch extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderQuartzTorch() {
|
||||
public RenderQuartzTorch()
|
||||
{
|
||||
super( false, 20 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
@@ -90,15 +93,14 @@ public class RenderQuartzTorch extends BaseBlockRender
|
||||
|
||||
renderer.renderAllFaces = false;
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( null );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
BlockQuartzTorch blk = (BlockQuartzTorch) block;
|
||||
|
||||
IOrientable te = ((IOrientableBlock) block).getOrientable( world, x, y, z );
|
||||
IOrientable te = ( (IOrientableBlock) block ).getOrientable( world, x, y, z );
|
||||
|
||||
float Point2 = 6.0f / 16.0f;
|
||||
float Point3 = 7.0f / 16.0f;
|
||||
@@ -117,19 +119,19 @@ public class RenderQuartzTorch extends BaseBlockRender
|
||||
float zOff = 0.0f;
|
||||
|
||||
renderer.renderAllFaces = true;
|
||||
if ( te != null )
|
||||
if( te != null )
|
||||
{
|
||||
ForgeDirection forward = te.getUp();
|
||||
xOff = forward.offsetX * -(4.0f / 16.0f);
|
||||
yOff = forward.offsetY * -(4.0f / 16.0f);
|
||||
zOff = forward.offsetZ * -(4.0f / 16.0f);
|
||||
xOff = forward.offsetX * -( 4.0f / 16.0f );
|
||||
yOff = forward.offsetY * -( 4.0f / 16.0f );
|
||||
zOff = forward.offsetZ * -( 4.0f / 16.0f );
|
||||
}
|
||||
|
||||
renderer.setRenderBounds( Point3 + xOff, renderBottom + yOff, Point3 + zOff, Point12 + xOff, renderTop + yOff, Point12 + zOff );
|
||||
super.renderInWorld( block, world, x, y, z, renderer );
|
||||
|
||||
int r = (x + y + z) % 2;
|
||||
if ( r == 0 )
|
||||
int r = ( x + y + z ) % 2;
|
||||
if( r == 0 )
|
||||
{
|
||||
renderer.setRenderBounds( Point3 + xOff, renderTop + yOff, Point3 + zOff, Point3 + singlePixel + xOff, renderTop + singlePixel + yOff, Point3 + singlePixel + zOff );
|
||||
super.renderInWorld( block, world, x, y, z, renderer );
|
||||
@@ -160,48 +162,48 @@ public class RenderQuartzTorch extends BaseBlockRender
|
||||
renderer.setRenderBounds( Point12 + xOff, bottom + yOff, Point3 + zOff, Point13 + xOff, top + yOff, Point12 + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
|
||||
if ( te != null )
|
||||
if( te != null )
|
||||
{
|
||||
ForgeDirection forward = te.getUp();
|
||||
switch (forward)
|
||||
switch( forward )
|
||||
{
|
||||
case EAST:
|
||||
renderer.setRenderBounds( 0, bottom + yOff, bottom + zOff, Point2 + xOff, top + yOff, top + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case WEST:
|
||||
renderer.setRenderBounds( Point13 + xOff, bottom + yOff, bottom + zOff, 1.0, top + yOff, top + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.setRenderBounds( bottom + xOff, bottom + yOff, Point13 + zOff, top + xOff, top + yOff, 1.0 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.setRenderBounds( bottom + xOff, bottom + yOff, 0, top + xOff, top + yOff, Point2 + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case UP:
|
||||
renderer.setRenderBounds( Point2, 0, Point2, Point3, bottom + yOff, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point2, 0, Point12, Point3, bottom + yOff, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, 0, Point2, Point13, bottom + yOff, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, 0, Point12, Point13, bottom + yOff, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case DOWN:
|
||||
renderer.setRenderBounds( Point2, top + yOff, Point2, Point3, 1.0, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point2, top + yOff, Point12, Point3, 1.0, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, top + yOff, Point2, Point13, 1.0, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, top + yOff, Point12, Point13, 1.0, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
default:
|
||||
case EAST:
|
||||
renderer.setRenderBounds( 0, bottom + yOff, bottom + zOff, Point2 + xOff, top + yOff, top + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case WEST:
|
||||
renderer.setRenderBounds( Point13 + xOff, bottom + yOff, bottom + zOff, 1.0, top + yOff, top + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.setRenderBounds( bottom + xOff, bottom + yOff, Point13 + zOff, top + xOff, top + yOff, 1.0 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.setRenderBounds( bottom + xOff, bottom + yOff, 0, top + xOff, top + yOff, Point2 + zOff );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case UP:
|
||||
renderer.setRenderBounds( Point2, 0, Point2, Point3, bottom + yOff, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point2, 0, Point12, Point3, bottom + yOff, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, 0, Point2, Point13, bottom + yOff, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, 0, Point12, Point13, bottom + yOff, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
case DOWN:
|
||||
renderer.setRenderBounds( Point2, top + yOff, Point2, Point3, 1.0, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point2, top + yOff, Point12, Point3, 1.0, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, top + yOff, Point2, Point13, 1.0, Point3 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
renderer.setRenderBounds( Point12, top + yOff, Point12, Point13, 1.0, Point13 );
|
||||
renderer.renderStandardBlock( blk, x, y, z );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -26,22 +27,24 @@ import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
|
||||
|
||||
public class RenderTinyTNT extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RenderTinyTNT() {
|
||||
public RenderTinyTNT()
|
||||
{
|
||||
super( false, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
||||
super.renderInventory( block, is, renderer, type, obj );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
renderer.renderAllFaces = true;
|
||||
renderer.setRenderBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
|
||||
@@ -49,5 +52,4 @@ public class RenderTinyTNT extends BaseBlockRender
|
||||
renderer.renderAllFaces = false;
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -31,30 +32,32 @@ import appeng.client.render.BusRenderer;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
|
||||
|
||||
public class RendererCableBus extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RendererCableBus() {
|
||||
public RendererCableBus()
|
||||
{
|
||||
super( true, 30 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock blk, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
// nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
AEBaseTile t = block.getTileEntity( world, x, y, z );
|
||||
|
||||
if ( t instanceof TileCableBus )
|
||||
if( t instanceof TileCableBus )
|
||||
{
|
||||
BusRenderer.INSTANCE.renderer.renderAllFaces = true;
|
||||
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
|
||||
BusRenderer.INSTANCE.renderer.overrideBlockTexture = renderer.overrideBlockTexture;
|
||||
((TileCableBus) t).cb.renderStatic( x, y, z );
|
||||
( (TileCableBus) t ).cb.renderStatic( x, y, z );
|
||||
BusRenderer.INSTANCE.renderer.renderAllFaces = false;
|
||||
}
|
||||
|
||||
@@ -62,13 +65,12 @@ public class RendererCableBus extends BaseBlockRender
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTile(AEBaseBlock block, AEBaseTile t, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer)
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile t, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
|
||||
{
|
||||
if ( t instanceof TileCableBus )
|
||||
if( t instanceof TileCableBus )
|
||||
{
|
||||
BusRenderer.INSTANCE.renderer.overrideBlockTexture = null;
|
||||
((TileCableBus) t).cb.renderDynamic( x, y, z );
|
||||
( (TileCableBus) t ).cb.renderDynamic( x, y, z );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.render.blocks;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -34,29 +35,30 @@ import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.misc.TileSecurity;
|
||||
|
||||
|
||||
public class RendererSecurity extends BaseBlockRender
|
||||
{
|
||||
|
||||
public RendererSecurity() {
|
||||
public RendererSecurity()
|
||||
{
|
||||
super( false, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventory(AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj)
|
||||
public void renderInventory( AEBaseBlock block, ItemStack is, RenderBlocks renderer, ItemRenderType type, Object[] obj )
|
||||
{
|
||||
renderer.overrideBlockTexture = ExtraBlockTextures.getMissing();
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.SOUTH ), block, is, Tessellator.instance, 0x000000, renderer );
|
||||
|
||||
renderer.overrideBlockTexture = ExtraBlockTextures.MEChest.getIcon();
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, this.adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ),
|
||||
renderer );
|
||||
this.renderInvBlock( EnumSet.of( ForgeDirection.UP ), block, is, Tessellator.instance, this.adjustBrightness( AEColor.Transparent.whiteVariant, 0.7 ), renderer );
|
||||
|
||||
renderer.overrideBlockTexture = null;
|
||||
super.renderInventory( block, is, renderer, type, obj );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderInWorld(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
public boolean renderInWorld( AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer )
|
||||
{
|
||||
TileSecurity sp = imb.getTileEntity( world, x, y, z );
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
@@ -68,7 +70,7 @@ public class RendererSecurity extends BaseBlockRender
|
||||
boolean result = renderer.renderStandardBlock( imb, x, y, z );
|
||||
|
||||
int b = world.getLightBrightnessForSkyBlocks( x + up.offsetX, y + up.offsetY, z + up.offsetZ, 0 );
|
||||
if ( sp.isActive() )
|
||||
if( sp.isActive() )
|
||||
{
|
||||
b = 15 << 20 | 15 << 4;
|
||||
}
|
||||
@@ -80,7 +82,7 @@ public class RendererSecurity extends BaseBlockRender
|
||||
Tessellator.instance.setColorOpaque_I( sp.getColor().whiteVariant );
|
||||
IIcon ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Light.getIcon() : ExtraBlockTextures.MEChest.getIcon();
|
||||
this.renderFace( x, y, z, imb, ico, renderer, up );
|
||||
if ( sp.isActive() )
|
||||
if( sp.isActive() )
|
||||
{
|
||||
Tessellator.instance.setColorOpaque_I( sp.getColor().mediumVariant );
|
||||
ico = sp.isActive() ? ExtraBlockTextures.BlockMESecurityOn_Medium.getIcon() : ExtraBlockTextures.MEChest.getIcon();
|
||||
|
||||
Reference in New Issue
Block a user