final variables and parameters
This commit is contained in:
@@ -47,20 +47,20 @@ public class BlockCellWorkbench extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer p,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer p,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileCellWorkbench tg = this.getTileEntity( w, pos );
|
||||
final TileCellWorkbench tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
|
||||
@@ -71,13 +71,13 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer player,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer player,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
@@ -86,7 +86,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
TileCharger tc = this.getTileEntity( w, pos );
|
||||
final TileCharger tc = this.getTileEntity( w, pos );
|
||||
if( tc != null )
|
||||
{
|
||||
tc.activate( player );
|
||||
@@ -99,10 +99,10 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Random r )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
@@ -114,22 +114,22 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
return;
|
||||
}
|
||||
|
||||
AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
if( tile instanceof TileCharger )
|
||||
{
|
||||
TileCharger tc = (TileCharger) tile;
|
||||
final TileCharger tc = (TileCharger) tile;
|
||||
|
||||
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
|
||||
{
|
||||
double xOff = 0.0;
|
||||
double yOff = 0.0;
|
||||
double zOff = 0.0;
|
||||
final double xOff = 0.0;
|
||||
final double yOff = 0.0;
|
||||
final double zOff = 0.0;
|
||||
|
||||
for( int bolts = 0; bolts < 3; bolts++ )
|
||||
{
|
||||
if( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||
}
|
||||
}
|
||||
@@ -139,18 +139,18 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
Entity thePlayer,
|
||||
boolean b )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final Entity thePlayer,
|
||||
final boolean b )
|
||||
{
|
||||
TileCharger tile = this.getTileEntity( w, pos );
|
||||
final TileCharger tile = this.getTileEntity( w, pos );
|
||||
if( tile != null )
|
||||
{
|
||||
double twoPixels = 2.0 / 16.0;
|
||||
EnumFacing up = tile.getUp();
|
||||
EnumFacing forward = tile.getForward();
|
||||
AEAxisAlignedBB bb = AEAxisAlignedBB.fromBounds( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
|
||||
final double twoPixels = 2.0 / 16.0;
|
||||
final EnumFacing up = tile.getUp();
|
||||
final EnumFacing forward = tile.getForward();
|
||||
final AEAxisAlignedBB bb = AEAxisAlignedBB.fromBounds( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );
|
||||
|
||||
if( up.getFrontOffsetX() != 0 )
|
||||
{
|
||||
@@ -199,11 +199,11 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
AxisAlignedBB bb,
|
||||
List<AxisAlignedBB> out,
|
||||
Entity e )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final AxisAlignedBB bb,
|
||||
final List<AxisAlignedBB> out,
|
||||
final Entity e )
|
||||
{
|
||||
out.add( AxisAlignedBB.fromBounds( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) );
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ public class BlockCondenser extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer player,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer player,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class BlockCondenser extends AEBaseTileBlock
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
TileCondenser tc = this.getTileEntity( w, pos );
|
||||
final TileCondenser tc = this.getTileEntity( w, pos );
|
||||
if( tc != null && !player.isSneaking() )
|
||||
{
|
||||
Platform.openGUI( player, tc, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CONDENSER );
|
||||
|
||||
@@ -58,20 +58,20 @@ public class BlockInscriber extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer p,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer p,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileInscriber tg = this.getTileEntity( w, pos );
|
||||
final TileInscriber tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
@@ -84,7 +84,7 @@ public class BlockInscriber extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
public String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
return super.getUnlocalizedName( is );
|
||||
}
|
||||
|
||||
@@ -56,20 +56,20 @@ public class BlockInterface extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer p,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer p,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileInterface tg = this.getTileEntity( w, pos );
|
||||
final TileInterface tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
@@ -88,7 +88,7 @@ public class BlockInterface extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customRotateBlock( IOrientable rotatable, EnumFacing axis )
|
||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||
{
|
||||
if( rotatable instanceof TileInterface )
|
||||
{
|
||||
|
||||
@@ -62,14 +62,14 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(
|
||||
IBlockState state )
|
||||
final IBlockState state )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(
|
||||
int meta )
|
||||
final int meta )
|
||||
{
|
||||
return getDefaultState();
|
||||
}
|
||||
@@ -82,10 +82,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower(
|
||||
IBlockAccess w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
EnumFacing side )
|
||||
final IBlockAccess w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final EnumFacing side )
|
||||
{
|
||||
if( w instanceof World && ( (TileLightDetector) this.getTileEntity( w, pos ) ).isReady() )
|
||||
{
|
||||
@@ -97,13 +97,13 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(
|
||||
IBlockAccess world,
|
||||
BlockPos pos,
|
||||
BlockPos neighbor )
|
||||
final IBlockAccess world,
|
||||
final BlockPos pos,
|
||||
final BlockPos neighbor )
|
||||
{
|
||||
super.onNeighborChange( world, pos, neighbor );
|
||||
|
||||
TileLightDetector tld = this.getTileEntity( world, pos );
|
||||
final TileLightDetector tld = this.getTileEntity( world, pos );
|
||||
if( tld != null )
|
||||
{
|
||||
tld.updateLight();
|
||||
@@ -112,10 +112,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(
|
||||
World worldIn,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Random rand )
|
||||
final World worldIn,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Random rand )
|
||||
{
|
||||
// cancel out lightning
|
||||
}
|
||||
@@ -128,40 +128,40 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EnumFacing forward,
|
||||
EnumFacing up )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EnumFacing forward,
|
||||
final EnumFacing up )
|
||||
{
|
||||
return this.canPlaceAt( w, pos, up.getOpposite() );
|
||||
}
|
||||
|
||||
private boolean canPlaceAt( World w, BlockPos pos, EnumFacing dir )
|
||||
private boolean canPlaceAt( final World w, final BlockPos pos, final EnumFacing dir )
|
||||
{
|
||||
return w.isSideSolid( pos.offset( dir ), dir.getOpposite(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
Entity thePlayer,
|
||||
boolean b )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final Entity thePlayer,
|
||||
final boolean b )
|
||||
{
|
||||
EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
double xOff = -0.3 * up.getFrontOffsetX();
|
||||
double yOff = -0.3 * up.getFrontOffsetY();
|
||||
double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
final double xOff = -0.3 * up.getFrontOffsetX();
|
||||
final double yOff = -0.3 * up.getFrontOffsetY();
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
return Collections.singletonList( AxisAlignedBB.fromBounds( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
AxisAlignedBB bb,
|
||||
List<AxisAlignedBB> out,
|
||||
Entity e )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final AxisAlignedBB bb,
|
||||
final List<AxisAlignedBB> out,
|
||||
final Entity e )
|
||||
{/*
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
|
||||
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
|
||||
@@ -171,19 +171,19 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Block neighborBlock )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Block neighborBlock )
|
||||
{
|
||||
EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, pos );
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch( World w, BlockPos pos )
|
||||
private void dropTorch( final World w, final BlockPos pos )
|
||||
{
|
||||
w.destroyBlock( pos, true );
|
||||
w.markBlockForUpdate( pos );
|
||||
@@ -191,10 +191,10 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(
|
||||
World w,
|
||||
BlockPos pos )
|
||||
final World w,
|
||||
final BlockPos pos )
|
||||
{
|
||||
for( EnumFacing dir : EnumFacing.VALUES )
|
||||
for( final EnumFacing dir : EnumFacing.VALUES )
|
||||
{
|
||||
if( this.canPlaceAt( w, pos, dir ) )
|
||||
{
|
||||
@@ -211,7 +211,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable( final IBlockAccess w, BlockPos pos )
|
||||
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
return new MetaRotation( w, pos,true );
|
||||
}
|
||||
|
||||
@@ -73,36 +73,36 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
|
||||
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(
|
||||
World worldIn,
|
||||
BlockPos pos,
|
||||
IBlockState state )
|
||||
final World worldIn,
|
||||
final BlockPos pos,
|
||||
final IBlockState state )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCollideCheck(
|
||||
IBlockState state,
|
||||
boolean hitIfLiquid )
|
||||
final IBlockState state,
|
||||
final boolean hitIfLiquid )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Block neighborBlock )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Block neighborBlock )
|
||||
{
|
||||
TilePaint tp = this.getTileEntity( w, pos );
|
||||
final TilePaint tp = this.getTileEntity( w, pos );
|
||||
|
||||
if( tp != null )
|
||||
{
|
||||
@@ -112,28 +112,28 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(
|
||||
IBlockState state,
|
||||
Random rand,
|
||||
int fortune )
|
||||
final IBlockState state,
|
||||
final Random rand,
|
||||
final int fortune )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(
|
||||
World worldIn,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
float chance,
|
||||
int fortune )
|
||||
final World worldIn,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final float chance,
|
||||
final int fortune )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillWithRain(
|
||||
World w,
|
||||
BlockPos pos )
|
||||
final World w,
|
||||
final BlockPos pos )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -143,10 +143,10 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public int getLightValue(
|
||||
IBlockAccess w,
|
||||
BlockPos pos )
|
||||
final IBlockAccess w,
|
||||
final BlockPos pos )
|
||||
{
|
||||
TilePaint tp = this.getTileEntity( w, pos );
|
||||
final TilePaint tp = this.getTileEntity( w, pos );
|
||||
|
||||
if( tp != null )
|
||||
{
|
||||
@@ -158,16 +158,16 @@ public class BlockPaint extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean isAir(
|
||||
IBlockAccess world,
|
||||
BlockPos pos )
|
||||
final IBlockAccess world,
|
||||
final BlockPos pos )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(
|
||||
World worldIn,
|
||||
BlockPos pos )
|
||||
final World worldIn,
|
||||
final BlockPos pos )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,48 +58,47 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Random r )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos );
|
||||
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos );
|
||||
|
||||
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
double d0 = r.nextFloat() - 0.5F;
|
||||
double d1 = r.nextFloat() - 0.5F;
|
||||
final double d0 = r.nextFloat() - 0.5F;
|
||||
final double d1 = r.nextFloat() - 0.5F;
|
||||
|
||||
EnumFacing up = cga.getUp();
|
||||
EnumFacing forward = cga.getForward();
|
||||
EnumFacing west = Platform.crossProduct( forward, up );
|
||||
final EnumFacing up = cga.getUp();
|
||||
final EnumFacing forward = cga.getForward();
|
||||
final EnumFacing west = Platform.crossProduct( forward, up );
|
||||
|
||||
double rx = 0.5 + pos.getX();
|
||||
double ry = 0.5 + pos.getY();
|
||||
double rz = 0.5 + pos.getZ();
|
||||
|
||||
double dx = 0;
|
||||
double dz = 0;
|
||||
|
||||
rx += up.getFrontOffsetX() * d0;
|
||||
ry += up.getFrontOffsetY() * d0;
|
||||
rz += up.getFrontOffsetZ() * d0;
|
||||
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
|
||||
final int x = pos.getX();
|
||||
final int y = pos.getY();
|
||||
final int z = pos.getZ();
|
||||
|
||||
double dz = 0;
|
||||
double dx = 0;
|
||||
switch( r.nextInt( 4 ) )
|
||||
{
|
||||
case 0:
|
||||
dx = 0.6;
|
||||
dz = d1;
|
||||
BlockPos pt = new BlockPos( x + west.getFrontOffsetX(), y + west.getFrontOffsetY(), z + west.getFrontOffsetZ() );
|
||||
final BlockPos pt = new BlockPos( x + west.getFrontOffsetX(), y + west.getFrontOffsetY(), z + west.getFrontOffsetZ() );
|
||||
if( !w.getBlockState(pt).getBlock().isAir( w, pt) )
|
||||
{
|
||||
return;
|
||||
@@ -142,7 +141,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock
|
||||
ry += dz * forward.getFrontOffsetY();
|
||||
rz += dz * forward.getFrontOffsetZ();
|
||||
|
||||
LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
|
||||
final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(
|
||||
IBlockState state )
|
||||
final IBlockState state )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(
|
||||
int meta )
|
||||
final int meta )
|
||||
{
|
||||
return getDefaultState();
|
||||
}
|
||||
@@ -91,29 +91,29 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation( World w, BlockPos pos, EnumFacing forward, EnumFacing up )
|
||||
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
{
|
||||
return this.canPlaceAt( w, pos, up.getOpposite() );
|
||||
}
|
||||
|
||||
private boolean canPlaceAt( World w, BlockPos pos, EnumFacing dir )
|
||||
private boolean canPlaceAt( final World w, final BlockPos pos, final EnumFacing dir )
|
||||
{
|
||||
BlockPos test = pos.offset( dir );
|
||||
final BlockPos test = pos.offset( dir );
|
||||
return w.isSideSolid( test, dir.getOpposite(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, BlockPos pos, Entity e, boolean isVisual )
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity e, final boolean isVisual )
|
||||
{
|
||||
EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
double xOff = -0.3 * up.getFrontOffsetX();
|
||||
double yOff = -0.3 * up.getFrontOffsetY();
|
||||
double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
final double xOff = -0.3 * up.getFrontOffsetX();
|
||||
final double yOff = -0.3 * up.getFrontOffsetY();
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
return Collections.singletonList( AxisAlignedBB.fromBounds( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( World w, BlockPos pos, AxisAlignedBB bb, List out, Entity e )
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List out, final Entity e )
|
||||
{/*
|
||||
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
|
||||
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
|
||||
@@ -124,10 +124,10 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Random r )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
@@ -139,15 +139,15 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
double xOff = -0.3 * up.getFrontOffsetX();
|
||||
double yOff = -0.3 * up.getFrontOffsetY();
|
||||
double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
final double xOff = -0.3 * up.getFrontOffsetX();
|
||||
final double yOff = -0.3 * up.getFrontOffsetY();
|
||||
final double zOff = -0.3 * up.getFrontOffsetZ();
|
||||
for( int bolts = 0; bolts < 3; bolts++ )
|
||||
{
|
||||
if( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
{
|
||||
LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||
}
|
||||
@@ -156,28 +156,28 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Block neighborBlock )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Block neighborBlock )
|
||||
{
|
||||
EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
final EnumFacing up = this.getOrientable( w, pos ).getUp();
|
||||
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, pos );
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch( World w, BlockPos pos )
|
||||
private void dropTorch( final World w, final BlockPos pos )
|
||||
{
|
||||
w.destroyBlock( pos, true );
|
||||
w.markBlockForUpdate( pos );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt( World w, BlockPos pos )
|
||||
public boolean canPlaceBlockAt( final World w, final BlockPos pos )
|
||||
{
|
||||
for( EnumFacing dir : EnumFacing.VALUES )
|
||||
for( final EnumFacing dir : EnumFacing.VALUES )
|
||||
{
|
||||
if( this.canPlaceAt( w, pos, dir ) )
|
||||
{
|
||||
@@ -194,7 +194,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable( final IBlockAccess w, BlockPos pos )
|
||||
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
{
|
||||
return new MetaRotation( w, pos,true );
|
||||
}
|
||||
|
||||
@@ -62,20 +62,20 @@ public class BlockSecurity extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer p,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer p,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileSecurity tg = this.getTileEntity( w, pos );
|
||||
final TileSecurity tg = this.getTileEntity( w, pos );
|
||||
if( tg != null )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
|
||||
@@ -58,9 +58,9 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation( World w, BlockPos pos, EnumFacing forward, EnumFacing up )
|
||||
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
{
|
||||
TileSkyCompass sc = this.getTileEntity( w, pos );
|
||||
final TileSkyCompass sc = this.getTileEntity( w, pos );
|
||||
if( sc != null )
|
||||
{
|
||||
return false;
|
||||
@@ -68,27 +68,27 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
return this.canPlaceAt( w, pos, forward.getOpposite() );
|
||||
}
|
||||
|
||||
private boolean canPlaceAt( World w, BlockPos pos, EnumFacing dir )
|
||||
private boolean canPlaceAt( final World w, final BlockPos pos, final EnumFacing dir )
|
||||
{
|
||||
return w.isSideSolid( pos.offset( dir ), dir.getOpposite(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Block neighborBlock )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Block neighborBlock )
|
||||
{
|
||||
TileSkyCompass sc = this.getTileEntity( w, pos );
|
||||
EnumFacing up = sc.getForward();
|
||||
final TileSkyCompass sc = this.getTileEntity( w, pos );
|
||||
final EnumFacing up = sc.getForward();
|
||||
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
|
||||
{
|
||||
this.dropTorch( w, pos );
|
||||
}
|
||||
}
|
||||
|
||||
private void dropTorch( World w, BlockPos pos )
|
||||
private void dropTorch( final World w, final BlockPos pos )
|
||||
{
|
||||
w.destroyBlock( pos, true );
|
||||
w.markBlockForUpdate( pos );
|
||||
@@ -96,10 +96,10 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(
|
||||
World w,
|
||||
BlockPos pos )
|
||||
final World w,
|
||||
final BlockPos pos )
|
||||
{
|
||||
for( EnumFacing dir : EnumFacing.VALUES )
|
||||
for( final EnumFacing dir : EnumFacing.VALUES )
|
||||
{
|
||||
if( this.canPlaceAt( w, pos, dir ) )
|
||||
{
|
||||
@@ -111,15 +111,15 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
Entity thePlayer,
|
||||
boolean b )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final Entity thePlayer,
|
||||
final boolean b )
|
||||
{
|
||||
TileSkyCompass tile = this.getTileEntity( w, pos );
|
||||
final TileSkyCompass tile = this.getTileEntity( w, pos );
|
||||
if( tile != null )
|
||||
{
|
||||
EnumFacing forward = tile.getForward();
|
||||
final EnumFacing forward = tile.getForward();
|
||||
|
||||
double minX = 0;
|
||||
double minY = 0;
|
||||
@@ -177,11 +177,11 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
AxisAlignedBB bb,
|
||||
List<AxisAlignedBB> out,
|
||||
Entity e )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final AxisAlignedBB bb,
|
||||
final List<AxisAlignedBB> out,
|
||||
final Entity e )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( World w, BlockPos pos, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel )
|
||||
{
|
||||
@@ -95,18 +95,18 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
}
|
||||
}
|
||||
|
||||
public void startFuse( World w, BlockPos pos, EntityLivingBase igniter )
|
||||
public void startFuse( final World w, final BlockPos pos, final EntityLivingBase igniter )
|
||||
{
|
||||
if( !w.isRemote )
|
||||
{
|
||||
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
|
||||
w.spawnEntityInWorld( primedTinyTNTEntity );
|
||||
w.playSoundAtEntity( primedTinyTNTEntity, "game.tnt.primed", 1.0F, 1.0F );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, BlockPos pos, IBlockState state, Block neighborBlock )
|
||||
public void onNeighborBlockChange( final World w, final BlockPos pos, final IBlockState state, final Block neighborBlock )
|
||||
{
|
||||
if( w.isBlockIndirectlyGettingPowered( pos ) > 0 )
|
||||
{
|
||||
@@ -116,7 +116,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded( World w, BlockPos pos, IBlockState state )
|
||||
public void onBlockAdded( final World w, final BlockPos pos, final IBlockState state )
|
||||
{
|
||||
super.onBlockAdded( w, pos, state );
|
||||
|
||||
@@ -128,11 +128,11 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock( World w, BlockPos pos, Entity entity )
|
||||
public void onEntityCollidedWithBlock( final World w, final BlockPos pos, final Entity entity )
|
||||
{
|
||||
if( entity instanceof EntityArrow && !w.isRemote )
|
||||
{
|
||||
EntityArrow entityarrow = (EntityArrow) entity;
|
||||
final EntityArrow entityarrow = (EntityArrow) entity;
|
||||
|
||||
if( entityarrow.isBurning() )
|
||||
{
|
||||
@@ -143,30 +143,30 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDropFromExplosion( Explosion exp )
|
||||
public boolean canDropFromExplosion( final Explosion exp )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockExploded( World w, BlockPos pos, Explosion exp )
|
||||
public void onBlockExploded( final World w, final BlockPos pos, final Explosion exp )
|
||||
{
|
||||
if( !w.isRemote )
|
||||
{
|
||||
EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() );
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() );
|
||||
primedTinyTNTEntity.fuse = w.rand.nextInt( primedTinyTNTEntity.fuse / 4 ) + primedTinyTNTEntity.fuse / 8;
|
||||
w.spawnEntityInWorld( primedTinyTNTEntity );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( World w, BlockPos pos, Entity thePlayer, boolean b )
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
||||
{
|
||||
return Collections.singletonList( AxisAlignedBB.fromBounds( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( World w, BlockPos pos, AxisAlignedBB bb, List<AxisAlignedBB> out, Entity e )
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
out.add( AxisAlignedBB.fromBounds( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public appeng.client.texture.IAESprite getIcon(IBlockAccess w, BlockPos pos, EnumFacing side)
|
||||
public appeng.client.texture.IAESprite getIcon( final IBlockAccess w, final BlockPos pos, final EnumFacing side)
|
||||
{
|
||||
IAESprite ico = super.getIcon( w, pos, side );
|
||||
TileVibrationChamber tvc = this.getTileEntity( w, pos );
|
||||
final IAESprite ico = super.getIcon( w, pos, side );
|
||||
final TileVibrationChamber tvc = this.getTileEntity( w, pos );
|
||||
|
||||
if( tvc != null && tvc.isOn && ico == this.getRendererInstance().getTexture( AEPartLocation.SOUTH ) )
|
||||
{
|
||||
@@ -69,13 +69,13 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
EntityPlayer player,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final EntityPlayer player,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
@@ -84,7 +84,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
TileVibrationChamber tc = this.getTileEntity( w, pos );
|
||||
final TileVibrationChamber tc = this.getTileEntity( w, pos );
|
||||
if( tc != null && !player.isSneaking() )
|
||||
{
|
||||
Platform.openGUI( player, tc, AEPartLocation.fromFacing( side ), GuiBridge.GUI_VIBRATION_CHAMBER );
|
||||
@@ -97,39 +97,39 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(
|
||||
World w,
|
||||
BlockPos pos,
|
||||
IBlockState state,
|
||||
Random r )
|
||||
final World w,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
if( tile instanceof TileVibrationChamber )
|
||||
{
|
||||
TileVibrationChamber tc = (TileVibrationChamber) tile;
|
||||
final TileVibrationChamber tc = (TileVibrationChamber) tile;
|
||||
if( tc.isOn )
|
||||
{
|
||||
float f1 = pos.getX() + 0.5F;
|
||||
float f2 = pos.getY() + 0.5F;
|
||||
float f3 = pos.getZ() + 0.5F;
|
||||
|
||||
EnumFacing forward = tc.getForward();
|
||||
EnumFacing up = tc.getUp();
|
||||
final EnumFacing forward = tc.getForward();
|
||||
final EnumFacing up = tc.getUp();
|
||||
|
||||
int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
|
||||
int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
|
||||
int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
|
||||
final int west_x = forward.getFrontOffsetY() * up.getFrontOffsetZ() - forward.getFrontOffsetZ() * up.getFrontOffsetY();
|
||||
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
|
||||
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
|
||||
|
||||
f1 += forward.getFrontOffsetX() * 0.6;
|
||||
f2 += forward.getFrontOffsetY() * 0.6;
|
||||
f3 += forward.getFrontOffsetZ() * 0.6;
|
||||
|
||||
float ox = r.nextFloat();
|
||||
float oy = r.nextFloat() * 0.2f;
|
||||
final float ox = r.nextFloat();
|
||||
final float oy = r.nextFloat() * 0.2f;
|
||||
|
||||
f1 += up.getFrontOffsetX() * ( -0.3 + oy );
|
||||
f2 += up.getFrontOffsetY() * ( -0.3 + oy );
|
||||
|
||||
Reference in New Issue
Block a user