Puts everywhere brackets

This commit is contained in:
thatsIch
2015-04-29 02:30:53 +02:00
parent 23aa8fd72d
commit 64ed05a1b4
465 changed files with 6726 additions and 14 deletions
@@ -117,13 +117,21 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
super( mat );
if( mat == AEGlassMaterial.INSTANCE || mat == Material.glass )
{
this.setStepSound( Block.soundTypeGlass );
}
else if( mat == Material.rock )
{
this.setStepSound( Block.soundTypeStone );
}
else if( mat == Material.wood )
{
this.setStepSound( Block.soundTypeWood );
}
else
{
this.setStepSound( Block.soundTypeMetal );
}
this.featureFullName = new FeatureNameExtractor( c, subName ).get();
this.featureSubName = subName;
@@ -152,7 +160,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public BlockRenderInfo getRendererInstance()
{
if( this.renderInfo != null )
{
return this.renderInfo;
}
try
{
@@ -243,7 +253,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public IIcon getIcon( int direction, int metadata )
{
if( this.renderIcon != null )
{
return this.renderIcon;
}
return this.getRendererInstance().getTexture( ForgeDirection.getOrientation( direction ) );
}
@@ -256,12 +268,16 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
ICustomCollision collisionHandler = null;
if( this instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) this;
}
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) te;
}
}
if( collisionHandler != null && bb != null )
@@ -277,11 +293,15 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
b.maxY += y;
b.maxZ += z;
if( bb.intersectsWith( b ) )
{
out.add( b );
}
}
}
else
{
super.addCollisionBoxesToList( w, x, y, z, bb, out, e );
}
}
@Override
@@ -292,12 +312,16 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
AxisAlignedBB b = null;
if( this instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) this;
}
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) te;
}
}
if( collisionHandler != null )
@@ -345,7 +369,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
for( AxisAlignedBB bx : collisionHandler.getSelectedBoundingBoxesFromPool( w, x, y, z, null, false ) )
{
if( b == null )
{
b = bx;
}
else
{
double minX = Math.min( b.minX, bx.minX );
@@ -361,7 +387,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
b.setBounds( b.minX + x, b.minY + y, b.minZ + z, b.maxX + x, b.maxY + y, b.maxZ + z );
}
else
{
b = super.getSelectedBoundingBoxFromPool( w, x, y, z );
}
return b;
}
@@ -378,12 +406,16 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
ICustomCollision collisionHandler = null;
if( this instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) this;
}
else
{
AEBaseTile te = this.getTileEntity( w, x, y, z );
if( te instanceof ICustomCollision )
{
collisionHandler = (ICustomCollision) te;
}
}
if( collisionHandler != null )
@@ -444,10 +476,14 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
ItemStack[] drops = Platform.getBlockDrops( w, x, y, z );
if( tile == null )
{
return false;
}
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
{
return false;
}
ItemStack op = new ItemStack( this );
for( ItemStack ol : drops )
@@ -456,7 +492,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
if( tag != null )
{
ol.setTagCompound( tag );
}
}
}
@@ -499,7 +537,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
}
else
{
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
}
return false;
}
}
@@ -521,7 +561,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof AEBaseTile )
{
( (AEBaseTile) w.getTileEntity( x, y, z ) ).setName( is.getDisplayName() );
}
}
}
@@ -544,7 +586,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
TileEntity te = this.getTileEntity( w, x, y, z );
if( te instanceof IInventory )
{
return Container.calcRedstoneFromInventory( (IInventory) te );
}
return 0;
}
@@ -678,7 +722,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
// if the input is an flippable IIcon find the original.
while( substitute instanceof FlippableIcon )
{
substitute = ( (FlippableIcon) substitute ).getOriginal();
}
if( substitute != null )
{
@@ -689,7 +735,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
IResource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if( res != null )
{
return new FlippableIcon( ir.registerIcon( Name ) );
}
}
catch( Throwable e )
{
@@ -731,11 +779,15 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
public <T extends TileEntity> T getTileEntity( IBlockAccess w, int x, int y, int z )
{
if( !this.hasBlockTileEntity() )
{
return null;
}
TileEntity te = w.getTileEntity( x, y, z );
if( this.tileEntityType.isInstance( te ) )
{
return (T) te;
}
return null;
}
@@ -754,30 +806,48 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
ForgeDirection west = ForgeDirection.UNKNOWN;
if( forward == null || up == null )
{
return dir;
}
int west_x = forward.offsetY * up.offsetZ - forward.offsetZ * up.offsetY;
int west_y = forward.offsetZ * up.offsetX - forward.offsetX * up.offsetZ;
int west_z = forward.offsetX * up.offsetY - forward.offsetY * up.offsetX;
for( ForgeDirection dx : ForgeDirection.VALID_DIRECTIONS )
{
if( dx.offsetX == west_x && dx.offsetY == west_y && dx.offsetZ == west_z )
{
west = dx;
}
}
if( dir == forward )
{
return ForgeDirection.SOUTH;
}
if( dir == forward.getOpposite() )
{
return ForgeDirection.NORTH;
}
if( dir == up )
{
return ForgeDirection.UP;
}
if( dir == up.getOpposite() )
{
return ForgeDirection.DOWN;
}
if( dir == west )
{
return ForgeDirection.WEST;
}
if( dir == west.getOpposite() )
{
return ForgeDirection.EAST;
}
return ForgeDirection.UNKNOWN;
}
@@ -823,9 +893,13 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
{
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
if( te.dropItems() )
{
te.getDrops( w, x, y, z, drops );
}
else
{
te.getNoDrops( w, x, y, z, drops );
}
// Cry ;_; ...
Platform.spawnDrops( w, x, y, z, drops );
@@ -833,7 +907,9 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
super.breakBlock( w, x, y, z, a, b );
if( te != null )
{
w.setTileEntity( x, y, z, null );
}
}
public String getUnlocalizedName( ItemStack is )
@@ -56,14 +56,18 @@ public class AEBaseItemBlock extends ItemBlock
this.hasSubtypes = this.blockType.hasSubtypes;
if( Platform.isClient() )
{
MinecraftForgeClient.registerItemRenderer( this, ItemRenderer.INSTANCE );
}
}
@Override
public int getMetadata( int dmg )
{
if( this.hasSubtypes )
{
return dmg;
}
return 0;
}
@@ -107,17 +111,25 @@ public class AEBaseItemBlock extends ItemBlock
{
up = ForgeDirection.getOrientation( side );
if( up == ForgeDirection.UP || up == ForgeDirection.DOWN )
{
forward = ForgeDirection.SOUTH;
}
else
{
forward = ForgeDirection.UP;
}
}
else if( this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass )
{
forward = ForgeDirection.getOrientation( side );
if( forward == ForgeDirection.UP || forward == ForgeDirection.DOWN )
{
up = ForgeDirection.SOUTH;
}
else
{
up = ForgeDirection.UP;
}
}
else
{
@@ -161,11 +173,15 @@ public class AEBaseItemBlock extends ItemBlock
up = ForgeDirection.getOrientation( side );
forward = ForgeDirection.SOUTH;
if( up.offsetY == 0 )
{
forward = ForgeDirection.UP;
}
}
if( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) )
{
return false;
}
if( super.placeBlockAt( stack, player, w, x, y, z, side, hitX, hitY, hitZ, metadata ) )
{
@@ -175,13 +191,17 @@ public class AEBaseItemBlock extends ItemBlock
ori = tile;
if( tile == null )
{
return true;
}
if( ori.canBeRotated() && !this.blockType.hasCustomRotation() )
{
if( ori.getForward() == null || ori.getUp() == null || // null
tile.getForward() == ForgeDirection.UNKNOWN || ori.getUp() == ForgeDirection.UNKNOWN )
{
ori.setOrientation( forward, up );
}
}
if( tile instanceof IGridProxyable )
@@ -89,13 +89,19 @@ public class BlockCraftingStorage extends BlockCraftingUnit
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return "tile.appliedenergistics2.BlockCraftingStorage4k";
}
if( is.getItemDamage() == 2 )
{
return "tile.appliedenergistics2.BlockCraftingStorage16k";
}
if( is.getItemDamage() == 3 )
{
return "tile.appliedenergistics2.BlockCraftingStorage64k";
}
return this.getItemUnlocalizedName( is );
}
@@ -94,7 +94,9 @@ public class BlockCraftingUnit extends AEBaseBlock
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
{
return true;
}
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CRAFTING_CPU );
return true;
@@ -124,7 +126,9 @@ public class BlockCraftingUnit extends AEBaseBlock
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@@ -133,7 +137,9 @@ public class BlockCraftingUnit extends AEBaseBlock
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return "tile.appliedenergistics2.BlockCraftingAccelerator";
}
return this.getItemUnlocalizedName( is );
}
@@ -148,7 +154,9 @@ public class BlockCraftingUnit extends AEBaseBlock
{
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
if( cp != null )
{
cp.updateMultiBlock();
}
}
@Override
@@ -117,10 +117,12 @@ public class BlockCrank extends AEBaseBlock
private ForgeDirection findCrankable( World world, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.isCrankable( world, x, y, z, dir ) )
{
return dir;
}
}
return ForgeDirection.UNKNOWN;
}
@@ -47,13 +47,17 @@ public class BlockCellWorkbench extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileCellWorkbench tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CELL_WORKBENCH );
}
return true;
}
return false;
@@ -71,7 +71,9 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
return false;
}
if( Platform.isServer() )
{
@@ -90,10 +92,14 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
if( r.nextFloat() < 0.98 )
{
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileCharger )
@@ -47,7 +47,9 @@ public class BlockCondenser extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
return false;
}
if( Platform.isServer() )
{
@@ -57,13 +57,17 @@ public class BlockInscriber extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInscriber tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INSCRIBER );
}
return true;
}
return false;
@@ -56,13 +56,17 @@ public class BlockInterface extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileInterface tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_INTERFACE );
}
return true;
}
return false;
@@ -46,7 +46,9 @@ public class BlockLightDetector extends BlockQuartzTorch
public int isProvidingWeakPower( IBlockAccess w, int x, int y, int z, int side )
{
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, x, y, z ) ).isReady() )
{
return ( (World) w ).getBlockLightValue( x, y, z ) - 6;
}
return 0;
}
@@ -58,7 +60,9 @@ public class BlockLightDetector extends BlockQuartzTorch
TileLightDetector tld = this.getTileEntity( world, x, y, z );
if( tld != null )
{
tld.updateLight();
}
}
@Override
@@ -88,7 +88,9 @@ public class BlockPaint extends AEBaseBlock
TilePaint tp = this.getTileEntity( w, x, y, z );
if( tp != null )
{
tp.onNeighborBlockChange();
}
}
@Override
@@ -107,7 +109,9 @@ public class BlockPaint extends AEBaseBlock
public void fillWithRain( World w, int x, int y, int z )
{
if( Platform.isServer() )
{
w.setBlock( x, y, z, Platform.AIR, 0, 3 );
}
}
@Override
@@ -68,7 +68,9 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
TileQuartzGrowthAccelerator tileQuartzGrowthAccelerator = this.getTileEntity( w, x, y, z );
@@ -98,25 +100,33 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
dx = 0.6;
dz = d1;
if( !w.getBlock( x + west.offsetX, y + west.offsetY, z + west.offsetZ ).isAir( w, x + west.offsetX, y + west.offsetY, z + west.offsetZ ) )
{
return;
}
break;
case 1:
dx = d1;
dz += 0.6;
if( !w.getBlock( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ ).isAir( w, x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ ) )
{
return;
}
break;
case 2:
dx = d1;
dz = -0.6;
if( !w.getBlock( x - forward.offsetX, y - forward.offsetY, z - forward.offsetZ ).isAir( w, x - forward.offsetX, y - forward.offsetY, z - forward.offsetZ ) )
{
return;
}
break;
case 3:
dx = -0.6;
dz = d1;
if( !w.getBlock( x - west.offsetX, y - west.offsetY, z - west.offsetZ ).isAir( w, x - west.offsetX, y - west.offsetY, z - west.offsetZ ) )
{
return;
}
break;
}
@@ -107,10 +107,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
if( r.nextFloat() < 0.98 )
{
return;
}
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
double xOff = -0.3 * up.offsetX;
@@ -132,7 +136,9 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
{
ForgeDirection up = this.getOrientable( w, x, y, z ).getUp();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
@@ -146,8 +152,12 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
return true;
}
}
return false;
}
@@ -55,13 +55,17 @@ public class BlockSecurity extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSecurity tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isClient() )
{
return true;
}
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SECURITY );
return true;
@@ -80,7 +80,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
{
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
if( sc != null )
{
return false;
}
return this.canPlaceAt( w, x, y, z, forward.getOpposite() );
}
@@ -95,7 +97,9 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
TileSkyCompass sc = this.getTileEntity( w, x, y, z );
ForgeDirection up = sc.getForward();
if( !this.canPlaceAt( w, x, y, z, up.getOpposite() ) )
{
this.dropTorch( w, x, y, z );
}
}
private void dropTorch( World w, int x, int y, int z )
@@ -109,8 +113,12 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
public boolean canPlaceBlockAt( World w, int x, int y, int z )
{
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
{
if( this.canPlaceAt( w, x, y, z, dir ) )
{
return true;
}
}
return false;
}
@@ -68,7 +68,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( player.isSneaking() )
{
return false;
}
if( Platform.isServer() )
{
@@ -87,7 +89,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
AEBaseTile tile = this.getTileEntity( w, x, y, z );
if( tile instanceof TileVibrationChamber )
@@ -119,7 +119,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public int getRenderBlockPass()
{
if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
{
return 1;
}
return 0;
}
@@ -162,7 +164,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
return block.getLightValue( world, x, y, z );
}
if( block == null )
{
return 0;
}
return this.cb( world, x, y, z ).getLightValue();
}
@@ -192,7 +196,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{
AEBaseTile tile = this.getTileEntity( world, x, y, z );
if( tile != null )
{
tile.disableDrops();
}
// maybe ray trace?
}
return super.removedByPlayer( world, player, x, y, z );
@@ -224,7 +230,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
BusRenderHelper.INSTANCE.setPass( pass );
if( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
{
return true;
}
return pass == 0;
}
@@ -236,9 +244,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
SelectedPart sp = this.cb( world, x, y, z ).selectPart( v3 );
if( sp.part != null )
{
return sp.part.getItemStack( PartItemStack.Pick );
}
else if( sp.facade != null )
{
return sp.facade.getItemStack();
}
return null;
}
@@ -258,7 +270,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = (byte) ( Platform.getRandomInt() % 2 == 0 ? 1 : 0 );
@@ -304,7 +318,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
IIcon ico = this.getIcon( p );
if( ico == null )
{
continue;
}
byte b0 = 3;
@@ -335,19 +351,25 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public void onNeighborChange( IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ )
{
if( Platform.isServer() )
{
this.cb( w, x, y, z ).onNeighborChanged();
}
}
private IIcon getIcon( IPart p )
{
if( p == null )
{
return null;
}
try
{
IIcon ico = p.getBreakingTexture();
if( ico != null )
{
return ico;
}
}
catch( Throwable t )
{
@@ -356,7 +378,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
ItemStack is = p.getItemStack( PartItemStack.Network );
if( is == null || is.getItem() == null )
{
return null;
}
return is.getItem().getIcon( is, 0 );
}
@@ -367,10 +391,13 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
ICableBusContainer out = null;
if( te instanceof TileCableBus )
{
out = ( (TileCableBus) te ).cb;
}
else if( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
{
out = ( (IFMP) AppEng.instance.getIntegration( IntegrationType.FMP ) ).getCableContainer( te );
}
return out == null ? NULL_CABLE_BUS : out;
}
@@ -392,7 +419,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
{
IIcon i = super.getIcon( direction, metadata );
if( i != null )
{
return i;
}
return ExtraBlockTextures.BlockQuartzGlassB.getIcon();
}
@@ -440,10 +469,14 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
TileEntity te = w.getTileEntity( x, y, z );
if( noTesrTile.isInstance( te ) )
{
return (T) te;
}
if( tesrTile != null && tesrTile.isInstance( te ) )
{
return (T) te;
}
return null;
}
@@ -48,7 +48,9 @@ public class BlockController extends AEBaseBlock
{
TileController tc = this.getTileEntity( w, x, y, z );
if( tc != null )
{
tc.onNeighborChange( false );
}
}
@Override
@@ -63,13 +63,17 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileWireless tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_WIRELESS );
}
return true;
}
return false;
@@ -197,6 +201,8 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
out.add( AxisAlignedBB.getBoundingBox( minX, minY, minZ, maxX, maxY, maxZ ) );
}
else
{
out.add( AxisAlignedBB.getBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
}
}
}
@@ -71,7 +71,9 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
if( bridge.hasQES() )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, bx + 0.5, by + 0.5, bz + 0.5, null );
}
}
}
}
@@ -81,7 +83,9 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
}
}
@Override
@@ -94,13 +98,17 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileQuantumBridge tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_QNB );
}
return true;
}
return false;
@@ -111,7 +119,9 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@@ -56,7 +56,9 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.neighborUpdate();
}
}
@Override
@@ -70,7 +72,9 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
{
TileQuantumBridge bridge = this.getTileEntity( w, x, y, z );
if( bridge != null )
{
bridge.breakCluster();
}
super.breakBlock( w, x, y, z, a, b );
}
@@ -64,7 +64,9 @@ public class BlockQuartzGlass extends AEBaseBlock
if( mat == Material.glass || mat == AEGlassMaterial.INSTANCE )
{
if( w.getBlock( x, y, z ).getRenderType() == this.getRenderType() )
{
return false;
}
}
return super.shouldSideBeRendered( w, x, y, z, side );
}
@@ -50,7 +50,9 @@ public class BlockQuartzLamp extends BlockQuartzGlass
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if( !AEConfig.instance.enableEffects )
{
return;
}
if( CommonHelper.proxy.shouldAddParticles( r ) )
{
@@ -90,10 +90,14 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
int level = -1;
if( is != null )
{
level = is.getItem().getHarvestLevel( is, "pickaxe" );
}
if( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 )
{
Ev.newSpeed /= 0.1;
}
}
}
@@ -117,7 +121,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{
super.onBlockAdded( w, x, y, z );
if( Platform.isServer() )
{
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
}
}
// use AE2's renderer, no rotatable blocks.
@@ -142,12 +148,16 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{
IOrientable out = ( (IRB) AppEng.instance.getIntegration( IntegrationType.RB ) ).getOrientable( te );
if( out != null )
{
return out;
}
}
}
if( w.getBlockMetadata( x, y, z ) == 0 )
{
return new LocationRotation( w, x, y, z );
}
return new NullRotation();
}
@@ -156,13 +166,19 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return this.getUnlocalizedName() + ".Block";
}
if( is.getItemDamage() == 2 )
{
return this.getUnlocalizedName() + ".Brick";
}
if( is.getItemDamage() == 3 )
{
return this.getUnlocalizedName() + ".SmallBrick";
}
return this.getUnlocalizedName();
}
@@ -182,11 +198,17 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public IIcon getIcon( int direction, int metadata )
{
if( metadata == 1 )
{
return this.Block;
}
if( metadata == 2 )
{
return this.Brick;
}
if( metadata == 3 )
{
return this.SmallBrick;
}
return super.getIcon( direction, metadata );
}
@@ -212,6 +234,8 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
{
super.breakBlock( w, x, y, z, b, WTF );
if( Platform.isServer() )
{
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
}
}
}
@@ -91,7 +91,9 @@ public class OreQuartz extends AEBaseBlock
}
if( j1 > 15 )
{
j1 = 15;
}
return j1 << 20 | j1 << 4;
}
return j1;
@@ -20,7 +20,6 @@ package appeng.block.solids;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
@@ -76,7 +75,9 @@ public class OreQuartzCharged extends OreQuartz
public void randomDisplayTick( World w, int x, int y, int z, Random r )
{
if ( !AEConfig.instance.enableEffects )
{
return;
}
double xOff = ( r.nextFloat() );
double yOff = ( r.nextFloat() );
@@ -49,20 +49,26 @@ public class BlockSpatialIOPort extends AEBaseBlock
{
TileSpatialIOPort te = this.getTileEntity( w, x, y, z );
if( te != null )
{
te.updateRedstoneState();
}
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileSpatialIOPort tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_SPATIAL_IO_PORT );
}
return true;
}
return false;
@@ -48,7 +48,9 @@ public class BlockSpatialPylon extends AEBaseBlock
{
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
if( tsp != null )
{
tsp.onNeighborBlockChange();
}
}
@Override
@@ -56,7 +58,9 @@ public class BlockSpatialPylon extends AEBaseBlock
{
TileSpatialPylon tsp = this.getTileEntity( w, x, y, z );
if( tsp != null )
{
return tsp.getLightValue();
}
return super.getLightValue( w, x, y, z );
}
@@ -62,7 +62,9 @@ public class BlockChest extends AEBaseBlock
if( tg != null && !p.isSneaking() )
{
if( Platform.isClient() )
{
return true;
}
if( side != tg.getUp().ordinal() )
{
@@ -78,7 +80,9 @@ public class BlockChest extends AEBaseBlock
tg.openGui( p, ch, cell, side );
}
else
{
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
}
}
return true;
@@ -55,13 +55,17 @@ public class BlockDrive extends AEBaseBlock
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileDrive tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_DRIVE );
}
return true;
}
return false;
@@ -49,20 +49,26 @@ public class BlockIOPort extends AEBaseBlock
{
TileIOPort te = this.getTileEntity( w, x, y, z );
if( te != null )
{
te.updateRedstoneState();
}
}
@Override
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
{
if( p.isSneaking() )
{
return false;
}
TileIOPort tg = this.getTileEntity( w, x, y, z );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_IOPORT );
}
return true;
}
return false;
@@ -104,7 +104,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public boolean onActivated( World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ )
{
if( Platform.isServer() )
{
Platform.openGUI( player, this.getTileEntity( w, x, y, z ), ForgeDirection.getOrientation( side ), GuiBridge.GUI_SKYCHEST );
}
return true;
}
@@ -127,7 +129,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public String getUnlocalizedName( ItemStack is )
{
if( is.getItemDamage() == 1 )
{
return this.getUnlocalizedName() + ".Block";
}
return this.getUnlocalizedName();
}
@@ -140,7 +144,9 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
ForgeDirection o = ForgeDirection.UNKNOWN;
if( sk != null )
{
o = sk.getUp();
}
double X = o.offsetX == 0 ? 0.06 : 0.0;
double Y = o.offsetY == 0 ? 0.06 : 0.0;