final variables and parameters
seeing some methods it does actually help to enforce the parameters
This commit is contained in:
@@ -122,7 +122,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
boolean canUpdate = false;
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock( ForgeDirection side, AEColor colour, EntityPlayer who )
|
||||
public boolean recolourBlock( final ForgeDirection side, final AEColor colour, final EntityPlayer who )
|
||||
{
|
||||
return this.cb.recolourBlock( side, colour, who );
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
{
|
||||
AxisAlignedBB b = null;
|
||||
|
||||
for( AxisAlignedBB bx : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
|
||||
for( final AxisAlignedBB bx : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
|
||||
{
|
||||
if( b == null )
|
||||
{
|
||||
@@ -140,12 +140,12 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
else
|
||||
{
|
||||
double minX = Math.min( b.minX, bx.minX );
|
||||
double minY = Math.min( b.minY, bx.minY );
|
||||
double minZ = Math.min( b.minZ, bx.minZ );
|
||||
double maxX = Math.max( b.maxX, bx.maxX );
|
||||
double maxY = Math.max( b.maxY, bx.maxY );
|
||||
double maxZ = Math.max( b.maxZ, bx.maxZ );
|
||||
final double minX = Math.min( b.minX, bx.minX );
|
||||
final double minY = Math.min( b.minY, bx.minY );
|
||||
final double minZ = Math.min( b.minZ, bx.minZ );
|
||||
final double maxX = Math.max( b.maxX, bx.maxX );
|
||||
final double maxY = Math.max( b.maxY, bx.maxY );
|
||||
final double maxZ = Math.max( b.maxZ, bx.maxZ );
|
||||
b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
|
||||
}
|
||||
}
|
||||
@@ -179,13 +179,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean occlusionTest( TMultiPart part )
|
||||
public boolean occlusionTest( final TMultiPart part )
|
||||
{
|
||||
return NormalOcclusionTest.apply( this, part );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderStatic( Vector3 pos, int pass )
|
||||
public boolean renderStatic( final Vector3 pos, final int pass )
|
||||
{
|
||||
if( pass == 0 || ( pass == 1 && AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) ) )
|
||||
{
|
||||
@@ -200,7 +200,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDynamic( Vector3 pos, float frame, int pass )
|
||||
public void renderDynamic( final Vector3 pos, final float frame, final int pass )
|
||||
{
|
||||
if( pass == 0 || ( pass == 1 && AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) ) )
|
||||
{
|
||||
@@ -210,25 +210,25 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPartChanged( TMultiPart part )
|
||||
public void onPartChanged( final TMultiPart part )
|
||||
{
|
||||
this.cb.updateConnections();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision( Entity entity )
|
||||
public void onEntityCollision( final Entity entity )
|
||||
{
|
||||
this.cb.onEntityCollision( entity );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate( EntityPlayer player, MovingObjectPosition hit, ItemStack item )
|
||||
public boolean activate( final EntityPlayer player, final MovingObjectPosition hit, final ItemStack item )
|
||||
{
|
||||
return this.cb.activate( player, hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load( NBTTagCompound tag )
|
||||
public void load( final NBTTagCompound tag )
|
||||
{
|
||||
this.cb.readFromNBT( tag );
|
||||
}
|
||||
@@ -241,15 +241,15 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save( NBTTagCompound tag )
|
||||
public void save( final NBTTagCompound tag )
|
||||
{
|
||||
this.cb.writeToNBT( tag );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDesc( MCDataOutput packet )
|
||||
public void writeDesc( final MCDataOutput packet )
|
||||
{
|
||||
ByteBuf stream = Unpooled.buffer();
|
||||
final ByteBuf stream = Unpooled.buffer();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -258,17 +258,17 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
stream.capacity( stream.readableBytes() );
|
||||
packet.writeByteArray( stream.array() );
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack pickItem( MovingObjectPosition hit )
|
||||
public ItemStack pickItem( final MovingObjectPosition hit )
|
||||
{
|
||||
Vec3 v3 = hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ );
|
||||
SelectedPart sp = this.cb.selectPart( v3 );
|
||||
final Vec3 v3 = hit.hitVec.addVector( -hit.blockX, -hit.blockY, -hit.blockZ );
|
||||
final SelectedPart sp = this.cb.selectPart( v3 );
|
||||
if( sp != null )
|
||||
{
|
||||
if( sp.part != null )
|
||||
@@ -308,54 +308,54 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDesc( MCDataInput packet )
|
||||
public void readDesc( final MCDataInput packet )
|
||||
{
|
||||
int len = packet.readInt();
|
||||
byte[] data = packet.readByteArray( len );
|
||||
final int len = packet.readInt();
|
||||
final byte[] data = packet.readByteArray( len );
|
||||
|
||||
try
|
||||
{
|
||||
if( len > 0 )
|
||||
{
|
||||
ByteBuf byteBuffer = Unpooled.wrappedBuffer( data );
|
||||
final ByteBuf byteBuffer = Unpooled.wrappedBuffer( data );
|
||||
this.cb.readFromStream( byteBuffer );
|
||||
}
|
||||
}
|
||||
catch( IOException e )
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone( int side )
|
||||
public boolean canConnectRedstone( final int side )
|
||||
{
|
||||
return this.cb.canConnectRedstone( EnumSet.of( ForgeDirection.getOrientation( side ) ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int weakPowerLevel( int side )
|
||||
public int weakPowerLevel( final int side )
|
||||
{
|
||||
return this.cb.isProvidingWeakPower( ForgeDirection.getOrientation( side ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int strongPowerLevel( int side )
|
||||
public int strongPowerLevel( final int side )
|
||||
{
|
||||
return this.cb.isProvidingStrongPower( ForgeDirection.getOrientation( side ) );
|
||||
}
|
||||
|
||||
public void convertFromTile( TileEntity blockTileEntity )
|
||||
public void convertFromTile( final TileEntity blockTileEntity )
|
||||
{
|
||||
TileCableBus tcb = (TileCableBus) blockTileEntity;
|
||||
final TileCableBus tcb = (TileCableBus) blockTileEntity;
|
||||
this.cb = tcb.cb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Cuboid6> getOcclusionBoxes()
|
||||
{
|
||||
LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
|
||||
for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( true, DISABLE_FACADE_OCCLUSION.get() == null, null, true ) )
|
||||
final LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
|
||||
for( final AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( true, DISABLE_FACADE_OCCLUSION.get() == null, null, true ) )
|
||||
{
|
||||
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
||||
}
|
||||
@@ -363,13 +363,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode( ForgeDirection dir )
|
||||
public IGridNode getGridNode( final ForgeDirection dir )
|
||||
{
|
||||
return this.cb.getGridNode( dir );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( ForgeDirection dir )
|
||||
public AECableType getCableConnectionType( final ForgeDirection dir )
|
||||
{
|
||||
return this.cb.getCableConnectionType( dir );
|
||||
}
|
||||
@@ -381,20 +381,20 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
// @Override
|
||||
public int getHollowSize( int side )
|
||||
public int getHollowSize( final int side )
|
||||
{
|
||||
IPartCable cable = (IPartCable) this.getPart( ForgeDirection.UNKNOWN );
|
||||
final IPartCable cable = (IPartCable) this.getPart( ForgeDirection.UNKNOWN );
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation( side );
|
||||
final ForgeDirection dir = ForgeDirection.getOrientation( side );
|
||||
if( cable != null && cable.isConnected( dir ) )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
final List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
|
||||
BusCollisionHelper bch = new BusCollisionHelper( boxes, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH, null, true );
|
||||
final BusCollisionHelper bch = new BusCollisionHelper( boxes, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH, null, true );
|
||||
|
||||
for( ForgeDirection whichSide : ForgeDirection.values() )
|
||||
for( final ForgeDirection whichSide : ForgeDirection.values() )
|
||||
{
|
||||
IPart fPart = this.getPart( whichSide );
|
||||
final IPart fPart = this.getPart( whichSide );
|
||||
|
||||
if( fPart != null )
|
||||
{
|
||||
@@ -403,9 +403,9 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
AxisAlignedBB b = null;
|
||||
AxisAlignedBB pb = Platform.getPrimaryBox( dir, 2 );
|
||||
final AxisAlignedBB pb = Platform.getPrimaryBox( dir, 2 );
|
||||
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
for( final AxisAlignedBB bb : boxes )
|
||||
{
|
||||
if( bb.intersectsWith( pb ) )
|
||||
{
|
||||
@@ -448,7 +448,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
return 12;
|
||||
}
|
||||
|
||||
int getSize( double a, double b, double c, double d )
|
||||
int getSize( final double a, final double b, final double c, final double d )
|
||||
{
|
||||
double r = Math.abs( a - 0.5 );
|
||||
r = Math.max( Math.abs( b - 0.5 ), r );
|
||||
@@ -461,7 +461,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
{
|
||||
int mask = 0;
|
||||
|
||||
for( ForgeDirection side : ForgeDirection.values() )
|
||||
for( final ForgeDirection side : ForgeDirection.values() )
|
||||
{
|
||||
if( this.getPart( side ) != null )
|
||||
{
|
||||
@@ -483,20 +483,20 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddPart( ItemStack is, ForgeDirection side )
|
||||
public boolean canAddPart( ItemStack is, final ForgeDirection side )
|
||||
{
|
||||
IFacadePart fp = PartPlacement.isFacade( is, side );
|
||||
final IFacadePart fp = PartPlacement.isFacade( is, side );
|
||||
if( fp != null )
|
||||
{
|
||||
if( !( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null ) )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
final List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
fp.getBoxes( bch, null );
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
for( final AxisAlignedBB bb : boxes )
|
||||
{
|
||||
DISABLE_FACADE_OCCLUSION.set( true );
|
||||
boolean canAdd = this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) );
|
||||
final boolean canAdd = this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) );
|
||||
DISABLE_FACADE_OCCLUSION.remove();
|
||||
if( !canAdd )
|
||||
{
|
||||
@@ -509,7 +509,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
|
||||
if( is.getItem() instanceof IPartItem )
|
||||
{
|
||||
IPartItem bi = (IPartItem) is.getItem();
|
||||
final IPartItem bi = (IPartItem) is.getItem();
|
||||
|
||||
is = is.copy();
|
||||
is.stackSize = 1;
|
||||
@@ -517,13 +517,13 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
final IPart bp = bi.createPartFromItemStack( is );
|
||||
if( !( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null ) )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
final List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
|
||||
final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
if( bp != null )
|
||||
{
|
||||
bp.getBoxes( bch );
|
||||
}
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
for( final AxisAlignedBB bb : boxes )
|
||||
{
|
||||
if( !this.tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ) )
|
||||
{
|
||||
@@ -537,19 +537,19 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner )
|
||||
public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer owner )
|
||||
{
|
||||
return this.cb.addPart( is, side, owner );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getPart( ForgeDirection side )
|
||||
public IPart getPart( final ForgeDirection side )
|
||||
{
|
||||
return this.cb.getPart( side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePart( ForgeDirection side, boolean suppressUpdate )
|
||||
public void removePart( final ForgeDirection side, final boolean suppressUpdate )
|
||||
{
|
||||
this.cb.removePart( side, suppressUpdate );
|
||||
}
|
||||
@@ -582,7 +582,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocked( ForgeDirection side )
|
||||
public boolean isBlocked( final ForgeDirection side )
|
||||
{
|
||||
if( side == null || side == ForgeDirection.UNKNOWN || this.tile() == null )
|
||||
{
|
||||
@@ -594,14 +594,14 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
final int ordinal = side.ordinal();
|
||||
final Cuboid6 sideTest = SIDE_TESTS[ordinal];
|
||||
final NormallyOccludedPart occludedPart = new NormallyOccludedPart( sideTest );
|
||||
boolean blocked = !this.tile().canAddPart( occludedPart );
|
||||
final boolean blocked = !this.tile().canAddPart( occludedPart );
|
||||
DISABLE_FACADE_OCCLUSION.remove();
|
||||
|
||||
return blocked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart( Vec3 pos )
|
||||
public SelectedPart selectPart( final Vec3 pos )
|
||||
{
|
||||
return this.cb.selectPart( pos );
|
||||
}
|
||||
@@ -610,7 +610,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
public void markForSave()
|
||||
{
|
||||
// mark the chunk for save...
|
||||
TileEntity te = this.tile();
|
||||
final TileEntity te = this.tile();
|
||||
if( te != null && te.getWorldObj() != null )
|
||||
{
|
||||
te.getWorldObj().getChunkFromBlockCoords( this.x(), this.z() ).isModified = true;
|
||||
@@ -627,7 +627,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRedstone( ForgeDirection side )
|
||||
public boolean hasRedstone( final ForgeDirection side )
|
||||
{
|
||||
return this.cb.hasRedstone( side );
|
||||
}
|
||||
@@ -673,8 +673,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
@Override
|
||||
public Iterable<Cuboid6> getCollisionBoxes()
|
||||
{
|
||||
LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
|
||||
for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
|
||||
final LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
|
||||
for( final AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
|
||||
{
|
||||
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
|
||||
}
|
||||
@@ -684,8 +684,8 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
@Override
|
||||
public Iterable<IndexedCuboid6> getSubParts()
|
||||
{
|
||||
LinkedList<IndexedCuboid6> l = new LinkedList<IndexedCuboid6>();
|
||||
for( Cuboid6 c : this.getCollisionBoxes() )
|
||||
final LinkedList<IndexedCuboid6> l = new LinkedList<IndexedCuboid6>();
|
||||
for( final Cuboid6 c : this.getCollisionBoxes() )
|
||||
{
|
||||
l.add( new IndexedCuboid6( 0, c ) );
|
||||
}
|
||||
@@ -693,7 +693,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMask
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConnectionMask( int side )
|
||||
public int getConnectionMask( final int side )
|
||||
{
|
||||
return CONNECTION_MASK;
|
||||
}
|
||||
|
||||
@@ -55,21 +55,21 @@ public class FMPEvent
|
||||
private final ThreadLocal<Object> placing = new ThreadLocal<Object>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void ServerFMPEvent( FMPPacketEvent event )
|
||||
public void ServerFMPEvent( final FMPPacketEvent event )
|
||||
{
|
||||
FMPEvent.place( event.sender, event.sender.worldObj );
|
||||
}
|
||||
|
||||
public static boolean place( EntityPlayer player, World world )
|
||||
public static boolean place( final EntityPlayer player, final World world )
|
||||
{
|
||||
MovingObjectPosition hit = RayTracer.reTrace( world, player );
|
||||
final MovingObjectPosition hit = RayTracer.reTrace( world, player );
|
||||
if( hit == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockCoord pos = new BlockCoord( hit.blockX, hit.blockY, hit.blockZ ).offset( hit.sideHit );
|
||||
ItemStack held = player.getHeldItem();
|
||||
final BlockCoord pos = new BlockCoord( hit.blockX, hit.blockY, hit.blockZ ).offset( hit.sideHit );
|
||||
final ItemStack held = player.getHeldItem();
|
||||
|
||||
if( held == null )
|
||||
{
|
||||
@@ -80,7 +80,7 @@ public class FMPEvent
|
||||
TMultiPart part = null;
|
||||
if( held.getItem() instanceof AEBaseItemBlock )
|
||||
{
|
||||
AEBaseItemBlock ib = (AEBaseItemBlock) held.getItem();
|
||||
final AEBaseItemBlock ib = (AEBaseItemBlock) held.getItem();
|
||||
blk = Block.getBlockFromItem( ib );
|
||||
part = PartRegistry.getPartByBlock( blk, hit.sideHit );
|
||||
}
|
||||
@@ -93,8 +93,8 @@ public class FMPEvent
|
||||
if( world.isRemote && !player.isSneaking() )// attempt to use block activated like normal and tell the server
|
||||
// the right stuff
|
||||
{
|
||||
Vector3 f = new Vector3( hit.hitVec ).add( -hit.blockX, -hit.blockY, -hit.blockZ );
|
||||
Block block = world.getBlock( hit.blockX, hit.blockY, hit.blockZ );
|
||||
final Vector3 f = new Vector3( hit.hitVec ).add( -hit.blockX, -hit.blockY, -hit.blockZ );
|
||||
final Block block = world.getBlock( hit.blockX, hit.blockY, hit.blockZ );
|
||||
if( block != null && !ignoreActivate( block ) && block.onBlockActivated( world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float) f.x, (float) f.y, (float) f.z ) )
|
||||
{
|
||||
player.swingItem();
|
||||
@@ -103,7 +103,7 @@ public class FMPEvent
|
||||
}
|
||||
}
|
||||
|
||||
TileMultipart tile = TileMultipart.getOrConvertTile( world, pos );
|
||||
final TileMultipart tile = TileMultipart.getOrConvertTile( world, pos );
|
||||
if( tile == null || !tile.canAddPart( part ) )
|
||||
{
|
||||
return false;
|
||||
@@ -134,7 +134,7 @@ public class FMPEvent
|
||||
/**
|
||||
* Because vanilla is weird.
|
||||
*/
|
||||
private static boolean ignoreActivate( Block block )
|
||||
private static boolean ignoreActivate( final Block block )
|
||||
{
|
||||
if( block instanceof BlockFence )
|
||||
{
|
||||
@@ -144,7 +144,7 @@ public class FMPEvent
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerInteract( PlayerInteractEvent event )
|
||||
public void playerInteract( final PlayerInteractEvent event )
|
||||
{
|
||||
if( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote )
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ public class FMPPlacementHelper implements IPartHost
|
||||
private TileMultipart myMP;
|
||||
private CableBusPart myPart;
|
||||
|
||||
public FMPPlacementHelper( TileMultipart mp )
|
||||
public FMPPlacementHelper( final TileMultipart mp )
|
||||
{
|
||||
this.myMP = mp;
|
||||
}
|
||||
@@ -69,11 +69,11 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddPart( ItemStack part, ForgeDirection side )
|
||||
public boolean canAddPart( final ItemStack part, final ForgeDirection side )
|
||||
{
|
||||
CableBusPart myPart = this.getPart();
|
||||
final CableBusPart myPart = this.getPart();
|
||||
|
||||
boolean returnValue = this.hasPart && myPart.canAddPart( part, side );
|
||||
final boolean returnValue = this.hasPart && myPart.canAddPart( part, side );
|
||||
|
||||
this.removePart();
|
||||
|
||||
@@ -82,10 +82,10 @@ public class FMPPlacementHelper implements IPartHost
|
||||
|
||||
private CableBusPart getPart()
|
||||
{
|
||||
scala.collection.Iterator<TMultiPart> i = this.myMP.partList().iterator();
|
||||
final scala.collection.Iterator<TMultiPart> i = this.myMP.partList().iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
TMultiPart p = i.next();
|
||||
final TMultiPart p = i.next();
|
||||
if( p instanceof CableBusPart )
|
||||
{
|
||||
this.myPart = (CableBusPart) p;
|
||||
@@ -97,7 +97,7 @@ public class FMPPlacementHelper implements IPartHost
|
||||
this.myPart = (CableBusPart) PartRegistry.CableBusPart.construct( 0 );
|
||||
}
|
||||
|
||||
BlockCoord loc = new BlockCoord( this.myMP.xCoord, this.myMP.yCoord, this.myMP.zCoord );
|
||||
final BlockCoord loc = new BlockCoord( this.myMP.xCoord, this.myMP.yCoord, this.myMP.zCoord );
|
||||
|
||||
if( this.myMP.canAddPart( this.myPart ) && Platform.isServer() )
|
||||
{
|
||||
@@ -112,10 +112,10 @@ public class FMPPlacementHelper implements IPartHost
|
||||
{
|
||||
if( this.myPart.isEmpty() )
|
||||
{
|
||||
scala.collection.Iterator<TMultiPart> i = this.myMP.partList().iterator();
|
||||
final scala.collection.Iterator<TMultiPart> i = this.myMP.partList().iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
TMultiPart p = i.next();
|
||||
final TMultiPart p = i.next();
|
||||
if( p == this.myPart )
|
||||
{
|
||||
this.myMP = this.myMP.remPart( this.myPart );
|
||||
@@ -128,11 +128,11 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner )
|
||||
public ForgeDirection addPart( final ItemStack is, final ForgeDirection side, final EntityPlayer owner )
|
||||
{
|
||||
CableBusPart myPart = this.getPart();
|
||||
final CableBusPart myPart = this.getPart();
|
||||
|
||||
ForgeDirection returnValue = this.hasPart ? myPart.addPart( is, side, owner ) : null;
|
||||
final ForgeDirection returnValue = this.hasPart ? myPart.addPart( is, side, owner ) : null;
|
||||
|
||||
this.removePart();
|
||||
|
||||
@@ -140,7 +140,7 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getPart( ForgeDirection side )
|
||||
public IPart getPart( final ForgeDirection side )
|
||||
{
|
||||
if( this.myPart == null )
|
||||
{
|
||||
@@ -150,7 +150,7 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePart( ForgeDirection side, boolean suppressUpdate )
|
||||
public void removePart( final ForgeDirection side, final boolean suppressUpdate )
|
||||
{
|
||||
if( this.myPart == null )
|
||||
{
|
||||
@@ -206,11 +206,11 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocked( ForgeDirection side )
|
||||
public boolean isBlocked( final ForgeDirection side )
|
||||
{
|
||||
this.getPart();
|
||||
|
||||
boolean returnValue = this.myPart.isBlocked( side );
|
||||
final boolean returnValue = this.myPart.isBlocked( side );
|
||||
|
||||
this.removePart();
|
||||
|
||||
@@ -218,7 +218,7 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart( Vec3 pos )
|
||||
public SelectedPart selectPart( final Vec3 pos )
|
||||
{
|
||||
if( this.myPart == null )
|
||||
{
|
||||
@@ -248,7 +248,7 @@ public class FMPPlacementHelper implements IPartHost
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRedstone( ForgeDirection side )
|
||||
public boolean hasRedstone( final ForgeDirection side )
|
||||
{
|
||||
if( this.myPart == null )
|
||||
{
|
||||
@@ -311,13 +311,13 @@ public class FMPPlacementHelper implements IPartHost
|
||||
{
|
||||
|
||||
@Override
|
||||
public IFacadePart getFacade( int x )
|
||||
public IFacadePart getFacade( final int x )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacade( int x, IFacadePart facade )
|
||||
public void setFacade( final int x, final IFacadePart facade )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public enum PartRegistry
|
||||
private final Class<? extends AEBaseBlock> blk;
|
||||
private final Class<? extends TMultiPart> part;
|
||||
|
||||
PartRegistry( String name, Class<? extends AEBaseBlock> blk, Class<? extends TMultiPart> part )
|
||||
PartRegistry( final String name, final Class<? extends AEBaseBlock> blk, final Class<? extends TMultiPart> part )
|
||||
{
|
||||
this.name = name;
|
||||
this.blk = blk;
|
||||
@@ -48,9 +48,9 @@ public enum PartRegistry
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static TMultiPart getPartByBlock( Block block, int meta )
|
||||
public static TMultiPart getPartByBlock( final Block block, final int meta )
|
||||
{
|
||||
for( PartRegistry pr : values() )
|
||||
for( final PartRegistry pr : values() )
|
||||
{
|
||||
if( pr.blk.isInstance( block ) )
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public enum PartRegistry
|
||||
return null;
|
||||
}
|
||||
|
||||
public TMultiPart construct( int meta )
|
||||
public TMultiPart construct( final int meta )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -73,7 +73,7 @@ public enum PartRegistry
|
||||
return this.part.getConstructor( int.class ).newInstance( meta );
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
throw new IllegalStateException( t );
|
||||
}
|
||||
|
||||
@@ -43,12 +43,12 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi
|
||||
this( ForgeDirection.DOWN.ordinal() );
|
||||
}
|
||||
|
||||
public QuartzTorchPart( int meta )
|
||||
public QuartzTorchPart( final int meta )
|
||||
{
|
||||
super( meta );
|
||||
}
|
||||
|
||||
public static McBlockPart placement( World world, BlockCoord pos, int side )
|
||||
public static McBlockPart placement( final World world, BlockCoord pos, final int side )
|
||||
{
|
||||
pos = pos.copy().offset( side );
|
||||
if( !world.isSideSolid( pos.x, pos.y, pos.z, ForgeDirection.getOrientation( side ) ) )
|
||||
@@ -77,23 +77,23 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi
|
||||
return this.getBounds( this.meta );
|
||||
}
|
||||
|
||||
public Cuboid6 getBounds( int meta )
|
||||
public Cuboid6 getBounds( final int meta )
|
||||
{
|
||||
ForgeDirection up = ForgeDirection.getOrientation( meta );
|
||||
double xOff = -0.3 * up.offsetX;
|
||||
double yOff = -0.3 * up.offsetY;
|
||||
double zOff = -0.3 * up.offsetZ;
|
||||
final ForgeDirection up = ForgeDirection.getOrientation( meta );
|
||||
final double xOff = -0.3 * up.offsetX;
|
||||
final double yOff = -0.3 * up.offsetY;
|
||||
final double zOff = -0.3 * up.offsetZ;
|
||||
return new Cuboid6( xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int sideForMeta( int meta )
|
||||
public int sideForMeta( final int meta )
|
||||
{
|
||||
return ForgeDirection.getOrientation( meta ).getOpposite().ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick( Random r )
|
||||
public void randomDisplayTick( final Random r )
|
||||
{
|
||||
this.getBlock().randomDisplayTick( this.world(), this.x(), this.y(), this.z(), r );
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class QuartzTorchPart extends McSidedMetaPart implements IRandomDisplayTi
|
||||
@Override
|
||||
public Block getBlock()
|
||||
{
|
||||
for( Block torchBlock : AEApi.instance().definitions().blocks().quartzTorch().maybeBlock().asSet() )
|
||||
for( final Block torchBlock : AEApi.instance().definitions().blocks().quartzTorch().maybeBlock().asSet() )
|
||||
{
|
||||
return torchBlock;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user