final variables and parameters
This commit is contained in:
@@ -83,7 +83,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
protected IPartHost host = null;
|
||||
protected AEPartLocation side = null;
|
||||
|
||||
public AEBasePart( ItemStack is )
|
||||
public AEBasePart( final ItemStack is )
|
||||
{
|
||||
Preconditions.checkNotNull( is );
|
||||
|
||||
@@ -98,13 +98,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode( AEPartLocation dir )
|
||||
public IGridNode getGridNode( final AEPartLocation dir )
|
||||
{
|
||||
return this.proxy.getNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
{
|
||||
if( this.is.stackSize > 0 )
|
||||
{
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add( this.is.copy() );
|
||||
this.host.removePart( this.side, false );
|
||||
Platform.spawnDrops( this.tile.getWorld(), this.tile.getPos(), items );
|
||||
@@ -132,20 +132,20 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades( Upgrades u )
|
||||
public int getInstalledUpgrades( final Upgrades u )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( 1, 1, 1, 15, 15, 15 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -197,7 +197,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( 1, 1, 1, 15, 15, 15 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -209,24 +209,24 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
return this.is.hasDisplayName();
|
||||
}
|
||||
|
||||
public void addEntityCrashInfo( CrashReportCategory crashreportcategory )
|
||||
public void addEntityCrashInfo( final CrashReportCategory crashreportcategory )
|
||||
{
|
||||
crashreportcategory.addCrashSection( "Part Side", this.side );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack( PartItemStack type )
|
||||
public ItemStack getItemStack( final PartItemStack type )
|
||||
{
|
||||
if( type == PartItemStack.Network )
|
||||
{
|
||||
ItemStack copy = this.is.copy();
|
||||
final ItemStack copy = this.is.copy();
|
||||
copy.setTagCompound( null );
|
||||
return copy;
|
||||
}
|
||||
@@ -252,13 +252,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
this.proxy.readFromNBT( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
this.proxy.writeToNBT( data );
|
||||
}
|
||||
@@ -276,13 +276,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision( Entity entity )
|
||||
public void onEntityCollision( final Entity entity )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -312,7 +312,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
this.side = side;
|
||||
this.tile = tile;
|
||||
@@ -327,7 +327,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( World world, BlockPos pos, Random r )
|
||||
public void randomDisplayTick( final World world, final BlockPos pos, final Random r )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -339,7 +339,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -351,7 +351,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder( EntityLivingBase entity )
|
||||
public boolean isLadder( final EntityLivingBase entity )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -363,7 +363,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -374,11 +374,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
* @param from source of settings
|
||||
* @param compound compound of source
|
||||
*/
|
||||
public void uploadSettings( SettingsFrom from, NBTTagCompound compound )
|
||||
public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound )
|
||||
{
|
||||
if( compound != null )
|
||||
{
|
||||
IConfigManager cm = this.getConfigManager();
|
||||
final IConfigManager cm = this.getConfigManager();
|
||||
if( cm != null )
|
||||
{
|
||||
cm.readFromNBT( compound );
|
||||
@@ -387,15 +387,15 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
if( this instanceof IPriorityHost )
|
||||
{
|
||||
IPriorityHost pHost = (IPriorityHost) this;
|
||||
final IPriorityHost pHost = (IPriorityHost) this;
|
||||
pHost.setPriority( compound.getInteger( "priority" ) );
|
||||
}
|
||||
|
||||
IInventory inv = this.getInventoryByName( "config" );
|
||||
final IInventory inv = this.getInventoryByName( "config" );
|
||||
if( inv instanceof AppEngInternalAEInventory )
|
||||
{
|
||||
AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv;
|
||||
AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() );
|
||||
final AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv;
|
||||
final AppEngInternalAEInventory tmp = new AppEngInternalAEInventory( null, target.getSizeInventory() );
|
||||
tmp.readFromNBT( compound, "config" );
|
||||
for( int x = 0; x < tmp.getSizeInventory(); x++ )
|
||||
{
|
||||
@@ -411,11 +411,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
*
|
||||
* @return compound of source
|
||||
*/
|
||||
public NBTTagCompound downloadSettings( SettingsFrom from )
|
||||
public NBTTagCompound downloadSettings( final SettingsFrom from )
|
||||
{
|
||||
NBTTagCompound output = new NBTTagCompound();
|
||||
final NBTTagCompound output = new NBTTagCompound();
|
||||
|
||||
IConfigManager cm = this.getConfigManager();
|
||||
final IConfigManager cm = this.getConfigManager();
|
||||
if( cm != null )
|
||||
{
|
||||
cm.writeToNBT( output );
|
||||
@@ -423,11 +423,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
if( this instanceof IPriorityHost )
|
||||
{
|
||||
IPriorityHost pHost = (IPriorityHost) this;
|
||||
final IPriorityHost pHost = (IPriorityHost) this;
|
||||
output.setInteger( "priority", pHost.getPriority() );
|
||||
}
|
||||
|
||||
IInventory inv = this.getInventoryByName( "config" );
|
||||
final IInventory inv = this.getInventoryByName( "config" );
|
||||
if( inv instanceof AppEngInternalAEInventory )
|
||||
{
|
||||
( (AppEngInternalAEInventory) inv ).writeToNBT( output, "config" );
|
||||
@@ -441,13 +441,13 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean useMemoryCard( EntityPlayer player )
|
||||
private boolean useMemoryCard( final EntityPlayer player )
|
||||
{
|
||||
ItemStack memCardIS = player.inventory.getCurrentItem();
|
||||
final ItemStack memCardIS = player.inventory.getCurrentItem();
|
||||
|
||||
if( memCardIS != null && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard )
|
||||
{
|
||||
IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem();
|
||||
final IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem();
|
||||
|
||||
ItemStack is = this.getItemStack( PartItemStack.Network );
|
||||
|
||||
@@ -455,17 +455,17 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
if( definitions.parts().iface().isSameAs( is ) )
|
||||
{
|
||||
for( ItemStack iface : definitions.blocks().iface().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack iface : definitions.blocks().iface().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
is = iface;
|
||||
}
|
||||
}
|
||||
|
||||
String name = is.getUnlocalizedName();
|
||||
final String name = is.getUnlocalizedName();
|
||||
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||
final NBTTagCompound data = this.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||
if( data != null )
|
||||
{
|
||||
memoryCard.setMemoryCardContents( memCardIS, name, data );
|
||||
@@ -474,8 +474,8 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
else
|
||||
{
|
||||
String storedName = memoryCard.getSettingsName( memCardIS );
|
||||
NBTTagCompound data = memoryCard.getData( memCardIS );
|
||||
final String storedName = memoryCard.getSettingsName( memCardIS );
|
||||
final NBTTagCompound data = memoryCard.getData( memCardIS );
|
||||
if( name.equals( storedName ) )
|
||||
{
|
||||
this.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||
@@ -492,7 +492,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean onActivate( EntityPlayer player, Vec3 pos )
|
||||
public final boolean onActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( this.useMemoryCard( player ) )
|
||||
{
|
||||
@@ -503,7 +503,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean onShiftActivate( EntityPlayer player, Vec3 pos )
|
||||
public final boolean onShiftActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( this.useMemoryCard( player ) )
|
||||
{
|
||||
@@ -513,24 +513,24 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
return this.onPartShiftActivate( player, pos );
|
||||
}
|
||||
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
this.proxy.setOwner( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBePlacedOn( BusSupport what )
|
||||
public boolean canBePlacedOn( final BusSupport what )
|
||||
{
|
||||
return what == BusSupport.CABLE;
|
||||
}
|
||||
@@ -543,7 +543,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture(ModelGenerator renderer)
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class BusCollisionHelper implements IPartCollisionHelper
|
||||
private final Entity entity;
|
||||
private final boolean isVisual;
|
||||
|
||||
public BusCollisionHelper( List<AxisAlignedBB> boxes, EnumFacing x, EnumFacing y, EnumFacing z, Entity e, boolean visual )
|
||||
public BusCollisionHelper( final List<AxisAlignedBB> boxes, final EnumFacing x, final EnumFacing y, final EnumFacing z, final Entity e, final boolean visual )
|
||||
{
|
||||
this.boxes = boxes;
|
||||
this.x = x;
|
||||
@@ -50,7 +50,7 @@ public class BusCollisionHelper implements IPartCollisionHelper
|
||||
this.isVisual = visual;
|
||||
}
|
||||
|
||||
public BusCollisionHelper( List<AxisAlignedBB> boxes, AEPartLocation s, Entity e, boolean visual )
|
||||
public BusCollisionHelper( final List<AxisAlignedBB> boxes, final AEPartLocation s, final Entity e, final boolean visual )
|
||||
{
|
||||
this.boxes = boxes;
|
||||
this.entity = e;
|
||||
|
||||
@@ -82,18 +82,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
public boolean requiresDynamicRender = false;
|
||||
boolean inWorld = false;
|
||||
|
||||
public CableBusContainer( IPartHost host )
|
||||
public CableBusContainer( final IPartHost host )
|
||||
{
|
||||
this.tcb = host;
|
||||
}
|
||||
|
||||
public static boolean isLoading()
|
||||
{
|
||||
Boolean is = IS_LOADING.get();
|
||||
final Boolean is = IS_LOADING.get();
|
||||
return is != null && is;
|
||||
}
|
||||
|
||||
public void setHost( IPartHost host )
|
||||
public void setHost( final IPartHost host )
|
||||
{
|
||||
this.tcb.clearContainer();
|
||||
this.tcb = host;
|
||||
@@ -101,7 +101,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
public void rotateLeft()
|
||||
{
|
||||
IPart[] newSides = new IPart[6];
|
||||
final IPart[] newSides = new IPart[6];
|
||||
|
||||
newSides[AEPartLocation.UP.ordinal()] = this.getSide( AEPartLocation.UP );
|
||||
newSides[AEPartLocation.DOWN.ordinal()] = this.getSide( AEPartLocation.DOWN );
|
||||
@@ -111,7 +111,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
newSides[AEPartLocation.WEST.ordinal()] = this.getSide( AEPartLocation.SOUTH );
|
||||
newSides[AEPartLocation.NORTH.ordinal()] = this.getSide( AEPartLocation.WEST );
|
||||
|
||||
for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
this.setSide( dir, newSides[dir.ordinal()] );
|
||||
}
|
||||
@@ -126,7 +126,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddPart( ItemStack is, AEPartLocation side )
|
||||
public boolean canAddPart( ItemStack is, final AEPartLocation side )
|
||||
{
|
||||
if( PartPlacement.isFacade( is, side ) != null )
|
||||
{
|
||||
@@ -135,18 +135,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( is.getItem() instanceof IPartItem )
|
||||
{
|
||||
IPartItem bi = (IPartItem) is.getItem();
|
||||
final IPartItem bi = (IPartItem) is.getItem();
|
||||
|
||||
is = is.copy();
|
||||
is.stackSize = 1;
|
||||
|
||||
IPart bp = bi.createPartFromItemStack( is );
|
||||
final IPart bp = bi.createPartFromItemStack( is );
|
||||
if( bp != null )
|
||||
{
|
||||
if( bp instanceof IPartCable )
|
||||
{
|
||||
boolean canPlace = true;
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
if( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ( (IPartCable) bp ).supportsBuses() ) )
|
||||
{
|
||||
@@ -163,7 +163,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
else if( !( bp instanceof IPartCable ) && side != AEPartLocation.INTERNAL )
|
||||
{
|
||||
IPart cable = this.getPart( AEPartLocation.INTERNAL );
|
||||
final IPart cable = this.getPart( AEPartLocation.INTERNAL );
|
||||
if( cable != null && !bp.canBePlacedOn( ( (IPartCable) cable ).supportsBuses() ) )
|
||||
{
|
||||
return false;
|
||||
@@ -177,22 +177,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public AEPartLocation addPart( ItemStack is, AEPartLocation side, EntityPlayer player )
|
||||
public AEPartLocation addPart( ItemStack is, final AEPartLocation side, final EntityPlayer player )
|
||||
{
|
||||
if( this.canAddPart( is, side ) )
|
||||
{
|
||||
if( is.getItem() instanceof IPartItem )
|
||||
{
|
||||
IPartItem bi = (IPartItem) is.getItem();
|
||||
final IPartItem bi = (IPartItem) is.getItem();
|
||||
|
||||
is = is.copy();
|
||||
is.stackSize = 1;
|
||||
|
||||
IPart bp = bi.createPartFromItemStack( is );
|
||||
final IPart bp = bi.createPartFromItemStack( is );
|
||||
if( bp instanceof IPartCable )
|
||||
{
|
||||
boolean canPlace = true;
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
if( this.getPart( d ) != null && !this.getPart( d ).canBePlacedOn( ( (IPartCable) bp ).supportsBuses() ) )
|
||||
{
|
||||
@@ -223,22 +223,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
bp.addToWorld();
|
||||
}
|
||||
|
||||
IGridNode cn = this.getCenter().getGridNode();
|
||||
final IGridNode cn = this.getCenter().getGridNode();
|
||||
if( cn != null )
|
||||
{
|
||||
for( AEPartLocation ins : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation ins : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart sbp = this.getPart( ins );
|
||||
final IPart sbp = this.getPart( ins );
|
||||
if( sbp != null )
|
||||
{
|
||||
IGridNode sn = sbp.getGridNode();
|
||||
final IGridNode sn = sbp.getGridNode();
|
||||
if( sn != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
new GridConnection( cn, sn, AEPartLocation.INTERNAL );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
// ekk!
|
||||
|
||||
@@ -259,7 +259,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
else if( bp != null && !( bp instanceof IPartCable ) && side != AEPartLocation.INTERNAL )
|
||||
{
|
||||
IPart cable = this.getPart( AEPartLocation.INTERNAL );
|
||||
final IPart cable = this.getPart( AEPartLocation.INTERNAL );
|
||||
if( cable != null && !bp.canBePlacedOn( ( (IPartCable) cable ).supportsBuses() ) )
|
||||
{
|
||||
return null;
|
||||
@@ -280,8 +280,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( this.getCenter() != null )
|
||||
{
|
||||
IGridNode cn = this.getCenter().getGridNode();
|
||||
IGridNode sn = bp.getGridNode();
|
||||
final IGridNode cn = this.getCenter().getGridNode();
|
||||
final IGridNode sn = bp.getGridNode();
|
||||
|
||||
if( cn != null && sn != null )
|
||||
{
|
||||
@@ -289,7 +289,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
new GridConnection( cn, sn, AEPartLocation.INTERNAL );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
// ekk!
|
||||
|
||||
@@ -313,7 +313,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getPart( AEPartLocation partLocation )
|
||||
public IPart getPart( final AEPartLocation partLocation )
|
||||
{
|
||||
if( partLocation == AEPartLocation.INTERNAL )
|
||||
{
|
||||
@@ -323,13 +323,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getPart( EnumFacing side )
|
||||
public IPart getPart( final EnumFacing side )
|
||||
{
|
||||
return this.getSide( AEPartLocation.fromFacing( side ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePart( AEPartLocation side, boolean suppressUpdate )
|
||||
public void removePart( final AEPartLocation side, final boolean suppressUpdate )
|
||||
{
|
||||
if( side == AEPartLocation.INTERNAL )
|
||||
{
|
||||
@@ -381,7 +381,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
if( this.getCenter() != null )
|
||||
{
|
||||
IPartCable c = this.getCenter();
|
||||
final IPartCable c = this.getCenter();
|
||||
return c.getCableColor();
|
||||
}
|
||||
return AEColor.Transparent;
|
||||
@@ -394,22 +394,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocked( EnumFacing side )
|
||||
public boolean isBlocked( final EnumFacing side )
|
||||
{
|
||||
return this.tcb.isBlocked( side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart( Vec3 pos )
|
||||
public SelectedPart selectPart( final Vec3 pos )
|
||||
{
|
||||
for( AEPartLocation side : AEPartLocation.values() )
|
||||
for( final AEPartLocation side : AEPartLocation.values() )
|
||||
{
|
||||
IPart p = this.getPart( side );
|
||||
final IPart p = this.getPart( side );
|
||||
if( p != null )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||
final List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||
|
||||
IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
p.getBoxes( bch );
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
{
|
||||
@@ -424,15 +424,15 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades )
|
||||
{
|
||||
IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
|
||||
final IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IFacadePart p = fc.getFacade( side );
|
||||
final IFacadePart p = fc.getFacade( side );
|
||||
if( p != null )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||
final List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||
|
||||
IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
final IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
|
||||
p.getBoxes( bch, null );
|
||||
for( AxisAlignedBB bb : boxes )
|
||||
{
|
||||
@@ -460,12 +460,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
if( this.getCenter() == null )
|
||||
{
|
||||
List<ItemStack> facades = new LinkedList<ItemStack>();
|
||||
final List<ItemStack> facades = new LinkedList<ItemStack>();
|
||||
|
||||
IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
final IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IFacadePart fp = fc.getFacade( d );
|
||||
final IFacadePart fp = fc.getFacade( d );
|
||||
if( fp != null )
|
||||
{
|
||||
facades.add( fp.getItemStack() );
|
||||
@@ -475,7 +475,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( !facades.isEmpty() )
|
||||
{
|
||||
TileEntity te = this.tcb.getTile();
|
||||
final TileEntity te = this.tcb.getTile();
|
||||
Platform.spawnDrops( te.getWorld(), te.getPos(), facades );
|
||||
}
|
||||
}
|
||||
@@ -484,7 +484,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRedstone( AEPartLocation side )
|
||||
public boolean hasRedstone( final AEPartLocation side )
|
||||
{
|
||||
if( this.hasRedstone == YesNo.UNDECIDED )
|
||||
{
|
||||
@@ -497,10 +497,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
@Override
|
||||
public boolean isEmpty()
|
||||
{
|
||||
IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
final IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
return false;
|
||||
@@ -508,7 +508,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( s != AEPartLocation.INTERNAL )
|
||||
{
|
||||
IFacadePart fp = fc.getFacade( s );
|
||||
final IFacadePart fp = fc.getFacade( s );
|
||||
if( fp != null )
|
||||
{
|
||||
return false;
|
||||
@@ -544,16 +544,16 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
private void updateRedstone()
|
||||
{
|
||||
TileEntity te = this.getTile();
|
||||
final TileEntity te = this.getTile();
|
||||
this.hasRedstone = te.getWorld().isBlockIndirectlyGettingPowered( te.getPos() ) != 0 ? YesNo.YES : YesNo.NO;
|
||||
}
|
||||
|
||||
public void updateDynamicRender()
|
||||
{
|
||||
this.requiresDynamicRender = false;
|
||||
for( AEPartLocation s : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation s : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart p = this.getPart( s );
|
||||
final IPart p = this.getPart( s );
|
||||
if( p != null )
|
||||
{
|
||||
this.requiresDynamicRender = this.requiresDynamicRender || p.requireDynamicRender();
|
||||
@@ -568,9 +568,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
if( this.getCenter() != null )
|
||||
{
|
||||
EnumSet<EnumFacing> sides = EnumSet.allOf( EnumFacing.class );
|
||||
final EnumSet<EnumFacing> sides = EnumSet.allOf( EnumFacing.class );
|
||||
|
||||
for( EnumFacing s : EnumFacing.VALUES )
|
||||
for( final EnumFacing s : EnumFacing.VALUES )
|
||||
{
|
||||
if( this.getPart( s ) != null || this.isBlocked( s ) )
|
||||
{
|
||||
@@ -579,7 +579,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
this.getCenter().setValidSides( sides );
|
||||
IGridNode n = this.getCenter().getGridNode();
|
||||
final IGridNode n = this.getCenter().getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
n.updateState();
|
||||
@@ -597,13 +597,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
this.inWorld = true;
|
||||
IS_LOADING.set( true );
|
||||
|
||||
TileEntity te = this.getTile();
|
||||
final TileEntity te = this.getTile();
|
||||
|
||||
// start with the center, then install the side parts into the grid.
|
||||
for( int x = 6; x >= 0; x-- )
|
||||
{
|
||||
AEPartLocation s = AEPartLocation.fromOrdinal( x );
|
||||
IPart part = this.getPart( s );
|
||||
final AEPartLocation s = AEPartLocation.fromOrdinal( x );
|
||||
final IPart part = this.getPart( s );
|
||||
|
||||
if( part != null )
|
||||
{
|
||||
@@ -612,24 +612,24 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( s != AEPartLocation.INTERNAL )
|
||||
{
|
||||
IGridNode sn = part.getGridNode();
|
||||
final IGridNode sn = part.getGridNode();
|
||||
if( sn != null )
|
||||
{
|
||||
// this is a really stupid if statement, why was this
|
||||
// here?
|
||||
// if ( !sn.getConnections().iterator().hasNext() )
|
||||
|
||||
IPart center = this.getPart( AEPartLocation.INTERNAL );
|
||||
final IPart center = this.getPart( AEPartLocation.INTERNAL );
|
||||
if( center != null )
|
||||
{
|
||||
IGridNode cn = center.getGridNode();
|
||||
final IGridNode cn = center.getGridNode();
|
||||
if( cn != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
AEApi.instance().createGridConnection( cn, sn );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
// ekk
|
||||
}
|
||||
@@ -654,9 +654,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
this.inWorld = false;
|
||||
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
part.removeFromWorld();
|
||||
@@ -667,12 +667,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode( AEPartLocation side )
|
||||
public IGridNode getGridNode( final AEPartLocation side )
|
||||
{
|
||||
IPart part = this.getPart( side );
|
||||
final IPart part = this.getPart( side );
|
||||
if( part != null )
|
||||
{
|
||||
IGridNode n = part.getExternalFacingNode();
|
||||
final IGridNode n = part.getExternalFacingNode();
|
||||
if( n != null )
|
||||
{
|
||||
return n;
|
||||
@@ -688,12 +688,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
final IPart part = this.getPart( dir );
|
||||
if( part instanceof IGridHost )
|
||||
{
|
||||
AECableType t = ( (IGridHost) part ).getCableConnectionType( dir );
|
||||
final AECableType t = ( (IGridHost) part ).getCableConnectionType( dir );
|
||||
if( t != null && t != AECableType.NONE )
|
||||
{
|
||||
return t;
|
||||
@@ -702,7 +702,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( this.getCenter() != null )
|
||||
{
|
||||
IPartCable c = this.getCenter();
|
||||
final IPartCable c = this.getCenter();
|
||||
return c.getCableConnectionType();
|
||||
}
|
||||
return AECableType.NONE;
|
||||
@@ -711,9 +711,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
@Override
|
||||
public void securityBreak()
|
||||
{
|
||||
for( AEPartLocation d : AEPartLocation.values() )
|
||||
for( final AEPartLocation d : AEPartLocation.values() )
|
||||
{
|
||||
IPart p = this.getPart( d );
|
||||
final IPart p = this.getPart( d );
|
||||
if( p instanceof IGridHost )
|
||||
{
|
||||
( (IGridHost) p ).securityBreak();
|
||||
@@ -721,16 +721,16 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
}
|
||||
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( boolean ignoreConnections, boolean includeFacades, Entity e, boolean visual )
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final boolean ignoreConnections, final boolean includeFacades, final Entity e, final boolean visual )
|
||||
{
|
||||
List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||
final List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();
|
||||
|
||||
IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
final IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual );
|
||||
final IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual );
|
||||
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
if( ignoreConnections && part instanceof IPartCable )
|
||||
@@ -747,7 +747,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
if( includeFacades && s != null && s != AEPartLocation.INTERNAL )
|
||||
{
|
||||
IFacadePart fp = fc.getFacade( s );
|
||||
final IFacadePart fp = fc.getFacade( s );
|
||||
if( fp != null )
|
||||
{
|
||||
fp.getBoxes( bch, e );
|
||||
@@ -760,25 +760,25 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingStrongPower( EnumFacing side )
|
||||
public int isProvidingStrongPower( final EnumFacing side )
|
||||
{
|
||||
IPart part = this.getPart( side );
|
||||
final IPart part = this.getPart( side );
|
||||
return part != null ? part.isProvidingStrongPower() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower( EnumFacing side )
|
||||
public int isProvidingWeakPower( final EnumFacing side )
|
||||
{
|
||||
IPart part = this.getPart( side );
|
||||
final IPart part = this.getPart( side );
|
||||
return part != null ? part.isProvidingWeakPower() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone( EnumSet<EnumFacing> enumSet )
|
||||
public boolean canConnectRedstone( final EnumSet<EnumFacing> enumSet )
|
||||
{
|
||||
for( EnumFacing dir : enumSet )
|
||||
for( final EnumFacing dir : enumSet )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
final IPart part = this.getPart( dir );
|
||||
if( part != null && part.canConnectRedstone() )
|
||||
{
|
||||
return true;
|
||||
@@ -788,11 +788,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision( Entity entity )
|
||||
public void onEntityCollision( final Entity entity )
|
||||
{
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
part.onEntityCollision( entity );
|
||||
@@ -801,9 +801,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate( EntityPlayer player, Vec3 pos )
|
||||
public boolean activate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
SelectedPart p = this.selectPart( pos );
|
||||
final SelectedPart p = this.selectPart( pos );
|
||||
if( p != null && p.part != null )
|
||||
{
|
||||
return p.part.onActivate( player, pos );
|
||||
@@ -816,9 +816,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
this.hasRedstone = YesNo.UNDECIDED;
|
||||
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
part.onNeighborChanged();
|
||||
@@ -827,7 +827,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSolidOnSide( EnumFacing side )
|
||||
public boolean isSolidOnSide( final EnumFacing side )
|
||||
{
|
||||
if( side == null )
|
||||
{
|
||||
@@ -835,23 +835,23 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
// facades are solid..
|
||||
IFacadePart fp = this.getFacadeContainer().getFacade( AEPartLocation.fromFacing( side ) );
|
||||
final IFacadePart fp = this.getFacadeContainer().getFacade( AEPartLocation.fromFacing( side ) );
|
||||
if( fp != null )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// buses can be too.
|
||||
IPart part = this.getPart( side );
|
||||
final IPart part = this.getPart( side );
|
||||
return part != null && part.isSolid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder( EntityLivingBase entity )
|
||||
public boolean isLadder( final EntityLivingBase entity )
|
||||
{
|
||||
for( AEPartLocation side : AEPartLocation.values() )
|
||||
for( final AEPartLocation side : AEPartLocation.values() )
|
||||
{
|
||||
IPart p = this.getPart( side );
|
||||
final IPart p = this.getPart( side );
|
||||
if( p != null )
|
||||
{
|
||||
if( p.isLadder( entity ) )
|
||||
@@ -865,11 +865,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick( World world, BlockPos pos, Random r )
|
||||
public void randomDisplayTick( final World world, final BlockPos pos, final Random r )
|
||||
{
|
||||
for( AEPartLocation side : AEPartLocation.values() )
|
||||
for( final AEPartLocation side : AEPartLocation.values() )
|
||||
{
|
||||
IPart p = this.getPart( side );
|
||||
final IPart p = this.getPart( side );
|
||||
if( p != null )
|
||||
{
|
||||
p.randomDisplayTick( world, pos, r );
|
||||
@@ -882,9 +882,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
int light = 0;
|
||||
|
||||
for( AEPartLocation d : AEPartLocation.values() )
|
||||
for( final AEPartLocation d : AEPartLocation.values() )
|
||||
{
|
||||
IPart p = this.getPart( d );
|
||||
final IPart p = this.getPart( d );
|
||||
if( p != null )
|
||||
{
|
||||
light = Math.max( p.getLightLevel(), light );
|
||||
@@ -906,17 +906,17 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDynamic( double x, double y, double z )
|
||||
public void renderDynamic( final double x, final double y, final double z )
|
||||
{
|
||||
CableRenderHelper.getInstance().renderDynamic( this, x, y, z );
|
||||
}
|
||||
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
int sides = 0;
|
||||
for( int x = 0; x < 7; x++ )
|
||||
{
|
||||
IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) );
|
||||
final IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) );
|
||||
if( p != null )
|
||||
{
|
||||
sides |= ( 1 << x );
|
||||
@@ -927,10 +927,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
for( int x = 0; x < 7; x++ )
|
||||
{
|
||||
IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) );
|
||||
final IPart p = this.getPart( AEPartLocation.fromOrdinal( x ) );
|
||||
if( p != null )
|
||||
{
|
||||
ItemStack is = p.getItemStack( PartItemStack.Network );
|
||||
final ItemStack is = p.getItemStack( PartItemStack.Network );
|
||||
|
||||
data.writeShort( Item.getIdFromItem( is.getItem() ) );
|
||||
data.writeShort( is.getItemDamage() );
|
||||
@@ -942,9 +942,9 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
this.getFacadeContainer().writeToStream( data );
|
||||
}
|
||||
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
byte sides = data.readByte();
|
||||
final byte sides = data.readByte();
|
||||
|
||||
boolean updateBlock = false;
|
||||
|
||||
@@ -955,12 +955,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
IPart p = this.getPart( side );
|
||||
|
||||
short itemID = data.readShort();
|
||||
short dmgValue = data.readShort();
|
||||
final short itemID = data.readShort();
|
||||
final short dmgValue = data.readShort();
|
||||
|
||||
Item myItem = Item.getItemById( itemID );
|
||||
final Item myItem = Item.getItemById( itemID );
|
||||
|
||||
ItemStack current = p != null ? p.getItemStack( PartItemStack.Network ) : null;
|
||||
final ItemStack current = p != null ? p.getItemStack( PartItemStack.Network ) : null;
|
||||
if( current != null && current.getItem() == myItem && current.getItemDamage() == dmgValue )
|
||||
{
|
||||
if( p.readFromStream( data ) )
|
||||
@@ -997,22 +997,22 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
return updateBlock;
|
||||
}
|
||||
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
data.setInteger( "hasRedstone", this.hasRedstone.ordinal() );
|
||||
|
||||
IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
final IFacadeContainer fc = this.getFacadeContainer();
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
fc.writeToNBT( data );
|
||||
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
NBTTagCompound def = new NBTTagCompound();
|
||||
final NBTTagCompound def = new NBTTagCompound();
|
||||
part.getItemStack( PartItemStack.World ).writeToNBT( def );
|
||||
|
||||
NBTTagCompound extra = new NBTTagCompound();
|
||||
final NBTTagCompound extra = new NBTTagCompound();
|
||||
part.writeToNBT( extra );
|
||||
|
||||
data.setTag( "def:" + this.getSide( part ).ordinal(), def );
|
||||
@@ -1021,7 +1021,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
}
|
||||
|
||||
AEPartLocation getSide( IPart part )
|
||||
AEPartLocation getSide( final IPart part )
|
||||
{
|
||||
if( this.getCenter() == part )
|
||||
{
|
||||
@@ -1029,7 +1029,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
else
|
||||
{
|
||||
for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
if( this.getSide( side ) == part )
|
||||
{
|
||||
@@ -1041,7 +1041,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
throw new IllegalStateException( "Uhh Bad Part (" + part + ") on Side." );
|
||||
}
|
||||
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
if( data.hasKey( "hasRedstone" ) )
|
||||
{
|
||||
@@ -1052,18 +1052,18 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
AEPartLocation side = AEPartLocation.fromOrdinal( x );
|
||||
|
||||
NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() );
|
||||
NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() );
|
||||
final NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() );
|
||||
final NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() );
|
||||
if( def != null && extra != null )
|
||||
{
|
||||
IPart p = this.getPart( side );
|
||||
ItemStack iss = ItemStack.loadItemStackFromNBT( def );
|
||||
final ItemStack iss = ItemStack.loadItemStackFromNBT( def );
|
||||
if( iss == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack current = p == null ? null : p.getItemStack( PartItemStack.World );
|
||||
final ItemStack current = p == null ? null : p.getItemStack( PartItemStack.World );
|
||||
|
||||
if( Platform.isSameItemType( iss, current ) )
|
||||
{
|
||||
@@ -1093,11 +1093,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
this.getFacadeContainer().readFromNBT( data );
|
||||
}
|
||||
|
||||
public List getDrops( List drops )
|
||||
public List getDrops( final List drops )
|
||||
{
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
drops.add( part.getItemStack( PartItemStack.Break ) );
|
||||
@@ -1106,7 +1106,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
if( s != AEPartLocation.INTERNAL )
|
||||
{
|
||||
IFacadePart fp = this.getFacadeContainer().getFacade( s );
|
||||
final IFacadePart fp = this.getFacadeContainer().getFacade( s );
|
||||
if( fp != null )
|
||||
{
|
||||
drops.add( fp.getItemStack() );
|
||||
@@ -1117,11 +1117,11 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
return drops;
|
||||
}
|
||||
|
||||
public List getNoDrops( List drops )
|
||||
public List getNoDrops( final List drops )
|
||||
{
|
||||
for( AEPartLocation s : AEPartLocation.values() )
|
||||
for( final AEPartLocation s : AEPartLocation.values() )
|
||||
{
|
||||
IPart part = this.getPart( s );
|
||||
final IPart part = this.getPart( s );
|
||||
if( part != null )
|
||||
{
|
||||
part.getDrops( drops, false );
|
||||
@@ -1132,12 +1132,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock( EnumFacing side, AEColor colour, EntityPlayer who )
|
||||
public boolean recolourBlock( final EnumFacing side, final AEColor colour, final EntityPlayer who )
|
||||
{
|
||||
IPart cable = this.getPart( AEPartLocation.INTERNAL );
|
||||
final IPart cable = this.getPart( AEPartLocation.INTERNAL );
|
||||
if( cable != null )
|
||||
{
|
||||
IPartCable pc = (IPartCable) cable;
|
||||
final IPartCable pc = (IPartCable) cable;
|
||||
return pc.changeColor( colour, who );
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -42,14 +42,14 @@ public class CableBusStorage
|
||||
return this.center;
|
||||
}
|
||||
|
||||
protected void setCenter( IPartCable center )
|
||||
protected void setCenter( final IPartCable center )
|
||||
{
|
||||
this.center = center;
|
||||
}
|
||||
|
||||
protected IPart getSide( AEPartLocation side )
|
||||
protected IPart getSide( final AEPartLocation side )
|
||||
{
|
||||
int x = side.ordinal();
|
||||
final int x = side.ordinal();
|
||||
if( this.sides != null && this.sides.length > x )
|
||||
{
|
||||
return this.sides[x];
|
||||
@@ -58,9 +58,9 @@ public class CableBusStorage
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void setSide( AEPartLocation side, IPart part )
|
||||
protected void setSide( final AEPartLocation side, final IPart part )
|
||||
{
|
||||
int x = side.ordinal();
|
||||
final int x = side.ordinal();
|
||||
|
||||
if( this.sides != null && this.sides.length > x && part == null )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public class CableBusStorage
|
||||
}
|
||||
}
|
||||
|
||||
private <T> T[] shrink( T[] in, boolean parts )
|
||||
private <T> T[] shrink( final T[] in, final boolean parts )
|
||||
{
|
||||
int newSize = -1;
|
||||
for( int x = 0; x < in.length; x++ )
|
||||
@@ -96,22 +96,22 @@ public class CableBusStorage
|
||||
return in;
|
||||
}
|
||||
|
||||
T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] );
|
||||
final T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] );
|
||||
System.arraycopy( in, 0, newArray, 0, newSize );
|
||||
|
||||
return newArray;
|
||||
}
|
||||
|
||||
private <T> T[] grow( T[] in, int newValue, boolean parts )
|
||||
private <T> T[] grow( final T[] in, final int newValue, final boolean parts )
|
||||
{
|
||||
if( in != null && in.length > newValue )
|
||||
{
|
||||
return in;
|
||||
}
|
||||
|
||||
int newSize = newValue + 1;
|
||||
final int newSize = newValue + 1;
|
||||
|
||||
T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] );
|
||||
final T[] newArray = (T[]) ( parts ? new IPart[newSize] : new IFacadePart[newSize] );
|
||||
if( in != null )
|
||||
{
|
||||
System.arraycopy( in, 0, newArray, 0, in.length );
|
||||
@@ -120,7 +120,7 @@ public class CableBusStorage
|
||||
return newArray;
|
||||
}
|
||||
|
||||
public IFacadePart getFacade( int x )
|
||||
public IFacadePart getFacade( final int x )
|
||||
{
|
||||
if( this.facades != null && this.facades.length > x )
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public class CableBusStorage
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setFacade( int x, @Nullable IFacadePart facade )
|
||||
public void setFacade( final int x, @Nullable final IFacadePart facade )
|
||||
{
|
||||
if( this.facades != null && this.facades.length > x && facade == null )
|
||||
{
|
||||
|
||||
@@ -37,31 +37,31 @@ public class NullCableBusContainer implements ICableBusContainer
|
||||
{
|
||||
|
||||
@Override
|
||||
public int isProvidingStrongPower( EnumFacing opposite )
|
||||
public int isProvidingStrongPower( final EnumFacing opposite )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower( EnumFacing opposite )
|
||||
public int isProvidingWeakPower( final EnumFacing opposite )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectRedstone( EnumSet<EnumFacing> of )
|
||||
public boolean canConnectRedstone( final EnumSet<EnumFacing> of )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision( Entity e )
|
||||
public void onEntityCollision( final Entity e )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate( EntityPlayer player, Vec3 vecFromPool )
|
||||
public boolean activate( final EntityPlayer player, final Vec3 vecFromPool )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class NullCableBusContainer implements ICableBusContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSolidOnSide( EnumFacing side )
|
||||
public boolean isSolidOnSide( final EnumFacing side )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -85,25 +85,25 @@ public class NullCableBusContainer implements ICableBusContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart( Vec3 v3 )
|
||||
public SelectedPart selectPart( final Vec3 v3 )
|
||||
{
|
||||
return new SelectedPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock( EnumFacing side, AEColor colour, EntityPlayer who )
|
||||
public boolean recolourBlock( final EnumFacing side, final AEColor colour, final EntityPlayer who )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder( EntityLivingBase entity )
|
||||
public boolean isLadder( final EntityLivingBase entity )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick( World world, BlockPos pos, Random r )
|
||||
public void randomDisplayTick( final World world, final BlockPos pos, final Random r )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -49,26 +49,26 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
|
||||
protected int clientFlags = 0; // sent as byte.
|
||||
|
||||
public PartBasicState( ItemStack is )
|
||||
public PartBasicState( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void chanRender( MENetworkChannelsChanged c )
|
||||
public void chanRender( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderLights( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderLights( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
this.setColors( renderer, ( this.clientFlags & ( POWERED_FLAG | CHANNEL_FLAG ) ) == ( POWERED_FLAG | CHANNEL_FLAG ), ( this.clientFlags & POWERED_FLAG ) == POWERED_FLAG );
|
||||
rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.EAST, renderer );
|
||||
@@ -77,17 +77,17 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
rh.renderFace( pos, CableBusTextures.PartMonitorSidesStatusLights.getIcon(), EnumFacing.DOWN, renderer );
|
||||
}
|
||||
|
||||
public void setColors( ModelGenerator renderer, boolean hasChan, boolean hasPower )
|
||||
public void setColors( final ModelGenerator renderer, final boolean hasChan, final boolean hasPower )
|
||||
{
|
||||
if( hasChan )
|
||||
{
|
||||
int l = 14;
|
||||
final int l = 14;
|
||||
renderer.setBrightness( l << 20 | l << 4 );
|
||||
renderer.setColorOpaque_I( this.getColor().blackVariant );
|
||||
}
|
||||
else if( hasPower )
|
||||
{
|
||||
int l = 9;
|
||||
final int l = 9;
|
||||
renderer.setBrightness( l << 20 | l << 4 );
|
||||
renderer.setColorOpaque_I( this.getColor().whiteVariant );
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.writeToStream( data );
|
||||
|
||||
@@ -119,7 +119,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
|
||||
this.clientFlags = this.populateFlags( this.clientFlags );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// meh
|
||||
}
|
||||
@@ -127,17 +127,17 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
data.writeByte( (byte) this.clientFlags );
|
||||
}
|
||||
|
||||
protected int populateFlags( int cf )
|
||||
protected int populateFlags( final int cf )
|
||||
{
|
||||
return cf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
boolean eh = super.readFromStream( data );
|
||||
final boolean eh = super.readFromStream( data );
|
||||
|
||||
int old = this.clientFlags;
|
||||
final int old = this.clientFlags;
|
||||
this.clientFlags = data.readByte();
|
||||
|
||||
return eh || old != this.clientFlags;
|
||||
@@ -145,7 +145,7 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return CableBusTextures.PartTransitionPlaneBack.getIcon().getAtlas();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class PartPlacement
|
||||
private final ThreadLocal<Object> placing = new ThreadLocal<Object>();
|
||||
private boolean wasCanceled = false;
|
||||
|
||||
public static boolean place( ItemStack held, BlockPos pos, EnumFacing side, EntityPlayer player, World world, PlaceType pass, int depth )
|
||||
public static boolean place( final ItemStack held, final BlockPos pos, EnumFacing side, final EntityPlayer player, final World world, PlaceType pass, final int depth )
|
||||
{
|
||||
if( depth > 3 )
|
||||
{
|
||||
@@ -86,8 +86,8 @@ public class PartPlacement
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = world.getBlockState( pos ).getBlock();
|
||||
TileEntity tile = world.getTileEntity( pos );
|
||||
final Block block = world.getBlockState( pos ).getBlock();
|
||||
final TileEntity tile = world.getTileEntity( pos );
|
||||
IPartHost host = null;
|
||||
|
||||
if( tile instanceof IPartHost )
|
||||
@@ -99,12 +99,12 @@ public class PartPlacement
|
||||
{
|
||||
if( !world.isRemote )
|
||||
{
|
||||
LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
if( mop != null )
|
||||
{
|
||||
List<ItemStack> is = new LinkedList<ItemStack>();
|
||||
SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) );
|
||||
final List<ItemStack> is = new LinkedList<ItemStack>();
|
||||
final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) );
|
||||
|
||||
if( sp.part != null )
|
||||
{
|
||||
@@ -152,7 +152,7 @@ public class PartPlacement
|
||||
|
||||
if( held != null )
|
||||
{
|
||||
IFacadePart fp = isFacade( held, AEPartLocation.fromFacing( side ) );
|
||||
final IFacadePart fp = isFacade( held, AEPartLocation.fromFacing( side ) );
|
||||
if( fp != null )
|
||||
{
|
||||
if( host != null )
|
||||
@@ -210,15 +210,15 @@ public class PartPlacement
|
||||
|
||||
// if ( held == null )
|
||||
{
|
||||
Block block = world.getBlockState( pos ).getBlock();
|
||||
final Block block = world.getBlockState( pos ).getBlock();
|
||||
if( host != null && player.isSneaking() && block != null )
|
||||
{
|
||||
LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
if( mop != null )
|
||||
{
|
||||
mop.hitVec = mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() );
|
||||
SelectedPart sPart = selectPart( player, host, mop.hitVec );
|
||||
final SelectedPart sPart = selectPart( player, host, mop.hitVec );
|
||||
if( sPart != null && sPart.part != null )
|
||||
{
|
||||
if( sPart.part.onShiftActivate( player, mop.hitVec ) )
|
||||
@@ -246,7 +246,7 @@ public class PartPlacement
|
||||
{
|
||||
EnumFacing offset = null;
|
||||
|
||||
Block blkID = world.getBlockState( pos ).getBlock();
|
||||
final Block blkID = world.getBlockState( pos ).getBlock();
|
||||
if( blkID != null && !blkID.isReplaceable( world, pos ) )
|
||||
{
|
||||
offset = side;
|
||||
@@ -324,7 +324,7 @@ public class PartPlacement
|
||||
{
|
||||
te_pos = pos.offset( side );
|
||||
|
||||
Block blkID = world.getBlockState( te_pos ).getBlock();
|
||||
final Block blkID = world.getBlockState( te_pos ).getBlock();
|
||||
tile = world.getTileEntity( te_pos );
|
||||
|
||||
if( tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
@@ -342,12 +342,12 @@ public class PartPlacement
|
||||
|
||||
if( !world.isRemote )
|
||||
{
|
||||
Block block = world.getBlockState( pos ).getBlock();
|
||||
LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
final Block block = world.getBlockState( pos ).getBlock();
|
||||
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
if( mop != null )
|
||||
{
|
||||
SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) );
|
||||
final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) );
|
||||
|
||||
if( sp.part != null )
|
||||
{
|
||||
@@ -358,16 +358,16 @@ public class PartPlacement
|
||||
}
|
||||
}
|
||||
|
||||
DimensionalCoord dc = host.getLocation();
|
||||
final DimensionalCoord dc = host.getLocation();
|
||||
if( !Platform.hasPermissions( dc, player ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AEPartLocation mySide = host.addPart( held, AEPartLocation.fromFacing( side ), player );
|
||||
final AEPartLocation mySide = host.addPart( held, AEPartLocation.fromFacing( side ), player );
|
||||
if( mySide != null )
|
||||
{
|
||||
for( Block multiPartBlock : multiPart.maybeBlock().asSet() )
|
||||
for( final Block multiPartBlock : multiPart.maybeBlock().asSet() )
|
||||
{
|
||||
final SoundType ss = multiPartBlock.stepSound;
|
||||
|
||||
@@ -393,7 +393,7 @@ public class PartPlacement
|
||||
return true;
|
||||
}
|
||||
|
||||
private static float getEyeOffset( EntityPlayer p )
|
||||
private static float getEyeOffset( final EntityPlayer p )
|
||||
{
|
||||
if( p.worldObj.isRemote )
|
||||
{
|
||||
@@ -403,16 +403,16 @@ public class PartPlacement
|
||||
return eyeHeight;
|
||||
}
|
||||
|
||||
private static SelectedPart selectPart( EntityPlayer player, IPartHost host, Vec3 pos )
|
||||
private static SelectedPart selectPart( final EntityPlayer player, final IPartHost host, final Vec3 pos )
|
||||
{
|
||||
CommonHelper.proxy.updateRenderMode( player );
|
||||
SelectedPart sp = host.selectPart( pos );
|
||||
final SelectedPart sp = host.selectPart( pos );
|
||||
CommonHelper.proxy.updateRenderMode( null );
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
public static IFacadePart isFacade( ItemStack held, AEPartLocation side )
|
||||
public static IFacadePart isFacade( final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
if( held.getItem() instanceof IFacadeItem )
|
||||
{
|
||||
@@ -421,7 +421,7 @@ public class PartPlacement
|
||||
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
if( bc.isFacade( held ) )
|
||||
{
|
||||
return bc.createFacadePart( held, side );
|
||||
@@ -432,28 +432,28 @@ public class PartPlacement
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerInteract( TickEvent.ClientTickEvent event )
|
||||
public void playerInteract( final TickEvent.ClientTickEvent event )
|
||||
{
|
||||
this.wasCanceled = false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerInteract( PlayerInteractEvent event )
|
||||
public void playerInteract( final PlayerInteractEvent event )
|
||||
{
|
||||
if( event.action == Action.RIGHT_CLICK_AIR && event.entityPlayer.worldObj.isRemote )
|
||||
{
|
||||
// re-check to see if this event was already channeled, cause these two events are really stupid...
|
||||
MovingObjectPosition mop = Platform.rayTrace( event.entityPlayer, true, false );
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
final MovingObjectPosition mop = Platform.rayTrace( event.entityPlayer, true, false );
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
float f = 1.0F;
|
||||
double d0 = mc.playerController.getBlockReachDistance();
|
||||
Vec3 vec3 = mc.getRenderViewEntity().getPositionEyes( f );
|
||||
final float f = 1.0F;
|
||||
final double d0 = mc.playerController.getBlockReachDistance();
|
||||
final Vec3 vec3 = mc.getRenderViewEntity().getPositionEyes( f );
|
||||
|
||||
if( mop != null && mop.hitVec.distanceTo( vec3 ) < d0 )
|
||||
{
|
||||
World w = event.entity.worldObj;
|
||||
TileEntity te = w.getTileEntity( mop.getBlockPos() );
|
||||
final World w = event.entity.worldObj;
|
||||
final TileEntity te = w.getTileEntity( mop.getBlockPos() );
|
||||
if( te instanceof IPartHost && this.wasCanceled )
|
||||
{
|
||||
event.setCanceled( true );
|
||||
@@ -461,7 +461,7 @@ public class PartPlacement
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemStack held = event.entityPlayer.getHeldItem();
|
||||
final ItemStack held = event.entityPlayer.getHeldItem();
|
||||
final IItems items = AEApi.instance().definitions().items();
|
||||
|
||||
boolean supportedItem = items.memoryCard().isSameAs( held );
|
||||
@@ -482,7 +482,7 @@ public class PartPlacement
|
||||
|
||||
this.placing.set( event );
|
||||
|
||||
ItemStack held = event.entityPlayer.getHeldItem();
|
||||
final ItemStack held = event.entityPlayer.getHeldItem();
|
||||
if( place( held, event.pos, event.face, event.entityPlayer, event.entityPlayer.worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) )
|
||||
{
|
||||
event.setCanceled( true );
|
||||
|
||||
@@ -13,18 +13,18 @@ public class BlockUpgradeInventory extends UpgradeInventory
|
||||
{
|
||||
private final Block block;
|
||||
|
||||
public BlockUpgradeInventory( Block block, IAEAppEngInventory parent, int s )
|
||||
public BlockUpgradeInventory( final Block block, final IAEAppEngInventory parent, final int s )
|
||||
{
|
||||
super( parent, s );
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxInstalled( Upgrades upgrades )
|
||||
public int getMaxInstalled( final Upgrades upgrades )
|
||||
{
|
||||
int max = 0;
|
||||
|
||||
for( ItemStack is : upgrades.getSupported().keySet() )
|
||||
for( final ItemStack is : upgrades.getSupported().keySet() )
|
||||
{
|
||||
final Item encodedItem = is.getItem();
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory
|
||||
{
|
||||
private final IItemDefinition definition;
|
||||
|
||||
public DefinitionUpgradeInventory( IItemDefinition definition, IAEAppEngInventory parent, int s )
|
||||
public DefinitionUpgradeInventory( final IItemDefinition definition, final IAEAppEngInventory parent, final int s )
|
||||
{
|
||||
super( parent, s );
|
||||
|
||||
@@ -19,11 +19,11 @@ public final class DefinitionUpgradeInventory extends UpgradeInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxInstalled( Upgrades upgrades )
|
||||
public int getMaxInstalled( final Upgrades upgrades )
|
||||
{
|
||||
int max = 0;
|
||||
|
||||
for( ItemStack stack : upgrades.getSupported().keySet() )
|
||||
for( final ItemStack stack : upgrades.getSupported().keySet() )
|
||||
{
|
||||
if( this.definition.isSameAs( stack ) )
|
||||
{
|
||||
|
||||
@@ -82,20 +82,20 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
private boolean isAccepting = true;
|
||||
private boolean breaking = false;
|
||||
|
||||
public PartAnnihilationPlane( ItemStack is )
|
||||
public PartAnnihilationPlane( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation call( World world ) throws Exception
|
||||
public TickRateModulation call( final World world ) throws Exception
|
||||
{
|
||||
this.breaking = false;
|
||||
return this.breakBlock( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
int minX = 1;
|
||||
int minY = 1;
|
||||
@@ -107,7 +107,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
{
|
||||
final TileEntity te = host.getTile();
|
||||
|
||||
BlockPos pos = te.getPos();
|
||||
final BlockPos pos = te.getPos();
|
||||
|
||||
final EnumFacing e = bch.getWorldX();
|
||||
final EnumFacing u = bch.getWorldY();
|
||||
@@ -139,7 +139,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, renderer.getIcon( is ), SIDE_ICON, SIDE_ICON );
|
||||
|
||||
@@ -152,12 +152,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
this.renderStaticWithIcon( pos, rh, renderer, ACTIVE_ICON );
|
||||
}
|
||||
|
||||
protected void renderStaticWithIcon( BlockPos opos, IPartRenderHelper rh, ModelGenerator renderer, IAESprite activeIcon )
|
||||
protected void renderStaticWithIcon( final BlockPos opos, final IPartRenderHelper rh, final ModelGenerator renderer, final IAESprite activeIcon )
|
||||
{
|
||||
int minX = 1;
|
||||
|
||||
@@ -165,7 +165,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
final EnumFacing u = rh.getWorldY();
|
||||
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
BlockPos pos = te.getPos();
|
||||
final BlockPos pos = te.getPos();
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
{
|
||||
@@ -220,12 +220,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision( Entity entity )
|
||||
public void onEntityCollision( final Entity entity )
|
||||
{
|
||||
if( this.isAccepting && entity instanceof EntityItem && !entity.isDead && Platform.isServer() && this.proxy.isActive() )
|
||||
{
|
||||
boolean capture = false;
|
||||
BlockPos pos = tile.getPos();
|
||||
final BlockPos pos = tile.getPos();
|
||||
|
||||
switch( this.side )
|
||||
{
|
||||
@@ -296,7 +296,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
*
|
||||
* @param entityItem {@link EntityItem} to store
|
||||
*/
|
||||
private boolean storeEntityItem( EntityItem entityItem )
|
||||
private boolean storeEntityItem( final EntityItem entityItem )
|
||||
{
|
||||
if( !entityItem.isDead )
|
||||
{
|
||||
@@ -314,7 +314,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
* @param item {@link ItemStack} to store
|
||||
* @return the leftover items, which could not be stored inside the network
|
||||
*/
|
||||
private IAEItemStack storeItemStack( ItemStack item )
|
||||
private IAEItemStack storeItemStack( final ItemStack item )
|
||||
{
|
||||
final IAEItemStack itemToStore = AEItemStack.create( item );
|
||||
try
|
||||
@@ -344,7 +344,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
* @param overflow the leftover {@link IAEItemStack}
|
||||
* @return true, if the entity was changed otherwise false.
|
||||
*/
|
||||
private boolean handleOverflow( EntityItem entityItem, IAEItemStack overflow )
|
||||
private boolean handleOverflow( final EntityItem entityItem, final IAEItemStack overflow )
|
||||
{
|
||||
if( overflow == null || overflow.getStackSize() == 0 )
|
||||
{
|
||||
@@ -366,7 +366,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
*
|
||||
* @param overflow the item to spawn
|
||||
*/
|
||||
private void spawnOverflow( IAEItemStack overflow )
|
||||
private void spawnOverflow( final IAEItemStack overflow )
|
||||
{
|
||||
if( overflow == null )
|
||||
{
|
||||
@@ -389,7 +389,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
w.spawnEntityInWorld( overflowEntity );
|
||||
}
|
||||
|
||||
protected boolean isAnnihilationPlane( TileEntity blockTileEntity, AEPartLocation side )
|
||||
protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final AEPartLocation side )
|
||||
{
|
||||
if( blockTileEntity instanceof IPartHost )
|
||||
{
|
||||
@@ -401,7 +401,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
@Override
|
||||
@MENetworkEventSubscribe
|
||||
public void chanRender( MENetworkChannelsChanged c )
|
||||
public void chanRender( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.onNeighborChanged();
|
||||
this.getHost().markForUpdate();
|
||||
@@ -409,13 +409,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
@Override
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.onNeighborChanged();
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
public TickRateModulation breakBlock( boolean modulate )
|
||||
public TickRateModulation breakBlock( final boolean modulate )
|
||||
{
|
||||
if( this.isAccepting && this.proxy.isActive() )
|
||||
{
|
||||
@@ -424,7 +424,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
final TileEntity te = this.getTile();
|
||||
final WorldServer w = (WorldServer) te.getWorld();
|
||||
|
||||
BlockPos pos = te.getPos().offset( side.getFacing() );
|
||||
final BlockPos pos = te.getPos().offset( side.getFacing() );
|
||||
|
||||
final IEnergyGrid energy = this.proxy.getEnergy();
|
||||
|
||||
@@ -464,13 +464,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.AnnihilationPlane.min, TickRates.AnnihilationPlane.max, false, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
if( this.breaking )
|
||||
{
|
||||
@@ -484,7 +484,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
/**
|
||||
* Checks if this plane can handle the block at the specific coordinates.
|
||||
*/
|
||||
protected boolean canHandleBlock( WorldServer w, BlockPos pos )
|
||||
protected boolean canHandleBlock( final WorldServer w, final BlockPos pos )
|
||||
{
|
||||
final Block block = w.getBlockState( pos ).getBlock();
|
||||
final Material material = block.getMaterial();
|
||||
@@ -495,7 +495,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
return !ignoreMaterials && !ignoreBlocks && !w.isAirBlock( pos ) && w.isBlockLoaded( pos ) && w.canMineBlockBody( Platform.getPlayer( w ), pos ) && hardness >= 0f;
|
||||
}
|
||||
|
||||
protected List<ItemStack> obtainBlockDrops( WorldServer w, BlockPos pos )
|
||||
protected List<ItemStack> obtainBlockDrops( final WorldServer w, final BlockPos pos )
|
||||
{
|
||||
final ItemStack[] out = Platform.getBlockDrops( w, pos );
|
||||
return Lists.newArrayList( out );
|
||||
@@ -504,7 +504,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
/**
|
||||
* Checks if this plane can handle the block at the specific coordinates.
|
||||
*/
|
||||
protected float calculateEnergyUsage( WorldServer w, BlockPos pos, List<ItemStack> items )
|
||||
protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
final Block block = w.getBlockState( pos ).getBlock();
|
||||
final float hardness = block.getBlockHardness( w, pos );
|
||||
@@ -527,7 +527,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
*
|
||||
* @return true, if the network can store at least a single item of all drops or no drops are reported
|
||||
*/
|
||||
protected boolean canStoreItemStacks( List<ItemStack> itemStacks )
|
||||
protected boolean canStoreItemStacks( final List<ItemStack> itemStacks )
|
||||
{
|
||||
boolean canStore = itemStacks.isEmpty();
|
||||
|
||||
@@ -554,7 +554,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
return canStore;
|
||||
}
|
||||
|
||||
protected void breakBlockAndStoreItems( WorldServer w, BlockPos pos, List<ItemStack> items )
|
||||
protected void breakBlockAndStoreItems( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
w.setBlockToAir( pos );
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
private int nextSlot = 0;
|
||||
|
||||
@Reflected
|
||||
public PartExportBus( ItemStack is )
|
||||
public PartExportBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -85,7 +85,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound extra )
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.craftingTracker.readFromNBT( extra );
|
||||
@@ -93,7 +93,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound extra )
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.craftingTracker.writeToNBT( extra );
|
||||
@@ -126,7 +126,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
|
||||
for( x = 0; x < this.availableSlots() && this.itemToSend > 0; x++ )
|
||||
{
|
||||
int slotToExport = this.getStartingSlot( schedulingMode, x );
|
||||
final int slotToExport = this.getStartingSlot( schedulingMode, x );
|
||||
|
||||
final IAEItemStack ais = this.config.getAEStackInSlot( slotToExport );
|
||||
|
||||
@@ -143,7 +143,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
|
||||
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
|
||||
{
|
||||
for( IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ) )
|
||||
for( final IAEItemStack o : ImmutableList.copyOf( inv.getStorageList().findFuzzy( ais, fzMode ) ) )
|
||||
{
|
||||
this.pushItemIntoTarget( destination, energy, inv, o );
|
||||
if( this.itemToSend <= 0 )
|
||||
@@ -170,7 +170,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
return TickRateModulation.SLEEP;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 4, 4, 12, 12, 12, 14 );
|
||||
bch.addBox( 5, 5, 14, 11, 11, 15 );
|
||||
@@ -196,7 +196,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
|
||||
@@ -212,7 +212,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
|
||||
@@ -240,7 +240,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
@@ -257,7 +257,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, this.isSleeping(), false );
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
return this.doBusWork();
|
||||
}
|
||||
@@ -281,7 +281,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode )
|
||||
public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode )
|
||||
{
|
||||
final InventoryAdaptor d = this.getHandler();
|
||||
|
||||
@@ -302,7 +302,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange( ICraftingLink link )
|
||||
public void jobStateChange( final ICraftingLink link )
|
||||
{
|
||||
this.craftingTracker.jobStateChange( link );
|
||||
}
|
||||
@@ -332,19 +332,19 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
return this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0;
|
||||
}
|
||||
|
||||
private void pushItemIntoTarget( InventoryAdaptor d, IEnergyGrid energy, IMEInventory<IAEItemStack> inv, IAEItemStack ais )
|
||||
private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory<IAEItemStack> inv, IAEItemStack ais )
|
||||
{
|
||||
final ItemStack is = ais.getItemStack();
|
||||
is.stackSize = (int) this.itemToSend;
|
||||
|
||||
final ItemStack o = d.simulateAdd( is );
|
||||
long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize;
|
||||
final long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize;
|
||||
|
||||
if( canFit > 0 )
|
||||
{
|
||||
ais = ais.copy();
|
||||
ais.setStackSize( canFit );
|
||||
IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc );
|
||||
final IAEItemStack itemsToAdd = Platform.poweredExtraction( energy, inv, ais, this.mySrc );
|
||||
|
||||
if( itemsToAdd != null )
|
||||
{
|
||||
@@ -364,7 +364,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
}
|
||||
|
||||
private int getStartingSlot( SchedulingMode schedulingMode, int x )
|
||||
private int getStartingSlot( final SchedulingMode schedulingMode, final int x )
|
||||
{
|
||||
if( schedulingMode == SchedulingMode.RANDOM )
|
||||
{
|
||||
@@ -379,7 +379,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
return x;
|
||||
}
|
||||
|
||||
private void updateSchedulingMode( SchedulingMode schedulingMode, int x )
|
||||
private void updateSchedulingMode( final SchedulingMode schedulingMode, final int x )
|
||||
{
|
||||
if( schedulingMode == SchedulingMode.ROUNDROBIN )
|
||||
{
|
||||
@@ -387,7 +387,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
}
|
||||
}
|
||||
|
||||
private TickRateModulation getFailedCraftingPenalty( int failedAttempts )
|
||||
private TickRateModulation getFailedCraftingPenalty( final int failedAttempts )
|
||||
{
|
||||
if( failedAttempts > 5 )
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
boolean wasActive = false;
|
||||
boolean blocked = false;
|
||||
|
||||
public PartFormationPlane( ItemStack is )
|
||||
public PartFormationPlane( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -107,12 +107,12 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
|
||||
this.myHandler.setPriority( this.priority );
|
||||
|
||||
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
|
||||
int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
|
||||
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
|
||||
for( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ )
|
||||
{
|
||||
IAEItemStack is = this.Config.getAEStackInSlot( x );
|
||||
final IAEItemStack is = this.Config.getAEStackInSlot( x );
|
||||
if( is != null )
|
||||
{
|
||||
priorityList.add( is );
|
||||
@@ -132,7 +132,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
{
|
||||
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -145,14 +145,14 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
this.updateHandler();
|
||||
this.host.markForSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
super.onChangeInventory( inv, slot, mc, removedStack, newStack );
|
||||
|
||||
@@ -169,7 +169,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.Config.readFromNBT( data, "config" );
|
||||
@@ -178,7 +178,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
this.Config.writeToNBT( data, "config" );
|
||||
@@ -186,7 +186,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "config" ) )
|
||||
{
|
||||
@@ -198,9 +198,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
@Override
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
boolean currentActive = this.proxy.isActive();
|
||||
final boolean currentActive = this.proxy.isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
@@ -210,9 +210,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void updateChannels( MENetworkChannelsChanged changedChannels )
|
||||
public void updateChannels( final MENetworkChannelsChanged changedChannels )
|
||||
{
|
||||
boolean currentActive = this.proxy.isActive();
|
||||
final boolean currentActive = this.proxy.isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
@@ -222,22 +222,22 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
int minX = 1;
|
||||
int minY = 1;
|
||||
int maxX = 15;
|
||||
int maxY = 15;
|
||||
|
||||
IPartHost host = this.getHost();
|
||||
final IPartHost host = this.getHost();
|
||||
if( host != null )
|
||||
{
|
||||
TileEntity te = host.getTile();
|
||||
final TileEntity te = host.getTile();
|
||||
|
||||
BlockPos pos = te.getPos();
|
||||
final BlockPos pos = te.getPos();
|
||||
|
||||
EnumFacing e = bch.getWorldX();
|
||||
EnumFacing u = bch.getWorldY();
|
||||
final EnumFacing e = bch.getWorldX();
|
||||
final EnumFacing u = bch.getWorldY();
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
{
|
||||
@@ -266,7 +266,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
@@ -279,15 +279,15 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos opos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos opos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
int minX = 1;
|
||||
|
||||
EnumFacing e = rh.getWorldX();
|
||||
EnumFacing u = rh.getWorldY();
|
||||
final EnumFacing e = rh.getWorldX();
|
||||
final EnumFacing u = rh.getWorldY();
|
||||
|
||||
TileEntity te = this.getHost().getTile();
|
||||
BlockPos pos = te.getPos();
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
final BlockPos pos = te.getPos();
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
{
|
||||
@@ -312,7 +312,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
maxY = 16;
|
||||
}
|
||||
|
||||
boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
|
||||
final boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
@@ -330,11 +330,11 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
TileEntity te = this.host.getTile();
|
||||
World w = te.getWorld();
|
||||
AEPartLocation side = this.side;
|
||||
final TileEntity te = this.host.getTile();
|
||||
final World w = te.getWorld();
|
||||
final AEPartLocation side = this.side;
|
||||
|
||||
BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
final BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
|
||||
this.blocked = !w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos );
|
||||
}
|
||||
@@ -346,7 +346,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
@@ -362,22 +362,22 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isTransitionPlane( TileEntity blockTileEntity, AEPartLocation side )
|
||||
private boolean isTransitionPlane( final TileEntity blockTileEntity, final AEPartLocation side )
|
||||
{
|
||||
if( blockTileEntity instanceof IPartHost )
|
||||
{
|
||||
IPart p = ( (IPartHost) blockTileEntity ).getPart( side );
|
||||
final IPart p = ( (IPartHost) blockTileEntity ).getPart( side );
|
||||
return p instanceof PartFormationPlane;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( StorageChannel channel )
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
if( this.proxy.isActive() && channel == StorageChannel.ITEMS )
|
||||
{
|
||||
List<IMEInventoryHandler> Handler = new ArrayList<IMEInventoryHandler>( 1 );
|
||||
final List<IMEInventoryHandler> Handler = new ArrayList<IMEInventoryHandler>( 1 );
|
||||
Handler.add( this.myHandler );
|
||||
return Handler;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority( int newValue )
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.priority = newValue;
|
||||
this.host.markForSave();
|
||||
@@ -399,38 +399,38 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkCell( int slot )
|
||||
public void blinkCell( final int slot )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems( IAEItemStack input, Actionable type, BaseActionSource src )
|
||||
public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src )
|
||||
{
|
||||
if( this.blocked || input == null || input.getStackSize() <= 0 )
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
YesNo placeBlock = (YesNo) this.getConfigManager().getSetting( Settings.PLACE_BLOCK );
|
||||
final YesNo placeBlock = (YesNo) this.getConfigManager().getSetting( Settings.PLACE_BLOCK );
|
||||
|
||||
ItemStack is = input.getItemStack();
|
||||
Item i = is.getItem();
|
||||
final ItemStack is = input.getItemStack();
|
||||
final Item i = is.getItem();
|
||||
|
||||
long maxStorage = Math.min( input.getStackSize(), is.getMaxStackSize() );
|
||||
boolean worked = false;
|
||||
|
||||
TileEntity te = this.host.getTile();
|
||||
World w = te.getWorld();
|
||||
AEPartLocation side = this.side;
|
||||
final TileEntity te = this.host.getTile();
|
||||
final World w = te.getWorld();
|
||||
final AEPartLocation side = this.side;
|
||||
|
||||
BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
final BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
|
||||
if( w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos ) )
|
||||
{
|
||||
if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i instanceof ItemReed ) )
|
||||
{
|
||||
EntityPlayer player = Platform.getPlayer( (WorldServer) w );
|
||||
final EntityPlayer player = Platform.getPlayer( (WorldServer) w );
|
||||
Platform.configurePlayer( player, side, this.tile );
|
||||
|
||||
// TODO: LIMIT FIREWORKS
|
||||
@@ -494,9 +494,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
else
|
||||
{
|
||||
worked = true;
|
||||
Chunk c = w.getChunkFromBlockCoords( tePos );
|
||||
final Chunk c = w.getChunkFromBlockCoords( tePos );
|
||||
|
||||
int sum = 0;
|
||||
final int sum = 0;
|
||||
|
||||
// TODO: LIMIT OTHER THIGNS!
|
||||
/*
|
||||
@@ -512,7 +512,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
{
|
||||
|
||||
is.stackSize = (int) maxStorage;
|
||||
EntityItem ei = new EntityItem( w, // w
|
||||
final EntityItem ei = new EntityItem( w, // w
|
||||
( ( side.xOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.xOffset * -0.3 + tePos.getX(), // spawn
|
||||
( ( side.yOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.yOffset * -0.3 + tePos.getY(), // spawn
|
||||
( ( side.zOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.zOffset * -0.3 + tePos.getZ(), // spawn
|
||||
@@ -555,7 +555,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
if( worked )
|
||||
{
|
||||
IAEItemStack out = input.copy();
|
||||
final IAEItemStack out = input.copy();
|
||||
out.decStackSize( maxStorage );
|
||||
if( out.getStackSize() == 0 )
|
||||
{
|
||||
@@ -568,13 +568,13 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems( IAEItemStack request, Actionable mode, BaseActionSource src )
|
||||
public IAEItemStack extractItems( final IAEItemStack request, final Actionable mode, final BaseActionSource src )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems( IItemList<IAEItemStack> out )
|
||||
public IItemList<IAEItemStack> getAvailableItems( final IItemList<IAEItemStack> out )
|
||||
{
|
||||
return out;
|
||||
}
|
||||
@@ -586,7 +586,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges( IMEInventory cellInventory )
|
||||
public void saveChanges( final IMEInventory cellInventory )
|
||||
{
|
||||
// nope!
|
||||
}
|
||||
|
||||
@@ -47,20 +47,20 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
|
||||
|
||||
private static final float SILK_TOUCH_FACTOR = 16;
|
||||
|
||||
public PartIdentityAnnihilationPlane( ItemStack is )
|
||||
public PartIdentityAnnihilationPlane( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
this.renderStaticWithIcon( pos, rh, renderer, ACTIVE_ICON );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isAnnihilationPlane( TileEntity blockTileEntity, AEPartLocation side )
|
||||
protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final AEPartLocation side )
|
||||
{
|
||||
if( blockTileEntity instanceof IPartHost )
|
||||
{
|
||||
@@ -71,7 +71,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float calculateEnergyUsage( WorldServer w, BlockPos pos, List<ItemStack> items )
|
||||
protected float calculateEnergyUsage( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
final float requiredEnergy = super.calculateEnergyUsage( w, pos, items );
|
||||
|
||||
@@ -79,7 +79,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ItemStack> obtainBlockDrops( WorldServer w, BlockPos pos )
|
||||
protected List<ItemStack> obtainBlockDrops( final WorldServer w, final BlockPos pos )
|
||||
{
|
||||
final FakePlayer fakePlayer = FakePlayerFactory.getMinecraft( w );
|
||||
final IBlockState state = w.getBlockState( pos );
|
||||
@@ -96,7 +96,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
|
||||
{
|
||||
meta = state.getBlock().getMetaFromState( state );
|
||||
}
|
||||
ItemStack itemstack = new ItemStack( item, 1, meta );
|
||||
final ItemStack itemstack = new ItemStack( item, 1, meta );
|
||||
out.add( itemstack );
|
||||
}
|
||||
return out;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
private boolean worked; // used in tickingRequest
|
||||
|
||||
@Reflected
|
||||
public PartImportBus( ItemStack is )
|
||||
public PartImportBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -75,7 +75,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsert( ItemStack stack )
|
||||
public boolean canInsert( final ItemStack stack )
|
||||
{
|
||||
if( stack == null || stack.getItem() == null )
|
||||
{
|
||||
@@ -91,7 +91,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 6, 6, 11, 10, 10, 13 );
|
||||
bch.addBox( 5, 5, 13, 11, 11, 14 );
|
||||
@@ -100,7 +100,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
|
||||
@@ -116,7 +116,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
|
||||
@@ -143,7 +143,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
@@ -160,13 +160,13 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, this.getHandler() == null, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
return this.doBusWork();
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :3
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
return this.worked ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
private boolean importStuff( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor<IAEItemStack> inv, IEnergySource energy, FuzzyMode fzMode )
|
||||
private boolean importStuff( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor<IAEItemStack> inv, final IEnergySource energy, final FuzzyMode fzMode )
|
||||
{
|
||||
final int toSend = this.calculateMaximumAmountToImport( myAdaptor, whatToImport, inv, fzMode );
|
||||
final ItemStack newItems;
|
||||
@@ -283,7 +283,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
return false;
|
||||
}
|
||||
|
||||
private int calculateMaximumAmountToImport( InventoryAdaptor myAdaptor, IAEItemStack whatToImport, IMEMonitor<IAEItemStack> inv, FuzzyMode fzMode )
|
||||
private int calculateMaximumAmountToImport( final InventoryAdaptor myAdaptor, final IAEItemStack whatToImport, final IMEMonitor<IAEItemStack> inv, final FuzzyMode fzMode )
|
||||
{
|
||||
final int toSend = Math.min( this.itemToSend, 64 );
|
||||
final ItemStack itemStackToImport;
|
||||
@@ -318,7 +318,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
return toSend;
|
||||
}
|
||||
|
||||
private IInventoryDestination configDestination( IMEMonitor<IAEItemStack> itemInventory )
|
||||
private IInventoryDestination configDestination( final IMEMonitor<IAEItemStack> itemInventory )
|
||||
{
|
||||
this.destination = itemInventory;
|
||||
return this;
|
||||
|
||||
@@ -102,7 +102,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
boolean status = false;
|
||||
|
||||
@Reflected
|
||||
public PartLevelEmitter( ItemStack is )
|
||||
public PartLevelEmitter( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -117,7 +117,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
return this.reportingValue;
|
||||
}
|
||||
|
||||
public void setReportingValue( long v )
|
||||
public void setReportingValue( final long v )
|
||||
{
|
||||
this.reportingValue = v;
|
||||
if( this.getConfigManager().getSetting( Settings.LEVEL_TYPE ) == LevelType.ENERGY_LEVEL )
|
||||
@@ -131,18 +131,18 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerChanged( MENetworkPowerStatusChange c )
|
||||
public void powerChanged( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.updateState();
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
boolean isOn = this.isLevelEmitterOn();
|
||||
final boolean isOn = this.isLevelEmitterOn();
|
||||
if( this.prevState != isOn )
|
||||
{
|
||||
this.host.markForUpdate();
|
||||
TileEntity te = this.host.getTile();
|
||||
final TileEntity te = this.host.getTile();
|
||||
this.prevState = isOn;
|
||||
Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos() );
|
||||
Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos().offset( side.getFacing() ) );
|
||||
@@ -167,7 +167,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
return this.proxy.getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -175,37 +175,37 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
return this.prevState;
|
||||
}
|
||||
|
||||
boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL;
|
||||
final boolean flipState = this.getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) == RedstoneMode.LOW_SIGNAL;
|
||||
return flipState ? this.reportingValue >= this.lastReportedValue + 1 : this.reportingValue < this.lastReportedValue + 1;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelChanged( MENetworkChannelsChanged c )
|
||||
public void channelChanged( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.updateState();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int populateFlags( int cf )
|
||||
protected int populateFlags( final int cf )
|
||||
{
|
||||
return cf | ( this.prevState ? FLAG_ON : 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return renderer.getIcon( is ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWatcher( ICraftingWatcher newWatcher )
|
||||
public void updateWatcher( final ICraftingWatcher newWatcher )
|
||||
{
|
||||
this.myCraftingWatcher = newWatcher;
|
||||
this.configureWatchers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChange( ICraftingGrid craftingGrid, IAEItemStack what )
|
||||
public void onRequestChange( final ICraftingGrid craftingGrid, final IAEItemStack what )
|
||||
{
|
||||
this.updateState();
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
// update the system...
|
||||
public void configureWatchers()
|
||||
{
|
||||
IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
|
||||
final IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
|
||||
|
||||
if( this.myWatcher != null )
|
||||
{
|
||||
@@ -234,7 +234,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
this.proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.proxy.getNode() ) );
|
||||
}
|
||||
catch( GridAccessException e1 )
|
||||
catch( final GridAccessException e1 )
|
||||
{
|
||||
// :/
|
||||
}
|
||||
@@ -265,7 +265,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
// no more item stuff..
|
||||
this.proxy.getStorage().getItemInventory().removeListener( this );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -291,20 +291,20 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// >.>
|
||||
}
|
||||
}
|
||||
|
||||
private void updateReportingValue( IMEMonitor<IAEItemStack> monitor )
|
||||
private void updateReportingValue( final IMEMonitor<IAEItemStack> monitor )
|
||||
{
|
||||
IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
|
||||
final IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
|
||||
|
||||
if( myStack == null )
|
||||
{
|
||||
this.lastReportedValue = 0;
|
||||
for( IAEItemStack st : monitor.getStorageList() )
|
||||
for( final IAEItemStack st : monitor.getStorageList() )
|
||||
{
|
||||
this.lastReportedValue += st.getStackSize();
|
||||
}
|
||||
@@ -312,16 +312,16 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
else if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
|
||||
{
|
||||
this.lastReportedValue = 0;
|
||||
FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
|
||||
Collection<IAEItemStack> fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode );
|
||||
for( IAEItemStack st : fuzzyList )
|
||||
final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
|
||||
final Collection<IAEItemStack> fuzzyList = monitor.getStorageList().findFuzzy( myStack, fzMode );
|
||||
for( final IAEItemStack st : fuzzyList )
|
||||
{
|
||||
this.lastReportedValue += st.getStackSize();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IAEItemStack r = monitor.getStorageList().findPrecise( myStack );
|
||||
final IAEItemStack r = monitor.getStorageList().findPrecise( myStack );
|
||||
if( r == null )
|
||||
{
|
||||
this.lastReportedValue = 0;
|
||||
@@ -336,14 +336,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWatcher( IStackWatcher newWatcher )
|
||||
public void updateWatcher( final IStackWatcher newWatcher )
|
||||
{
|
||||
this.myWatcher = newWatcher;
|
||||
this.configureWatchers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan )
|
||||
public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final BaseActionSource src, final StorageChannel chan )
|
||||
{
|
||||
if( chan == StorageChannel.ITEMS && fullStack.equals( this.config.getAEStackInSlot( 0 ) ) && this.getInstalledUpgrades( Upgrades.FUZZY ) == 0 )
|
||||
{
|
||||
@@ -353,34 +353,34 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWatcher( IEnergyWatcher newWatcher )
|
||||
public void updateWatcher( final IEnergyWatcher newWatcher )
|
||||
{
|
||||
this.myEnergyWatcher = newWatcher;
|
||||
this.configureWatchers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onThresholdPass( IEnergyGrid energyGrid )
|
||||
public void onThresholdPass( final IEnergyGrid energyGrid )
|
||||
{
|
||||
this.lastReportedValue = (long) energyGrid.getStoredPower();
|
||||
this.updateState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Object effectiveGrid )
|
||||
public boolean isValid( final Object effectiveGrid )
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.proxy.getGrid() == effectiveGrid;
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange( IBaseMonitor<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource actionSource )
|
||||
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource actionSource )
|
||||
{
|
||||
this.updateReportingValue( (IMEMonitor<IAEItemStack>) monitor );
|
||||
}
|
||||
@@ -392,37 +392,37 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// ;P
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.SMART;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 7, 7, 11, 9, 9, 16 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( renderer.getIcon( is ) );
|
||||
this.renderTorchAtAngle( 0, -0.5, 0, renderer );
|
||||
}
|
||||
|
||||
public void renderTorchAtAngle( double baseX, double baseY, double baseZ, ModelGenerator renderer )
|
||||
public void renderTorchAtAngle( double baseX, double baseY, double baseZ, final ModelGenerator renderer )
|
||||
{
|
||||
boolean isOn = this.isLevelEmitterOn();
|
||||
IAESprite offTexture = renderer.getIcon( is );
|
||||
IAESprite IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture );
|
||||
final boolean isOn = this.isLevelEmitterOn();
|
||||
final IAESprite offTexture = renderer.getIcon( is );
|
||||
final IAESprite IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture );
|
||||
//
|
||||
this.centerX = baseX + 0.5;
|
||||
this.centerY = baseY + 0.5;
|
||||
@@ -441,35 +441,35 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
* (double)TextureAtlasSprite.func_94214_a(9.0D); double d16 = (double)TextureAtlasSprite.func_94207_b(15.0D);
|
||||
*/
|
||||
|
||||
float var16 = IIcon.getMinU();
|
||||
float var17 = IIcon.getMaxU();
|
||||
float var18 = IIcon.getMinV();
|
||||
float var19 = IIcon.getMaxV();
|
||||
final float var16 = IIcon.getMinU();
|
||||
final float var17 = IIcon.getMaxU();
|
||||
final float var18 = IIcon.getMinV();
|
||||
final float var19 = IIcon.getMaxV();
|
||||
/*
|
||||
* float var16 = (float)var14 / 256.0F; float var17 = ((float)var14 + 15.99F) / 256.0F; float var18 =
|
||||
* (float)var15 / 256.0F; float var19 = ((float)var15 + 15.99F) / 256.0F;
|
||||
*/
|
||||
double var20b = offTexture.getInterpolatedU( 7.0D );
|
||||
double var24b = offTexture.getInterpolatedU( 9.0D );
|
||||
final double var20b = offTexture.getInterpolatedU( 7.0D );
|
||||
final double var24b = offTexture.getInterpolatedU( 9.0D );
|
||||
|
||||
double var20 = IIcon.getInterpolatedU( 7.0D );
|
||||
double var24 = IIcon.getInterpolatedU( 9.0D );
|
||||
double var22 = IIcon.getInterpolatedV( 6.0D + ( isOn ? 0 : 1.0D ) );
|
||||
double var26 = IIcon.getInterpolatedV( 8.0D + ( isOn ? 0 : 1.0D ) );
|
||||
double var28 = IIcon.getInterpolatedU( 7.0D );
|
||||
double var30 = IIcon.getInterpolatedV( 13.0D );
|
||||
double var32 = IIcon.getInterpolatedU( 9.0D );
|
||||
double var34 = IIcon.getInterpolatedV( 15.0D );
|
||||
final double var20 = IIcon.getInterpolatedU( 7.0D );
|
||||
final double var24 = IIcon.getInterpolatedU( 9.0D );
|
||||
final double var22 = IIcon.getInterpolatedV( 6.0D + ( isOn ? 0 : 1.0D ) );
|
||||
final double var26 = IIcon.getInterpolatedV( 8.0D + ( isOn ? 0 : 1.0D ) );
|
||||
final double var28 = IIcon.getInterpolatedU( 7.0D );
|
||||
final double var30 = IIcon.getInterpolatedV( 13.0D );
|
||||
final double var32 = IIcon.getInterpolatedU( 9.0D );
|
||||
final double var34 = IIcon.getInterpolatedV( 15.0D );
|
||||
|
||||
double var22b = IIcon.getInterpolatedV( 9.0D );
|
||||
double var26b = IIcon.getInterpolatedV( 11.0D );
|
||||
final double var22b = IIcon.getInterpolatedV( 9.0D );
|
||||
final double var26b = IIcon.getInterpolatedV( 11.0D );
|
||||
|
||||
baseX += 0.5D;
|
||||
baseZ += 0.5D;
|
||||
double var36 = baseX - 0.5D;
|
||||
double var38 = baseX + 0.5D;
|
||||
double var40 = baseZ - 0.5D;
|
||||
double var42 = baseZ + 0.5D;
|
||||
final double var36 = baseX - 0.5D;
|
||||
final double var38 = baseX + 0.5D;
|
||||
final double var40 = baseZ - 0.5D;
|
||||
final double var42 = baseZ + 0.5D;
|
||||
|
||||
double toff = 0.0d;
|
||||
|
||||
@@ -484,18 +484,18 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
renderer.setBrightness( 11 << 20 | 11 << 4 );
|
||||
}
|
||||
|
||||
EnumFacing t = EnumFacing.UP;
|
||||
final EnumFacing t = EnumFacing.UP;
|
||||
|
||||
double TorchLen = 0.625D;
|
||||
double var44 = 0.0625D;
|
||||
double Zero = 0;
|
||||
double par10 = 0;
|
||||
final double TorchLen = 0.625D;
|
||||
final double var44 = 0.0625D;
|
||||
final double Zero = 0;
|
||||
final double par10 = 0;
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20, var22 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20, var26 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24, var26 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24, var22 );
|
||||
|
||||
double var422 = 0.1915D + 1.0 / 16.0;
|
||||
final double var422 = 0.1915D + 1.0 / 16.0;
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24b, var22b );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24b, var26b );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20b, var26b );
|
||||
@@ -527,7 +527,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
this.addVertexWithUV(t,renderer, var36, baseY + 1.0D, baseZ - var44, var17, var18 );
|
||||
}
|
||||
|
||||
public void addVertexWithUV( EnumFacing face, ModelGenerator renderer, double x, double y, double z, double u, double v )
|
||||
public void addVertexWithUV( final EnumFacing face, final ModelGenerator renderer, double x, double y, double z, final double u, final double v )
|
||||
{
|
||||
x -= this.centerX;
|
||||
y -= this.centerY;
|
||||
@@ -541,7 +541,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
if( this.side == AEPartLocation.EAST )
|
||||
{
|
||||
double m = x;
|
||||
final double m = x;
|
||||
x = y;
|
||||
y = m;
|
||||
y = -y;
|
||||
@@ -549,14 +549,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
if( this.side == AEPartLocation.WEST )
|
||||
{
|
||||
double m = x;
|
||||
final double m = x;
|
||||
x = -y;
|
||||
y = m;
|
||||
}
|
||||
|
||||
if( this.side == AEPartLocation.SOUTH )
|
||||
{
|
||||
double m = z;
|
||||
final double m = z;
|
||||
z = y;
|
||||
y = m;
|
||||
y = -y;
|
||||
@@ -564,7 +564,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
if( this.side == AEPartLocation.NORTH )
|
||||
{
|
||||
double m = z;
|
||||
final double m = z;
|
||||
z = -y;
|
||||
y = m;
|
||||
}
|
||||
@@ -578,7 +578,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( renderer.getIcon( is ) );
|
||||
// rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() );
|
||||
@@ -618,17 +618,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(
|
||||
World world,
|
||||
BlockPos pos,
|
||||
Random r )
|
||||
final World world,
|
||||
final BlockPos pos,
|
||||
final Random r )
|
||||
{
|
||||
if( this.isLevelEmitterOn() )
|
||||
{
|
||||
AEPartLocation d = this.side;
|
||||
final AEPartLocation d = this.side;
|
||||
|
||||
double d0 = d.xOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
double d2 = d.zOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
final double d0 = d.xOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
final double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
final double d2 = d.zOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
|
||||
world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D, new int[0] );
|
||||
}
|
||||
@@ -641,7 +641,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
@@ -658,13 +658,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
this.configureWatchers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
if( inv == this.config )
|
||||
{
|
||||
@@ -687,7 +687,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.lastReportedValue = data.getLong( "lastReportedValue" );
|
||||
@@ -697,7 +697,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setLong( "lastReportedValue", this.lastReportedValue );
|
||||
@@ -707,7 +707,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "config" ) )
|
||||
{
|
||||
@@ -718,7 +718,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table )
|
||||
public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -730,13 +730,13 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideCrafting( ICraftingProviderHelper craftingTracker )
|
||||
public void provideCrafting( final ICraftingProviderHelper craftingTracker )
|
||||
{
|
||||
if( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 )
|
||||
{
|
||||
if( this.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ) == YesNo.YES )
|
||||
{
|
||||
IAEItemStack what = this.config.getAEStackInSlot( 0 );
|
||||
final IAEItemStack what = this.config.getAEStackInSlot( 0 );
|
||||
if( what != null )
|
||||
{
|
||||
craftingTracker.setEmitable( what );
|
||||
|
||||
@@ -42,7 +42,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
private InventoryAdaptor adaptor;
|
||||
private boolean lastRedstone = false;
|
||||
|
||||
public PartSharedItemBus( ItemStack is )
|
||||
public PartSharedItemBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
@@ -54,21 +54,21 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( net.minecraft.nbt.NBTTagCompound extra )
|
||||
public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.config.readFromNBT( extra, "config" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( net.minecraft.nbt.NBTTagCompound extra )
|
||||
public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.config.writeToNBT( extra, "config" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "config" ) )
|
||||
{
|
||||
@@ -110,9 +110,9 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
return this.adaptor;
|
||||
}
|
||||
|
||||
private TileEntity getTileEntity( TileEntity self, BlockPos pos )
|
||||
private TileEntity getTileEntity( final TileEntity self, final BlockPos pos )
|
||||
{
|
||||
World w = self.getWorld();
|
||||
final World w = self.getWorld();
|
||||
|
||||
if( w.getChunkProvider().chunkExists( pos.getX() >> 4, pos.getZ() >> 4 ) )
|
||||
{
|
||||
@@ -177,7 +177,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
this.proxy.getTick().sleepDevice( this.proxy.getNode() );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
private final IConfigManager manager;
|
||||
private final UpgradeInventory upgrades;
|
||||
|
||||
public PartUpgradeable( ItemStack is )
|
||||
public PartUpgradeable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.upgrades = new StackUpgradeInventory( this.is, this, this.getUpgradeSlots() );
|
||||
@@ -52,13 +52,13 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
if( inv == this.upgrades )
|
||||
{
|
||||
@@ -108,7 +108,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades( Upgrades u )
|
||||
public int getInstalledUpgrades( final Upgrades u )
|
||||
{
|
||||
return this.upgrades.getInstalledUpgrades( u );
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( net.minecraft.nbt.NBTTagCompound extra )
|
||||
public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.manager.readFromNBT( extra );
|
||||
@@ -128,7 +128,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( net.minecraft.nbt.NBTTagCompound extra )
|
||||
public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.manager.writeToNBT( extra );
|
||||
@@ -136,9 +136,9 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
for( ItemStack is : this.upgrades )
|
||||
for( final ItemStack is : this.upgrades )
|
||||
{
|
||||
if( is != null )
|
||||
{
|
||||
@@ -154,7 +154,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "upgrades" ) )
|
||||
{
|
||||
|
||||
@@ -11,18 +11,18 @@ public class StackUpgradeInventory extends UpgradeInventory
|
||||
{
|
||||
private final ItemStack stack;
|
||||
|
||||
public StackUpgradeInventory( ItemStack stack, IAEAppEngInventory inventory, int s )
|
||||
public StackUpgradeInventory( final ItemStack stack, final IAEAppEngInventory inventory, final int s )
|
||||
{
|
||||
super( inventory, s );
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxInstalled( Upgrades upgrades )
|
||||
public int getMaxInstalled( final Upgrades upgrades )
|
||||
{
|
||||
int max = 0;
|
||||
|
||||
for( ItemStack is : upgrades.getSupported().keySet() )
|
||||
for( final ItemStack is : upgrades.getSupported().keySet() )
|
||||
{
|
||||
if( Platform.isSameItem( this.stack, is ) )
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
private int inverterUpgrades = 0;
|
||||
private int craftingUpgrades = 0;
|
||||
|
||||
public UpgradeInventory( IAEAppEngInventory parent, int s )
|
||||
public UpgradeInventory( final IAEAppEngInventory parent, final int s )
|
||||
{
|
||||
super( null, s );
|
||||
this.te = this;
|
||||
@@ -63,16 +63,16 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
if( itemstack == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Item it = itemstack.getItem();
|
||||
final Item it = itemstack.getItem();
|
||||
if( it instanceof IUpgradeModule )
|
||||
{
|
||||
Upgrades u = ( (IUpgradeModule) it ).getType( itemstack );
|
||||
final Upgrades u = ( (IUpgradeModule) it ).getType( itemstack );
|
||||
if( u != null )
|
||||
{
|
||||
return this.getInstalledUpgrades( u ) < this.getMaxInstalled( u );
|
||||
@@ -81,7 +81,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getInstalledUpgrades( Upgrades u )
|
||||
public int getInstalledUpgrades( final Upgrades u )
|
||||
{
|
||||
if( !this.cached )
|
||||
{
|
||||
@@ -114,14 +114,14 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
this.cached = true;
|
||||
this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = 0;
|
||||
|
||||
for( ItemStack is : this )
|
||||
for( final ItemStack is : this )
|
||||
{
|
||||
if( is == null || is.getItem() == null || !( is.getItem() instanceof IUpgradeModule ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Upgrades myUpgrade = ( (IUpgradeModule) is.getItem() ).getType( is );
|
||||
final Upgrades myUpgrade = ( (IUpgradeModule) is.getItem() ).getType( is );
|
||||
switch( myUpgrade )
|
||||
{
|
||||
case CAPACITY:
|
||||
@@ -156,7 +156,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound target )
|
||||
public void readFromNBT( final NBTTagCompound target )
|
||||
{
|
||||
super.readFromNBT( target );
|
||||
this.updateUpgradeInfo();
|
||||
@@ -169,7 +169,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
this.cached = false;
|
||||
if( this.parent != null && Platform.isServer() )
|
||||
|
||||
@@ -56,13 +56,13 @@ public class PartCableAnchor implements IPart
|
||||
IPartHost host = null;
|
||||
AEPartLocation mySide = AEPartLocation.UP;
|
||||
|
||||
public PartCableAnchor( ItemStack is )
|
||||
public PartCableAnchor( final ItemStack is )
|
||||
{
|
||||
this.is = is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
|
||||
{
|
||||
@@ -75,14 +75,14 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack( PartItemStack wrenched )
|
||||
public ItemStack getItemStack( final PartItemStack wrenched )
|
||||
{
|
||||
return this.is;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper instance, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper instance, final ModelGenerator renderer )
|
||||
{
|
||||
instance.setTexture( renderer.getIcon( is ) );
|
||||
instance.setBounds( 7, 7, 4, 9, 9, 14 );
|
||||
@@ -92,9 +92,9 @@ public class PartCableAnchor implements IPart
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
IAESprite myIcon = renderer.getIcon( is );
|
||||
final IAESprite myIcon = renderer.getIcon( is );
|
||||
rh.setTexture( myIcon );
|
||||
if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
|
||||
{
|
||||
@@ -110,13 +110,13 @@ public class PartCableAnchor implements IPart
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer)
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -140,13 +140,13 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLadder( EntityLivingBase entity )
|
||||
public boolean isLadder( final EntityLivingBase entity )
|
||||
{
|
||||
return this.mySide.yOffset == 0 && ( entity.isCollidedHorizontally || !entity.onGround );
|
||||
}
|
||||
@@ -182,13 +182,13 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollision( Entity entity )
|
||||
public void onEntityCollision( final Entity entity )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -224,26 +224,26 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
this.host = host;
|
||||
this.mySide = side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onShiftActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onShiftActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -256,21 +256,21 @@ public class PartCableAnchor implements IPart
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(
|
||||
World world,
|
||||
BlockPos pos,
|
||||
Random r )
|
||||
final World world,
|
||||
final BlockPos pos,
|
||||
final Random r )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBePlacedOn( BusSupport what )
|
||||
public boolean canBePlacedOn( final BusSupport what )
|
||||
{
|
||||
return what == BusSupport.CABLE || what == BusSupport.DENSE_CABLE;
|
||||
}
|
||||
|
||||
@@ -80,39 +80,39 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
final DualityInterface duality = new DualityInterface( this.proxy, this );
|
||||
|
||||
@Reflected
|
||||
public PartInterface( ItemStack is )
|
||||
public PartInterface( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void stateChange( MENetworkChannelsChanged c )
|
||||
public void stateChange( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.duality.notifyNeighbors();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void stateChange( MENetworkPowerStatusChange c )
|
||||
public void stateChange( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.duality.notifyNeighbors();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 2, 2, 14, 14, 14, 16 );
|
||||
bch.addBox( 5, 5, 12, 11, 11, 14 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInstalledUpgrades( Upgrades u )
|
||||
public int getInstalledUpgrades( final Upgrades u )
|
||||
{
|
||||
return this.duality.getInstalledUpgrades( u );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
@@ -134,7 +134,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
@@ -155,14 +155,14 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.duality.readFromNBT( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
this.duality.writeToNBT( data );
|
||||
@@ -176,7 +176,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
this.duality.addDrops( drops );
|
||||
}
|
||||
@@ -194,13 +194,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
return this.duality.getInventoryByName( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer p, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer p, final Vec3 pos )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
@@ -216,13 +216,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture(ModelGenerator renderer)
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer)
|
||||
{
|
||||
return renderer.getIcon( is ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsert( ItemStack stack )
|
||||
public boolean canInsert( final ItemStack stack )
|
||||
{
|
||||
return this.duality.canInsert( stack );
|
||||
}
|
||||
@@ -240,13 +240,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return this.duality.getTickingRequest( node );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
return this.duality.tickingRequest( node, ticksSinceLastCall );
|
||||
}
|
||||
@@ -258,25 +258,25 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
public ItemStack getStackInSlot( final int i )
|
||||
{
|
||||
return this.duality.getStorage().getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
public ItemStack decrStackSize( final int i, final int j )
|
||||
{
|
||||
return this.duality.getStorage().decrStackSize( i, j );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
public ItemStack getStackInSlotOnClosing( final int i )
|
||||
{
|
||||
return this.duality.getStorage().getStackInSlotOnClosing( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
||||
{
|
||||
this.duality.getStorage().setInventorySlotContents( i, itemstack );
|
||||
}
|
||||
@@ -306,49 +306,49 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
|
||||
{
|
||||
return this.duality.getStorage().isUseableByPlayer( entityplayer );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory( EntityPlayer player )
|
||||
public void openInventory( final EntityPlayer player )
|
||||
{
|
||||
this.duality.getStorage().openInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory( EntityPlayer player )
|
||||
public void closeInventory( final EntityPlayer player )
|
||||
{
|
||||
this.duality.getStorage().closeInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
return this.duality.getStorage().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace( EnumFacing side )
|
||||
public int[] getSlotsForFace( final EnumFacing side )
|
||||
{
|
||||
return this.duality.getSlotsForFace( side );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
public boolean canInsertItem( final int i, final ItemStack itemstack, final EnumFacing j )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
public boolean canExtractItem( final int i, final ItemStack itemstack, final EnumFacing j )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
this.duality.onChangeInventory( inv, slot, mc, removedStack, newStack );
|
||||
}
|
||||
@@ -372,13 +372,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStorageMonitorable getMonitorable( EnumFacing side, BaseActionSource src )
|
||||
public IStorageMonitorable getMonitorable( final EnumFacing side, final BaseActionSource src )
|
||||
{
|
||||
return this.duality.getMonitorable( side, src, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pushPattern( ICraftingPatternDetails patternDetails, InventoryCrafting table )
|
||||
public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table )
|
||||
{
|
||||
return this.duality.pushPattern( patternDetails, table );
|
||||
}
|
||||
@@ -390,7 +390,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideCrafting( ICraftingProviderHelper craftingTracker )
|
||||
public void provideCrafting( final ICraftingProviderHelper craftingTracker )
|
||||
{
|
||||
this.duality.provideCrafting( craftingTracker );
|
||||
}
|
||||
@@ -402,13 +402,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectCraftedItems( ICraftingLink link, IAEItemStack items, Actionable mode )
|
||||
public IAEItemStack injectCraftedItems( final ICraftingLink link, final IAEItemStack items, final Actionable mode )
|
||||
{
|
||||
return this.duality.injectCraftedItems( link, items, mode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void jobStateChange( ICraftingLink link )
|
||||
public void jobStateChange( final ICraftingLink link )
|
||||
{
|
||||
this.duality.jobStateChange( link );
|
||||
}
|
||||
@@ -420,22 +420,22 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority( int newValue )
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.duality.setPriority( newValue );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField(
|
||||
int id )
|
||||
final int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
int id,
|
||||
int value )
|
||||
final int id,
|
||||
final int value )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import appeng.helpers.Reflected;
|
||||
public class PartInvertedToggleBus extends PartToggleBus
|
||||
{
|
||||
@Reflected
|
||||
public PartInvertedToggleBus( ItemStack is )
|
||||
public PartInvertedToggleBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setIdlePowerUsage( 0.0 );
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
private byte resetCacheLogic = 0;
|
||||
|
||||
@Reflected
|
||||
public PartStorageBus( ItemStack is )
|
||||
public PartStorageBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE );
|
||||
@@ -111,14 +111,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.updateStatus();
|
||||
}
|
||||
|
||||
private void updateStatus()
|
||||
{
|
||||
boolean currentActive = this.proxy.isActive();
|
||||
final boolean currentActive = this.proxy.isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
@@ -127,7 +127,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
this.host.markForUpdate();
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void updateChannels( MENetworkChannelsChanged changedChannels )
|
||||
public void updateChannels( final MENetworkChannelsChanged changedChannels )
|
||||
{
|
||||
this.updateStatus();
|
||||
}
|
||||
@@ -147,14 +147,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
this.resetCache( true );
|
||||
this.host.markForSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
super.onChangeInventory( inv, slot, mc, removedStack, newStack );
|
||||
|
||||
@@ -172,7 +172,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.Config.readFromNBT( data, "config" );
|
||||
@@ -180,7 +180,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
this.Config.writeToNBT( data, "config" );
|
||||
@@ -188,7 +188,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "config" ) )
|
||||
{
|
||||
@@ -198,7 +198,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return super.getInventoryByName( name );
|
||||
}
|
||||
|
||||
private void resetCache( boolean fullReset )
|
||||
private void resetCache( final boolean fullReset )
|
||||
{
|
||||
if( this.host == null || this.host.getTile() == null || this.host.getTile().getWorld() == null || this.host.getTile().getWorld().isRemote )
|
||||
{
|
||||
@@ -218,20 +218,20 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
{
|
||||
this.proxy.getTick().alertDevice( this.proxy.getNode() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid( Object verificationToken )
|
||||
public boolean isValid( final Object verificationToken )
|
||||
{
|
||||
return this.handler == verificationToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange( IBaseMonitor<IAEItemStack> monitor, Iterable<IAEItemStack> change, BaseActionSource source )
|
||||
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource source )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -240,7 +240,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -253,7 +253,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 3, 3, 15, 13, 13, 16 );
|
||||
bch.addBox( 2, 2, 14, 14, 14, 15 );
|
||||
@@ -262,7 +262,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
@@ -278,7 +278,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
@@ -314,7 +314,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !player.isSneaking() )
|
||||
{
|
||||
@@ -331,13 +331,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, this.monitor == null, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
if( this.resetCacheLogic != 0 )
|
||||
{
|
||||
@@ -354,10 +354,10 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
private void resetCache()
|
||||
{
|
||||
boolean fullReset = this.resetCacheLogic == 2;
|
||||
final boolean fullReset = this.resetCacheLogic == 2;
|
||||
this.resetCacheLogic = 0;
|
||||
|
||||
IMEInventory<IAEItemStack> in = this.getInternalHandler();
|
||||
final IMEInventory<IAEItemStack> in = this.getInternalHandler();
|
||||
IItemList<IAEItemStack> before = AEApi.instance().storage().createItemList();
|
||||
if( in != null )
|
||||
{
|
||||
@@ -370,7 +370,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.handlerHash = 0;
|
||||
}
|
||||
|
||||
IMEInventory<IAEItemStack> out = this.getInternalHandler();
|
||||
final IMEInventory<IAEItemStack> out = this.getInternalHandler();
|
||||
|
||||
if( this.monitor != null )
|
||||
{
|
||||
@@ -393,13 +393,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
boolean wasSleeping = this.monitor == null;
|
||||
final boolean wasSleeping = this.monitor == null;
|
||||
|
||||
this.cached = true;
|
||||
TileEntity self = this.getHost().getTile();
|
||||
TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( side.getFacing() ) );
|
||||
final TileEntity self = this.getHost().getTile();
|
||||
final TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( side.getFacing() ) );
|
||||
|
||||
int newHandlerHash = Platform.generateTileHash( target );
|
||||
final int newHandlerHash = Platform.generateTileHash( target );
|
||||
|
||||
if( this.handlerHash == newHandlerHash && this.handlerHash != 0 )
|
||||
{
|
||||
@@ -411,7 +411,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
// force grid to update handlers...
|
||||
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :3
|
||||
}
|
||||
@@ -421,14 +421,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.monitor = null;
|
||||
if( target != null )
|
||||
{
|
||||
IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
if( esh != null )
|
||||
{
|
||||
IMEInventory inv = esh.getInventory( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
final IMEInventory inv = esh.getInventory( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
|
||||
if( inv instanceof MEMonitorIInventory )
|
||||
{
|
||||
MEMonitorIInventory h = (MEMonitorIInventory) inv;
|
||||
final MEMonitorIInventory h = (MEMonitorIInventory) inv;
|
||||
h.mode = (StorageFilter) this.getConfigManager().getSetting( Settings.STORAGE_FILTER );
|
||||
h.mySource = new MachineSource( this );
|
||||
}
|
||||
@@ -448,12 +448,12 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
|
||||
this.handler.setPriority( this.priority );
|
||||
|
||||
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
|
||||
int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
|
||||
final int slotsToUse = 18 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 9;
|
||||
for( int x = 0; x < this.Config.getSizeInventory() && x < slotsToUse; x++ )
|
||||
{
|
||||
IAEItemStack is = this.Config.getAEStackInSlot( x );
|
||||
final IAEItemStack is = this.Config.getAEStackInSlot( x );
|
||||
if( is != null )
|
||||
{
|
||||
priorityList.add( is );
|
||||
@@ -482,7 +482,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
{
|
||||
try
|
||||
{
|
||||
ITickManager tm = this.proxy.getTick();
|
||||
final ITickManager tm = this.proxy.getTick();
|
||||
if( this.monitor == null )
|
||||
{
|
||||
tm.sleepDevice( this.proxy.getNode() );
|
||||
@@ -492,7 +492,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
tm.wakeDevice( this.proxy.getNode() );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
@@ -501,7 +501,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
private void checkInterfaceVsStorageBus( TileEntity target, AEPartLocation side )
|
||||
private void checkInterfaceVsStorageBus( final TileEntity target, final AEPartLocation side )
|
||||
{
|
||||
IInterfaceHost achievement = null;
|
||||
|
||||
@@ -512,7 +512,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
if( target instanceof IPartHost )
|
||||
{
|
||||
Object part = ( (IPartHost) target ).getPart( side );
|
||||
final Object part = ( (IPartHost) target ).getPart( side );
|
||||
if( part instanceof IInterfaceHost )
|
||||
{
|
||||
achievement = (IInterfaceHost) part;
|
||||
@@ -527,11 +527,11 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( StorageChannel channel )
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS )
|
||||
{
|
||||
IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null;
|
||||
final IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null;
|
||||
if( out != null )
|
||||
{
|
||||
return Collections.singletonList( out );
|
||||
@@ -547,7 +547,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority( int newValue )
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.priority = newValue;
|
||||
this.host.markForSave();
|
||||
@@ -555,7 +555,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blinkCell( int slot )
|
||||
public void blinkCell( final int slot )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public void saveChanges( IMEInventory cellInventory )
|
||||
public void saveChanges( final IMEInventory cellInventory )
|
||||
{
|
||||
// nope!
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PartToggleBus extends PartBasicState
|
||||
boolean hasRedstone = false;
|
||||
|
||||
@Reflected
|
||||
public PartToggleBus( ItemStack is )
|
||||
public PartToggleBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -70,14 +70,14 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColors( ModelGenerator renderer, boolean hasChan, boolean hasPower )
|
||||
public void setColors( final ModelGenerator renderer, final boolean hasChan, final boolean hasPower )
|
||||
{
|
||||
this.hasRedstone = ( this.clientFlags & REDSTONE_FLAG ) == REDSTONE_FLAG;
|
||||
super.setColors( renderer, hasChan && this.hasRedstone, hasPower && this.hasRedstone );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int populateFlags( int cf )
|
||||
protected int populateFlags( final int cf )
|
||||
{
|
||||
return cf | ( this.getIntention() ? REDSTONE_FLAG : 0 );
|
||||
}
|
||||
@@ -88,13 +88,13 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return renderer.getIcon( is ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class PartToggleBus extends PartBasicState
|
||||
{
|
||||
if( this.is.stackSize > 0 )
|
||||
{
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add( this.is.copy() );
|
||||
this.host.removePart( this.side, false );
|
||||
Platform.spawnDrops( this.tile.getWorld(), this.tile.getPos(), items );
|
||||
@@ -113,14 +113,14 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 6, 6, 11, 10, 10, 16 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.2, -0.3, 0.0 );
|
||||
|
||||
@@ -145,7 +145,7 @@ public class PartToggleBus extends PartBasicState
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( renderer.getIcon( is ) );
|
||||
|
||||
@@ -166,7 +166,7 @@ public class PartToggleBus extends PartBasicState
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
boolean oldHasRedstone = this.hasRedstone;
|
||||
final boolean oldHasRedstone = this.hasRedstone;
|
||||
this.hasRedstone = this.getHost().hasRedstone( this.side );
|
||||
|
||||
if( this.hasRedstone != oldHasRedstone )
|
||||
@@ -177,14 +177,14 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound extra )
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.outerProxy.readFromNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound extra )
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.outerProxy.writeToNBT( extra );
|
||||
@@ -207,7 +207,7 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
super.setPartHostInfo( side, host, tile );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) );
|
||||
@@ -226,7 +226,7 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
@@ -234,7 +234,7 @@ public class PartToggleBus extends PartBasicState
|
||||
|
||||
private void updateInternalState()
|
||||
{
|
||||
boolean intention = this.getIntention();
|
||||
final boolean intention = this.getIntention();
|
||||
if( intention == ( this.connection == null ) )
|
||||
{
|
||||
if( this.proxy.getNode() != null && this.outerProxy.getNode() != null )
|
||||
@@ -245,7 +245,7 @@ public class PartToggleBus extends PartBasicState
|
||||
{
|
||||
this.connection = AEApi.instance().createGridConnection( this.proxy.getNode(), this.outerProxy.getNode() );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
EnumSet<AEPartLocation> connections = EnumSet.noneOf( AEPartLocation.class );
|
||||
boolean powered = false;
|
||||
|
||||
public PartCable( ItemStack is )
|
||||
public PartCable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.PREFERRED );
|
||||
@@ -102,7 +102,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean changeColor( AEColor newColor, EntityPlayer who )
|
||||
public boolean changeColor( final AEColor newColor, final EntityPlayer who )
|
||||
{
|
||||
if( this.getCableColor() != newColor )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -155,13 +155,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
public void setValidSides(
|
||||
EnumSet<EnumFacing> sides )
|
||||
final EnumSet<EnumFacing> sides )
|
||||
{
|
||||
this.proxy.setValidSides( sides );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected( EnumFacing side )
|
||||
public boolean isConnected( final EnumFacing side )
|
||||
{
|
||||
return this.connections.contains( AEPartLocation.fromFacing( side ) );
|
||||
}
|
||||
@@ -172,13 +172,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 6.0, 6.0, 6.0, 10.0, 10.0, 10.0 );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -189,15 +189,15 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
IPartHost ph = this.getHost();
|
||||
final IPartHost ph = this.getHost();
|
||||
if( ph != null )
|
||||
{
|
||||
for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart p = ph.getPart( dir );
|
||||
final IPart p = ph.getPart( dir );
|
||||
if( p instanceof IGridHost )
|
||||
{
|
||||
double dist = p.cableConnectionRenderTo();
|
||||
final double dist = p.cableConnectionRenderTo();
|
||||
|
||||
if( dist > 8 )
|
||||
{
|
||||
@@ -230,7 +230,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -259,7 +259,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -269,12 +269,12 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
public IAESprite getTexture( AEColor c,ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getGlassTexture( c,renderer );
|
||||
}
|
||||
|
||||
public IAESprite getGlassTexture( AEColor c,ModelGenerator renderer )
|
||||
public IAESprite getGlassTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -327,18 +327,18 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
boolean useCovered = false;
|
||||
boolean requireDetailed = false;
|
||||
|
||||
for( AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation dir : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart p = this.getHost().getPart( dir );
|
||||
final IPart p = this.getHost().getPart( dir );
|
||||
if( p instanceof IGridHost )
|
||||
{
|
||||
IGridHost igh = (IGridHost) p;
|
||||
AECableType type = igh.getCableConnectionType( dir.getOpposite() );
|
||||
final IGridHost igh = (IGridHost) p;
|
||||
final AECableType type = igh.getCableConnectionType( dir.getOpposite() );
|
||||
if( type == AECableType.COVERED || type == AECableType.SMART )
|
||||
{
|
||||
useCovered = true;
|
||||
@@ -347,9 +347,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
else if( this.connections.contains( dir ) )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
if( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS )
|
||||
{
|
||||
requireDetailed = true;
|
||||
@@ -366,13 +366,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.setTexture( this.getTexture( this.getCableColor(),renderer ) );
|
||||
}
|
||||
|
||||
IPartHost ph = this.getHost();
|
||||
for( AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
{
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
final int len = bp.cableConnectionRenderTo();
|
||||
if( len < 8 )
|
||||
{
|
||||
switch( of )
|
||||
@@ -416,17 +416,17 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
this.renderGlassConnection( pos, rh, renderer, of );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
rh.setTexture( def );
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing(), of.getFacing().getOpposite() ) ) );
|
||||
switch( of )
|
||||
@@ -458,18 +458,18 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode node = this.getGridNode();
|
||||
final IGridNode node = this.getGridNode();
|
||||
|
||||
if( node != null )
|
||||
{
|
||||
int howMany = 0;
|
||||
for( IGridConnection gc : node.getConnections() )
|
||||
for( final IGridConnection gc : node.getConnections() )
|
||||
{
|
||||
howMany = Math.max( gc.getUsedChannels(), howMany );
|
||||
}
|
||||
@@ -480,23 +480,23 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
int cs = 0;
|
||||
int sideOut = 0;
|
||||
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
for( AEPartLocation thisSide : AEPartLocation.SIDE_LOCATIONS )
|
||||
for( final AEPartLocation thisSide : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IPart part = this.getHost().getPart( thisSide );
|
||||
final IPart part = this.getHost().getPart( thisSide );
|
||||
if( part != null )
|
||||
{
|
||||
if( part.getGridNode() != null )
|
||||
{
|
||||
IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
|
||||
for( IGridConnection gc : set )
|
||||
final IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
|
||||
for( final IGridConnection gc : set )
|
||||
{
|
||||
if( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
|
||||
{
|
||||
@@ -511,13 +511,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( IGridConnection gc : n.getConnections() )
|
||||
for( final IGridConnection gc : n.getConnections() )
|
||||
{
|
||||
AEPartLocation side = gc.getDirection( n );
|
||||
final AEPartLocation side = gc.getDirection( n );
|
||||
if( side != AEPartLocation.INTERNAL )
|
||||
{
|
||||
boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
|
||||
if( isTier2a && isTier2b )
|
||||
{
|
||||
@@ -539,7 +539,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
cs |= ( 1 << AEPartLocation.INTERNAL.ordinal() );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// aww...
|
||||
}
|
||||
@@ -549,21 +549,21 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
int cs = data.readByte();
|
||||
int sideOut = data.readInt();
|
||||
final int cs = data.readByte();
|
||||
final int sideOut = data.readInt();
|
||||
|
||||
EnumSet<AEPartLocation> myC = this.connections.clone();
|
||||
boolean wasPowered = this.powered;
|
||||
final EnumSet<AEPartLocation> myC = this.connections.clone();
|
||||
final boolean wasPowered = this.powered;
|
||||
this.powered = false;
|
||||
boolean channelsChanged = false;
|
||||
|
||||
for( AEPartLocation d : AEPartLocation.values() )
|
||||
for( final AEPartLocation d : AEPartLocation.values() )
|
||||
{
|
||||
if( d != AEPartLocation.INTERNAL )
|
||||
{
|
||||
int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF;
|
||||
final int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF;
|
||||
if( ch != this.channelsOnSide[d.ordinal()] )
|
||||
{
|
||||
channelsChanged = true;
|
||||
@@ -573,7 +573,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
if( d == AEPartLocation.INTERNAL )
|
||||
{
|
||||
int id = 1 << d.ordinal();
|
||||
final int id = 1 << d.ordinal();
|
||||
if( id == ( cs & id ) )
|
||||
{
|
||||
this.powered = true;
|
||||
@@ -581,7 +581,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
else
|
||||
{
|
||||
int id = 1 << d.ordinal();
|
||||
final int id = 1 << d.ordinal();
|
||||
if( id == ( cs & id ) )
|
||||
{
|
||||
this.connections.add( d );
|
||||
@@ -598,12 +598,12 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return this.getTexture( this.getCableColor(), renderer ).getAtlas();
|
||||
}
|
||||
|
||||
public IAESprite getCoveredTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getCoveredTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -648,17 +648,17 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
return renderer.getIcon( coveredCableStack );
|
||||
}
|
||||
|
||||
protected boolean nonLinear( EnumSet<AEPartLocation> sides )
|
||||
protected boolean nonLinear( final EnumSet<AEPartLocation> sides )
|
||||
{
|
||||
return ( sides.contains( AEPartLocation.EAST ) && sides.contains( AEPartLocation.WEST ) ) || ( sides.contains( AEPartLocation.NORTH ) && sides.contains( AEPartLocation.SOUTH ) ) || ( sides.contains( AEPartLocation.UP ) && sides.contains( AEPartLocation.DOWN ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderGlassConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, AEPartLocation of )
|
||||
public void renderGlassConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) );
|
||||
|
||||
@@ -730,11 +730,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderCoveredConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of )
|
||||
public void renderCoveredConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) );
|
||||
if( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null && partHost.getColor() != AEColor.Transparent )
|
||||
@@ -811,11 +811,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderSmartConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of )
|
||||
public void renderSmartConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
AEColor myColor = this.getCableColor();
|
||||
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing() ) ) );
|
||||
@@ -855,13 +855,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
if( of == AEPartLocation.EAST || of == AEPartLocation.WEST )
|
||||
{
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
}
|
||||
|
||||
@@ -919,8 +919,8 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
renderer.setColorOpaque_I( myColor.blackVariant );
|
||||
@@ -935,7 +935,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
public IAESprite getSmartTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getSmartTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -981,7 +981,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected void setSmartConnectionRotations( AEPartLocation of, ModelGenerator renderer )
|
||||
protected void setSmartConnectionRotations( final AEPartLocation of, final ModelGenerator renderer )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -1014,7 +1014,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
protected CableBusTextures getChannelTex( int i, boolean b )
|
||||
protected CableBusTextures getChannelTex( int i, final boolean b )
|
||||
{
|
||||
if( !this.powered )
|
||||
{
|
||||
@@ -1056,7 +1056,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected void renderAllFaces( AEBaseBlock blk, BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
protected void renderAllFaces( final AEBaseBlock blk, final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( (float) renderer.renderMinX * 16.0f, (float) renderer.renderMinY * 16.0f, (float) renderer.renderMinZ * 16.0f, (float) renderer.renderMaxX * 16.0f, (float) renderer.renderMaxY * 16.0f, (float) renderer.renderMaxZ * 16.0f );
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.WEST ), EnumFacing.WEST, renderer );
|
||||
|
||||
@@ -51,19 +51,19 @@ import appeng.util.Platform;
|
||||
public class PartCableCovered extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableCovered( ItemStack is )
|
||||
public PartCableCovered( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
public void channelUpdated( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
@@ -75,13 +75,13 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -92,7 +92,7 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -121,7 +121,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -131,7 +131,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
OffsetIcon main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
@@ -140,14 +140,14 @@ public class PartCableCovered extends PartCable
|
||||
offV = 0;
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
|
||||
main = new OffsetIcon( this.getTexture( this.getCableColor(), renderer ), 0, 0 );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
}
|
||||
@@ -156,24 +156,24 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getCoveredTexture( c, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
IPartHost ph = this.getHost();
|
||||
for( AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
{
|
||||
if( of != AEPartLocation.INTERNAL )
|
||||
@@ -182,7 +182,7 @@ public class PartCableCovered extends PartCable
|
||||
hasBuses = true;
|
||||
}
|
||||
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
final int len = bp.cableConnectionRenderTo();
|
||||
if( len < 8 )
|
||||
{
|
||||
switch( of )
|
||||
@@ -215,7 +215,7 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
this.renderCoveredConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
@@ -226,9 +226,9 @@ public class PartCableCovered extends PartCable
|
||||
}
|
||||
else
|
||||
{
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
for( AEPartLocation of : this.connections )
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ import appeng.helpers.Reflected;
|
||||
public class PartCableGlass extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableGlass( ItemStack is )
|
||||
public PartCableGlass( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@@ -54,19 +54,19 @@ import appeng.util.Platform;
|
||||
public class PartCableSmart extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartCableSmart( ItemStack is )
|
||||
public PartCableSmart( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
public void channelUpdated( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
@@ -78,13 +78,13 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5.0, 5.0, 5.0, 11.0, 11.0, 11.0 );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -95,7 +95,7 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -124,7 +124,7 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
@@ -135,7 +135,7 @@ public class PartCableSmart extends PartCable
|
||||
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -149,7 +149,7 @@ public class PartCableSmart extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -161,7 +161,7 @@ public class PartCableSmart extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
{
|
||||
rh.setBounds( 5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f );
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
@@ -173,24 +173,24 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getSmartTexture( c, renderer );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
IPartHost ph = this.getHost();
|
||||
for( AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
{
|
||||
IPart bp = ph.getPart( of );
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
{
|
||||
if( of != AEPartLocation.INTERNAL )
|
||||
@@ -199,7 +199,7 @@ public class PartCableSmart extends PartCable
|
||||
hasBuses = true;
|
||||
}
|
||||
|
||||
int len = bp.cableConnectionRenderTo();
|
||||
final int len = bp.cableConnectionRenderTo();
|
||||
if( len < 8 )
|
||||
{
|
||||
switch( of )
|
||||
@@ -228,13 +228,13 @@ public class PartCableSmart extends PartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
|
||||
|
||||
if( of == AEPartLocation.EAST || of == AEPartLocation.WEST )
|
||||
{
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
this.renderSmartConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
}
|
||||
@@ -269,21 +269,21 @@ public class PartCableSmart extends PartCable
|
||||
{
|
||||
AEPartLocation selectedSide = AEPartLocation.INTERNAL;
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
final int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
IAESprite firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 );
|
||||
final IAESprite firstTaughtIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite firstOffsetIcon = new OffsetIcon( firstTaughtIcon, 0, -12 );
|
||||
|
||||
IAESprite secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IAESprite secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 );
|
||||
final IAESprite secondTaughtIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite secondOffsetIcon = new OffsetIcon( secondTaughtIcon, 0, -12 );
|
||||
|
||||
switch( selectedSide )
|
||||
{
|
||||
@@ -318,8 +318,8 @@ public class PartCableSmart extends PartCable
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
|
||||
@@ -58,7 +58,7 @@ import appeng.util.Platform;
|
||||
public class PartDenseCable extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartDenseCable( ItemStack is )
|
||||
public PartDenseCable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -78,17 +78,17 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
boolean noLadder = !bch.isBBCollision();
|
||||
double min = noLadder ? 3.0 : 4.9;
|
||||
double max = noLadder ? 13.0 : 11.1;
|
||||
final boolean noLadder = !bch.isBBCollision();
|
||||
final double min = noLadder ? 3.0 : 4.9;
|
||||
final double max = noLadder ? 13.0 : 11.1;
|
||||
|
||||
bch.addBox( min, min, min, max, max, max );
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
IGridNode n = this.getGridNode();
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
@@ -99,7 +99,7 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
if( this.isDense( of ) )
|
||||
{
|
||||
@@ -156,7 +156,7 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
rh.setBounds( 4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f );
|
||||
@@ -168,7 +168,7 @@ public class PartDenseCable extends PartCable
|
||||
OffsetIcon ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
OffsetIcon ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.UP, EnumFacing.DOWN ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
@@ -181,7 +181,7 @@ public class PartDenseCable extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), offU, offV );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), offU, offV );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.EAST, EnumFacing.WEST ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
@@ -192,7 +192,7 @@ public class PartDenseCable extends PartCable
|
||||
ch1 = new OffsetIcon( this.getChannelTex( 4, false ).getIcon(), 0, 0 );
|
||||
ch2 = new OffsetIcon( this.getChannelTex( 4, true ).getIcon(), 0, 0 );
|
||||
|
||||
for( EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
for( final EnumFacing side : EnumSet.of( EnumFacing.SOUTH, EnumFacing.NORTH ) )
|
||||
{
|
||||
rh.renderInventoryFace( main, side, renderer );
|
||||
rh.renderInventoryFace( ch1, side, renderer );
|
||||
@@ -203,7 +203,7 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getTexture( AEColor c, ModelGenerator renderer )
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
if( c == AEColor.Transparent )
|
||||
{
|
||||
@@ -215,14 +215,14 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
if( !this.isDense( of ) )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
if( this.isDense( of ) )
|
||||
{
|
||||
@@ -256,21 +256,21 @@ public class PartDenseCable extends PartCable
|
||||
{
|
||||
AEPartLocation selectedSide = AEPartLocation.INTERNAL;
|
||||
|
||||
for( AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.connections )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
final int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite firstOffset = new OffsetIcon( firstIcon, 0, -12 );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite firstOffset = new OffsetIcon( firstIcon, 0, -12 );
|
||||
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
IAESprite secondOffset = new OffsetIcon( secondIcon, 0, -12 );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite secondOffset = new OffsetIcon( secondIcon, 0, -12 );
|
||||
|
||||
switch( selectedSide )
|
||||
{
|
||||
@@ -305,8 +305,8 @@ public class PartDenseCable extends PartCable
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
|
||||
AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
ico.setFlip( false, true );
|
||||
|
||||
renderer.setRenderBounds( 0, 3 / 16.0, 3 / 16.0, 16 / 16.0, 13 / 16.0, 13 / 16.0 );
|
||||
@@ -314,8 +314,8 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
FlippableIcon fpA = new FlippableIcon( firstIcon );
|
||||
FlippableIcon fpB = new FlippableIcon( secondIcon );
|
||||
final FlippableIcon fpA = new FlippableIcon( firstIcon );
|
||||
final FlippableIcon fpB = new FlippableIcon( secondIcon );
|
||||
|
||||
fpA.setFlip( true, false );
|
||||
fpB.setFlip( true, false );
|
||||
@@ -359,11 +359,11 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDenseConnection( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer, int channels, AEPartLocation of )
|
||||
public void renderDenseConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
AEColor myColor = this.getCableColor();
|
||||
/*
|
||||
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart(
|
||||
@@ -433,13 +433,13 @@ public class PartDenseCable extends PartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setFacesToRender( EnumSet.allOf( EnumFacing.class ) );
|
||||
boolean isGlass = false;
|
||||
final boolean isGlass = false;
|
||||
if( !isGlass )
|
||||
{
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
|
||||
IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( channels, false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( channels, true ).getIcon(), -0.2f );
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
renderer.setColorOpaque_I( myColor.blackVariant );
|
||||
@@ -454,18 +454,18 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSmart( AEPartLocation of )
|
||||
private boolean isSmart( final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.SMART;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private IAESprite getDenseTexture( AEColor c, ModelGenerator renderer )
|
||||
private IAESprite getDenseTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -507,25 +507,25 @@ public class PartDenseCable extends PartCable
|
||||
return renderer.getIcon( is );
|
||||
}
|
||||
|
||||
private boolean isDense( AEPartLocation of )
|
||||
private boolean isDense( final AEPartLocation of )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.DENSE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void channelUpdated( MENetworkChannelsChanged c )
|
||||
public void channelUpdated( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true );
|
||||
|
||||
public PartQuartzFiber( ItemStack is )
|
||||
public PartQuartzFiber( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setIdlePowerUsage( 0 );
|
||||
@@ -64,20 +64,20 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.GLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 6, 6, 10, 10, 10, 16 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
GL11.glTranslated( -0.2, -0.3, 0.0 );
|
||||
|
||||
@@ -89,9 +89,9 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
IAESprite myIcon = renderer.getIcon( is );
|
||||
final IAESprite myIcon = renderer.getIcon( is );
|
||||
rh.setTexture( myIcon );
|
||||
rh.setBounds( 6, 6, 10, 10, 10, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -99,14 +99,14 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound extra )
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.outerProxy.readFromNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound extra )
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.outerProxy.writeToNBT( extra );
|
||||
@@ -127,7 +127,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
super.setPartHostInfo( side, host, tile );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) );
|
||||
@@ -146,33 +146,33 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen )
|
||||
public double extractAEPower( final double amt, final Actionable mode, final Set<IEnergyGrid> seen )
|
||||
{
|
||||
double acquiredPower = 0;
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -181,31 +181,31 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen )
|
||||
public double injectAEPower( final double amt, final Actionable mode, final Set<IEnergyGrid> seen )
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
if( !seen.contains( eg ) )
|
||||
{
|
||||
return eg.injectAEPower( amt, mode, seen );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
if( !seen.contains( eg ) )
|
||||
{
|
||||
return eg.injectAEPower( amt, mode, seen );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -214,26 +214,26 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEnergyDemand( double amt, Set<IEnergyGrid> seen )
|
||||
public double getEnergyDemand( final double amt, final Set<IEnergyGrid> seen )
|
||||
{
|
||||
double demand = 0;
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
demand += eg.getEnergyDemand( amt - demand, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
final IEnergyGrid eg = this.outerProxy.getEnergy();
|
||||
demand += eg.getEnergyDemand( amt - demand, seen );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
boolean requested;
|
||||
IInventory cachedInv;
|
||||
|
||||
public PartP2PItems( ItemStack is )
|
||||
public PartP2PItems( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
this.cachedInv = null;
|
||||
PartP2PItems input = this.getInput();
|
||||
final PartP2PItems input = this.getInput();
|
||||
if( input != null && this.output )
|
||||
{
|
||||
input.onTunnelNetworkChange();
|
||||
@@ -87,21 +87,21 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
return this.cachedInv;
|
||||
}
|
||||
|
||||
List<IInventory> outs = new LinkedList<IInventory>();
|
||||
TunnelCollection<PartP2PItems> itemTunnels;
|
||||
final List<IInventory> outs = new LinkedList<IInventory>();
|
||||
final TunnelCollection<PartP2PItems> itemTunnels;
|
||||
|
||||
try
|
||||
{
|
||||
itemTunnels = this.getOutputs();
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
return new AppEngNullInventory();
|
||||
}
|
||||
|
||||
for( PartP2PItems t : itemTunnels )
|
||||
for( final PartP2PItems t : itemTunnels )
|
||||
{
|
||||
IInventory inv = t.getOutputInv();
|
||||
final IInventory inv = t.getOutputInv();
|
||||
if( inv != null )
|
||||
{
|
||||
if( Platform.getRandomInt() % 2 == 0 )
|
||||
@@ -124,7 +124,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
|
||||
if( this.proxy.isActive() )
|
||||
{
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) );
|
||||
|
||||
if( this.which.contains( this ) )
|
||||
{
|
||||
@@ -142,7 +142,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
{
|
||||
output = new WrapperBCPipe( te, this.side.getFacing().getOpposite() );
|
||||
}
|
||||
catch( Throwable ignore )
|
||||
catch( final Throwable ignore )
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -177,15 +177,15 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ItemTunnel.min, TickRates.ItemTunnel.max, false, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
boolean wasReq = this.requested;
|
||||
final boolean wasReq = this.requested;
|
||||
|
||||
if( this.requested && this.cachedInv != null )
|
||||
{
|
||||
@@ -197,12 +197,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateA( MENetworkBootingStatusChange bs )
|
||||
public void changeStateA( final MENetworkBootingStatusChange bs )
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -212,12 +212,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateB( MENetworkChannelsChanged bs )
|
||||
public void changeStateB( final MENetworkChannelsChanged bs )
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -227,12 +227,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateC( MENetworkPowerStatusChange bs )
|
||||
public void changeStateC( final MENetworkPowerStatusChange bs )
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -247,7 +247,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
if( !this.output )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
int olderSize = this.oldSize;
|
||||
final int olderSize = this.oldSize;
|
||||
this.oldSize = this.getDestination().getSizeInventory();
|
||||
if( olderSize != this.oldSize )
|
||||
{
|
||||
@@ -256,7 +256,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
else
|
||||
{
|
||||
PartP2PItems input = this.getInput();
|
||||
final PartP2PItems input = this.getInput();
|
||||
if( input != null )
|
||||
{
|
||||
input.getHost().notifyNeighbors();
|
||||
@@ -266,9 +266,9 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(
|
||||
EnumFacing side )
|
||||
final EnumFacing side )
|
||||
{
|
||||
int[] slots = new int[this.getSizeInventory()];
|
||||
final int[] slots = new int[this.getSizeInventory()];
|
||||
for( int x = 0; x < this.getSizeInventory(); x++ )
|
||||
{
|
||||
slots[x] = x;
|
||||
@@ -283,25 +283,25 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
public ItemStack getStackInSlot( final int i )
|
||||
{
|
||||
return this.getDestination().getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
public ItemStack decrStackSize( final int i, final int j )
|
||||
{
|
||||
return this.getDestination().decrStackSize( i, j );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
public ItemStack getStackInSlotOnClosing( final int i )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
||||
{
|
||||
this.getDestination().setInventorySlotContents( i, itemstack );
|
||||
}
|
||||
@@ -331,35 +331,35 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(EntityPlayer p)
|
||||
public void openInventory( final EntityPlayer p)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(EntityPlayer p)
|
||||
public void closeInventory( final EntityPlayer p)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, net.minecraft.item.ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final net.minecraft.item.ItemStack itemstack )
|
||||
{
|
||||
return this.getDestination().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
public boolean canInsertItem( final int i, final ItemStack itemstack, final EnumFacing j )
|
||||
{
|
||||
return this.getDestination().isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem( int i, ItemStack itemstack, EnumFacing j )
|
||||
public boolean canExtractItem( final int i, final ItemStack itemstack, final EnumFacing j )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -370,7 +370,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField( int id )
|
||||
public int getField( final int id )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -384,8 +384,8 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
int id,
|
||||
int value )
|
||||
final int id,
|
||||
final int value )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -43,34 +43,34 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
int lastValue = 0;
|
||||
float opacity = -1;
|
||||
|
||||
public PartP2PLight( ItemStack is )
|
||||
public PartP2PLight( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chanRender( MENetworkChannelsChanged c )
|
||||
public void chanRender( final MENetworkChannelsChanged c )
|
||||
{
|
||||
this.onTunnelNetworkChange();
|
||||
super.chanRender( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void powerRender( MENetworkPowerStatusChange c )
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.onTunnelNetworkChange();
|
||||
super.powerRender( c );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.writeToStream( data );
|
||||
data.writeInt( this.output ? this.lastValue : 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.readFromStream( data );
|
||||
this.lastValue = data.readInt();
|
||||
@@ -85,22 +85,22 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity te = this.getTile();
|
||||
World w = te.getWorld();
|
||||
final TileEntity te = this.getTile();
|
||||
final World w = te.getWorld();
|
||||
|
||||
int newLevel = w.getLight( te.getPos().offset( side.getFacing() ) );
|
||||
final int newLevel = w.getLight( te.getPos().offset( side.getFacing() ) );
|
||||
|
||||
if( this.lastValue != newLevel && this.proxy.isActive() )
|
||||
{
|
||||
this.lastValue = newLevel;
|
||||
try
|
||||
{
|
||||
for( PartP2PLight out : this.getOutputs() )
|
||||
for( final PartP2PLight out : this.getOutputs() )
|
||||
{
|
||||
out.setLightLevel( this.lastValue );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -133,17 +133,17 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setLightLevel( int out )
|
||||
public void setLightLevel( final int out )
|
||||
{
|
||||
this.lastValue = out;
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
private int blockLight( int emit )
|
||||
private int blockLight( final int emit )
|
||||
{
|
||||
if( this.opacity < 0 )
|
||||
{
|
||||
TileEntity te = this.getTile();
|
||||
final TileEntity te = this.getTile();
|
||||
this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( side.getFacing() ) );
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound tag )
|
||||
public void readFromNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.readFromNBT( tag );
|
||||
if( tag.hasKey( "opacity" ) )
|
||||
@@ -162,7 +162,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound tag )
|
||||
public void writeToNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.writeToNBT( tag );
|
||||
tag.setFloat( "opacity", this.opacity );
|
||||
@@ -180,7 +180,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
{
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PLight src = this.getInput();
|
||||
final PartP2PLight src = this.getInput();
|
||||
if( src != null && src.proxy.isActive() )
|
||||
{
|
||||
this.setLightLevel( src.lastValue );
|
||||
@@ -197,13 +197,13 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.LightTunnel.min, TickRates.LightTunnel.max, false, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
return this.doWork() ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
IFluidHandler cachedTank;
|
||||
private int tmpUsed;
|
||||
|
||||
public PartP2PLiquids( ItemStack is )
|
||||
public PartP2PLiquids( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
this.cachedTank = null;
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PLiquids in = this.getInput();
|
||||
final PartP2PLiquids in = this.getInput();
|
||||
if( in != null )
|
||||
{
|
||||
in.onTunnelNetworkChange();
|
||||
@@ -74,11 +74,11 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill( EnumFacing from, FluidStack resource, boolean doFill )
|
||||
public int fill( final EnumFacing from, final FluidStack resource, final boolean doFill )
|
||||
{
|
||||
Stack<PartP2PLiquids> stack = this.getDepth();
|
||||
final Stack<PartP2PLiquids> stack = this.getDepth();
|
||||
|
||||
for( PartP2PLiquids t : stack )
|
||||
for( final PartP2PLiquids t : stack )
|
||||
{
|
||||
if( t == this )
|
||||
{
|
||||
@@ -88,14 +88,14 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
|
||||
stack.push( this );
|
||||
|
||||
List<PartP2PLiquids> list = this.getOutputs( resource.getFluid() );
|
||||
final List<PartP2PLiquids> list = this.getOutputs( resource.getFluid() );
|
||||
int requestTotal = 0;
|
||||
|
||||
Iterator<PartP2PLiquids> i = list.iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
PartP2PLiquids l = i.next();
|
||||
IFluidHandler tank = l.getTarget();
|
||||
final PartP2PLiquids l = i.next();
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), resource.copy(), false );
|
||||
@@ -141,16 +141,16 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
int used = 0;
|
||||
while( i.hasNext() )
|
||||
{
|
||||
PartP2PLiquids l = i.next();
|
||||
final PartP2PLiquids l = i.next();
|
||||
|
||||
FluidStack insert = resource.copy();
|
||||
final FluidStack insert = resource.copy();
|
||||
insert.amount = (int) Math.ceil( insert.amount * ( (double) l.tmpUsed / (double) requestTotal ) );
|
||||
if( insert.amount > available )
|
||||
{
|
||||
insert.amount = available;
|
||||
}
|
||||
|
||||
IFluidHandler tank = l.getTarget();
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), insert.copy(), true );
|
||||
@@ -184,15 +184,15 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return s;
|
||||
}
|
||||
|
||||
List<PartP2PLiquids> getOutputs( Fluid input )
|
||||
List<PartP2PLiquids> getOutputs( final Fluid input )
|
||||
{
|
||||
List<PartP2PLiquids> outs = new LinkedList<PartP2PLiquids>();
|
||||
final List<PartP2PLiquids> outs = new LinkedList<PartP2PLiquids>();
|
||||
|
||||
try
|
||||
{
|
||||
for( PartP2PLiquids l : this.getOutputs() )
|
||||
for( final PartP2PLiquids l : this.getOutputs() )
|
||||
{
|
||||
IFluidHandler handler = l.getTarget();
|
||||
final IFluidHandler handler = l.getTarget();
|
||||
if( handler != null )
|
||||
{
|
||||
if( handler.canFill( l.side.getFacing().getOpposite(), input ) )
|
||||
@@ -202,7 +202,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return this.cachedTank;
|
||||
}
|
||||
|
||||
TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) );
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( side.getFacing() ) );
|
||||
if( te instanceof IFluidHandler )
|
||||
{
|
||||
return this.cachedTank = (IFluidHandler) te;
|
||||
@@ -232,31 +232,31 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain( EnumFacing from, FluidStack resource, boolean doDrain )
|
||||
public FluidStack drain( final EnumFacing from, final FluidStack resource, final boolean doDrain )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain( EnumFacing from, int maxDrain, boolean doDrain )
|
||||
public FluidStack drain( final EnumFacing from, final int maxDrain, final boolean doDrain )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill( EnumFacing from, Fluid fluid )
|
||||
public boolean canFill( final EnumFacing from, final Fluid fluid )
|
||||
{
|
||||
return !this.output && from == this.side.getFacing() && !this.getOutputs( fluid ).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain( EnumFacing from, Fluid fluid )
|
||||
public boolean canDrain( final EnumFacing from, final Fluid fluid )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo( EnumFacing from )
|
||||
public FluidTankInfo[] getTankInfo( final EnumFacing from )
|
||||
{
|
||||
if( from == this.side.getFacing() )
|
||||
{
|
||||
@@ -269,7 +269,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
{
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PLiquids tun = this.getInput();
|
||||
final PartP2PLiquids tun = this.getInput();
|
||||
if( tun != null )
|
||||
{
|
||||
return ACTIVE_TANK;
|
||||
@@ -284,7 +284,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return ACTIVE_TANK;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :(
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
int power;
|
||||
boolean recursive = false;
|
||||
|
||||
public PartP2PRedstone( ItemStack is )
|
||||
public PartP2PRedstone( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateA( MENetworkBootingStatusChange bs )
|
||||
public void changeStateA( final MENetworkBootingStatusChange bs )
|
||||
{
|
||||
this.setNetworkReady();
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
{
|
||||
if( this.output )
|
||||
{
|
||||
PartP2PRedstone in = this.getInput();
|
||||
final PartP2PRedstone in = this.getInput();
|
||||
if( in != null )
|
||||
{
|
||||
this.putInput( in.power );
|
||||
@@ -64,7 +64,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
}
|
||||
}
|
||||
|
||||
protected void putInput( Object o )
|
||||
protected void putInput( final Object o )
|
||||
{
|
||||
if( this.recursive )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
this.recursive = true;
|
||||
if( this.output && this.proxy.isActive() )
|
||||
{
|
||||
int newPower = (Integer) o;
|
||||
final int newPower = (Integer) o;
|
||||
if( this.power != newPower )
|
||||
{
|
||||
this.power = newPower;
|
||||
@@ -86,36 +86,36 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
|
||||
public void notifyNeighbors()
|
||||
{
|
||||
World worldObj = this.tile.getWorld();
|
||||
final World worldObj = this.tile.getWorld();
|
||||
|
||||
Platform.notifyBlocksOfNeighbors( worldObj,tile.getPos());
|
||||
|
||||
// and this cause sometimes it can go thought walls.
|
||||
for ( EnumFacing face : EnumFacing.VALUES )
|
||||
for ( final EnumFacing face : EnumFacing.VALUES )
|
||||
Platform.notifyBlocksOfNeighbors( worldObj,tile.getPos().offset( face ) );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateB( MENetworkChannelsChanged bs )
|
||||
public void changeStateB( final MENetworkChannelsChanged bs )
|
||||
{
|
||||
this.setNetworkReady();
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateC( MENetworkPowerStatusChange bs )
|
||||
public void changeStateC( final MENetworkPowerStatusChange bs )
|
||||
{
|
||||
this.setNetworkReady();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound tag )
|
||||
public void readFromNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.readFromNBT( tag );
|
||||
this.power = tag.getInteger( "power" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound tag )
|
||||
public void writeToNBT( final NBTTagCompound tag )
|
||||
{
|
||||
super.writeToNBT( tag );
|
||||
tag.setInteger( "power", this.power );
|
||||
@@ -137,10 +137,10 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
{
|
||||
if( !this.output )
|
||||
{
|
||||
BlockPos target = tile.getPos().offset( side.getFacing() );
|
||||
final BlockPos target = tile.getPos().offset( side.getFacing() );
|
||||
|
||||
IBlockState state = this.tile.getWorld().getBlockState( target );
|
||||
Block b = state.getBlock();
|
||||
final IBlockState state = this.tile.getWorld().getBlockState( target );
|
||||
final Block b = state.getBlock();
|
||||
if( b != null && !this.output )
|
||||
{
|
||||
EnumFacing srcSide = this.side.getFacing();
|
||||
@@ -178,16 +178,16 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
return this.output ? this.power : 0;
|
||||
}
|
||||
|
||||
private void sendToOutput( int power )
|
||||
private void sendToOutput( final int power )
|
||||
{
|
||||
try
|
||||
{
|
||||
for( PartP2PRedstone rs : this.getOutputs() )
|
||||
for( final PartP2PRedstone rs : this.getOutputs() )
|
||||
{
|
||||
rs.putInput( power );
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
public boolean output;
|
||||
public long freq;
|
||||
|
||||
public PartP2PTunnel( ItemStack is )
|
||||
public PartP2PTunnel( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
public TunnelCollection<T> getCollection( Collection<PartP2PTunnel> collection, Class<? extends PartP2PTunnel> c )
|
||||
public TunnelCollection<T> getCollection( final Collection<PartP2PTunnel> collection, final Class<? extends PartP2PTunnel> c )
|
||||
{
|
||||
if( this.type.matches( c ) )
|
||||
{
|
||||
@@ -88,16 +88,15 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
return null;
|
||||
}
|
||||
|
||||
PartP2PTunnel tunnel;
|
||||
try
|
||||
{
|
||||
tunnel = this.proxy.getP2P().getInput( this.freq );
|
||||
final PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq );
|
||||
if( this.getClass().isInstance( tunnel ) )
|
||||
{
|
||||
return (T) tunnel;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -114,7 +113,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( IPartCollisionHelper bch )
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 5, 5, 12, 11, 11, 13 );
|
||||
bch.addBox( 3, 3, 13, 13, 13, 14 );
|
||||
@@ -123,7 +122,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTypeTexture(renderer) );
|
||||
|
||||
@@ -140,7 +139,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
* @param renderer
|
||||
* @return If enabled it returns the icon of an AE quartz block, else vanilla quartz block icon
|
||||
*/
|
||||
protected IAESprite getTypeTexture(ModelGenerator renderer )
|
||||
protected IAESprite getTypeTexture( final ModelGenerator renderer )
|
||||
{
|
||||
final Optional<Block> maybeBlock = AEApi.instance().definitions().blocks().quartz().maybeBlock();
|
||||
if( maybeBlock.isPresent() )
|
||||
@@ -155,7 +154,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTypeTexture(renderer) );
|
||||
|
||||
@@ -182,7 +181,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack( PartItemStack type )
|
||||
public ItemStack getItemStack( final PartItemStack type )
|
||||
{
|
||||
if( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick )
|
||||
{
|
||||
@@ -199,7 +198,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.output = data.getBoolean( "output" );
|
||||
@@ -207,7 +206,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "output", this.output );
|
||||
@@ -227,44 +226,44 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
ItemStack is = player.inventory.getCurrentItem();
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
|
||||
// UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor( is.getItem() );
|
||||
// AELog.info( "ID:" + id.toString() + " : " + is.getItemDamage() );
|
||||
|
||||
TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is );
|
||||
final TunnelType tt = AEApi.instance().registries().p2pTunnel().getTunnelTypeByItem( is );
|
||||
if( is != null && is.getItem() instanceof IMemoryCard )
|
||||
{
|
||||
IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
NBTTagCompound data = mc.getData( is );
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final NBTTagCompound data = mc.getData( is );
|
||||
|
||||
ItemStack newType = ItemStack.loadItemStackFromNBT( data );
|
||||
long freq = data.getLong( "freq" );
|
||||
final ItemStack newType = ItemStack.loadItemStackFromNBT( data );
|
||||
final long freq = data.getLong( "freq" );
|
||||
|
||||
if( newType != null )
|
||||
{
|
||||
if( newType.getItem() instanceof IPartItem )
|
||||
{
|
||||
IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType );
|
||||
final IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType );
|
||||
if( testPart instanceof PartP2PTunnel )
|
||||
{
|
||||
this.getHost().removePart( this.side, true );
|
||||
AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
IPart newBus = this.getHost().getPart( dir );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
final IPart newBus = this.getHost().getPart( dir );
|
||||
|
||||
if( newBus instanceof PartP2PTunnel )
|
||||
{
|
||||
PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
newTunnel.output = true;
|
||||
|
||||
try
|
||||
{
|
||||
P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
final P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
p2p.updateFreq( newTunnel, freq );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -288,7 +287,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
switch( tt )
|
||||
{
|
||||
case LIGHT:
|
||||
for( ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelLight().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
@@ -304,7 +303,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
*/
|
||||
|
||||
case FLUID:
|
||||
for( ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
@@ -320,21 +319,21 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
*/
|
||||
|
||||
case ITEM:
|
||||
for( ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
case ME:
|
||||
for( ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelME().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
case REDSTONE:
|
||||
for( ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : parts.p2PTunnelRedstone().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
@@ -363,25 +362,25 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
if( newType != null && !Platform.isSameItem( newType, this.is ) )
|
||||
{
|
||||
boolean oldOutput = this.output;
|
||||
long myFreq = this.freq;
|
||||
final boolean oldOutput = this.output;
|
||||
final long myFreq = this.freq;
|
||||
|
||||
this.getHost().removePart( this.side, false );
|
||||
AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
IPart newBus = this.getHost().getPart( dir );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
final IPart newBus = this.getHost().getPart( dir );
|
||||
|
||||
if( newBus instanceof PartP2PTunnel )
|
||||
{
|
||||
PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
newTunnel.output = oldOutput;
|
||||
newTunnel.onTunnelNetworkChange();
|
||||
|
||||
try
|
||||
{
|
||||
P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
final P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
p2p.updateFreq( newTunnel, myFreq );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -396,16 +395,16 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
ItemStack is = player.inventory.getCurrentItem();
|
||||
final ItemStack is = player.inventory.getCurrentItem();
|
||||
if( is != null && is.getItem() instanceof IMemoryCard )
|
||||
{
|
||||
IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
long newFreq = this.freq;
|
||||
boolean wasOutput = this.output;
|
||||
final boolean wasOutput = this.output;
|
||||
this.output = false;
|
||||
|
||||
if( wasOutput || this.freq == 0 )
|
||||
@@ -417,15 +416,15 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
{
|
||||
this.proxy.getP2P().updateFreq( this, newFreq );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
this.onTunnelConfigChange();
|
||||
|
||||
ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench );
|
||||
String type = p2pItem.getUnlocalizedName();
|
||||
final ItemStack p2pItem = this.getItemStack( PartItemStack.Wrench );
|
||||
final String type = p2pItem.getUnlocalizedName();
|
||||
|
||||
p2pItem.writeToNBT( data );
|
||||
data.setLong( "freq", this.freq );
|
||||
@@ -448,20 +447,20 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture( ModelGenerator renderer )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return CableBusTextures.BlockP2PTunnel2.getIcon().getAtlas();
|
||||
}
|
||||
|
||||
protected void queueTunnelDrain( PowerUnits unit, double f )
|
||||
protected void queueTunnelDrain( final PowerUnits unit, final double f )
|
||||
{
|
||||
double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS );
|
||||
final double ae_to_tax = unit.convertTo( PowerUnits.AE, f * AEConfig.TUNNEL_POWER_LOSS );
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
public final Connections connection = new Connections( this );
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
|
||||
|
||||
public PartP2PTunnelME( ItemStack is )
|
||||
public PartP2PTunnelME( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL );
|
||||
@@ -60,14 +60,14 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound extra )
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.outerProxy.readFromNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound extra )
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.outerProxy.writeToNBT( extra );
|
||||
@@ -83,7 +83,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
{
|
||||
this.proxy.getTick().wakeDevice( this.proxy.getNode() );
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType( AEPartLocation dir )
|
||||
public AECableType getCableConnectionType( final AEPartLocation dir )
|
||||
{
|
||||
return AECableType.DENSE;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPartHostInfo( AEPartLocation side, IPartHost host, TileEntity tile )
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
super.setPartHostInfo( side, host, tile );
|
||||
this.outerProxy.setValidSides( EnumSet.of( side.getFacing() ) );
|
||||
@@ -124,20 +124,20 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( IGridNode node )
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.METunnel.min, TickRates.METunnel.max, true, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TickRateModulation tickingRequest( IGridNode node, int ticksSinceLastCall )
|
||||
public TickRateModulation tickingRequest( final IGridNode node, final int ticksSinceLastCall )
|
||||
{
|
||||
// just move on...
|
||||
try
|
||||
@@ -166,7 +166,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
return TickRateModulation.SLEEP;
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// meh?
|
||||
}
|
||||
@@ -174,11 +174,11 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
return TickRateModulation.IDLE;
|
||||
}
|
||||
|
||||
public void updateConnections( Connections connections )
|
||||
public void updateConnections( final Connections connections )
|
||||
{
|
||||
if( connections.destroy )
|
||||
{
|
||||
for( TunnelConnection cw : this.connection.connections.values() )
|
||||
for( final TunnelConnection cw : this.connection.connections.values() )
|
||||
{
|
||||
cw.c.destroy();
|
||||
}
|
||||
@@ -188,10 +188,10 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
else if( connections.create )
|
||||
{
|
||||
|
||||
Iterator<TunnelConnection> i = this.connection.connections.values().iterator();
|
||||
final Iterator<TunnelConnection> i = this.connection.connections.values().iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
TunnelConnection cw = i.next();
|
||||
final TunnelConnection cw = i.next();
|
||||
try
|
||||
{
|
||||
if( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() )
|
||||
@@ -205,16 +205,16 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
LinkedList<PartP2PTunnelME> newSides = new LinkedList<PartP2PTunnelME>();
|
||||
final LinkedList<PartP2PTunnelME> newSides = new LinkedList<PartP2PTunnelME>();
|
||||
try
|
||||
{
|
||||
for( PartP2PTunnelME me : this.getOutputs() )
|
||||
for( final PartP2PTunnelME me : this.getOutputs() )
|
||||
{
|
||||
if( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null )
|
||||
{
|
||||
@@ -222,13 +222,13 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
}
|
||||
|
||||
for( PartP2PTunnelME me : newSides )
|
||||
for( final PartP2PTunnelME me : newSides )
|
||||
{
|
||||
try
|
||||
{
|
||||
connections.connections.put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
|
||||
}
|
||||
catch( FailedConnection e )
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
final TileEntity start = this.getTile();
|
||||
final TileEntity end = me.getTile();
|
||||
@@ -239,7 +239,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( GridAccessException e )
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
@@ -45,14 +45,14 @@ import appeng.client.texture.IAESprite;
|
||||
public abstract class AbstractPartDisplay extends AbstractPartReporting
|
||||
{
|
||||
|
||||
public AbstractPartDisplay( ItemStack is )
|
||||
public AbstractPartDisplay( final ItemStack is )
|
||||
{
|
||||
super( is, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon();
|
||||
final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon();
|
||||
|
||||
@@ -88,13 +88,13 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
private Integer dspList;
|
||||
|
||||
@Reflected
|
||||
public AbstractPartMonitor( ItemStack is )
|
||||
public AbstractPartMonitor( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
|
||||
@@ -105,7 +105,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.writeToStream( data );
|
||||
|
||||
@@ -134,7 +134,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
boolean needRedraw = super.readFromStream( data );
|
||||
|
||||
@@ -159,7 +159,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -225,12 +225,12 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
}
|
||||
|
||||
protected void extractItem( EntityPlayer player )
|
||||
protected void extractItem( final EntityPlayer player )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void updateReportingValue( IMEMonitor<IAEItemStack> itemInventory )
|
||||
private void updateReportingValue( final IMEMonitor<IAEItemStack> itemInventory )
|
||||
{
|
||||
if( this.configuredItem != null )
|
||||
{
|
||||
@@ -260,7 +260,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDynamic( double x, double y, double z, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderDynamic( final double x, final double y, final double z, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
if( this.dspList == null )
|
||||
{
|
||||
@@ -310,7 +310,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
return this.configuredItem;
|
||||
}
|
||||
|
||||
private void tesrRenderScreen( WorldRenderer wr, IAEItemStack ais )
|
||||
private void tesrRenderScreen( final WorldRenderer wr, final IAEItemStack ais )
|
||||
{
|
||||
// GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||
|
||||
@@ -403,14 +403,14 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWatcher( IStackWatcher newWatcher )
|
||||
public void updateWatcher( final IStackWatcher newWatcher )
|
||||
{
|
||||
this.myWatcher = newWatcher;
|
||||
this.configureWatchers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStackChange( IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan )
|
||||
public void onStackChange( final IItemList o, final IAEStack fullStack, final IAEStack diffStack, final BaseActionSource src, final StorageChannel chan )
|
||||
{
|
||||
if( this.configuredItem != null )
|
||||
{
|
||||
@@ -435,7 +435,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showNetworkInfo( MovingObjectPosition where )
|
||||
public boolean showNetworkInfo( final MovingObjectPosition where )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting
|
||||
private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartMonitor_Colored;
|
||||
private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartMonitor_Colored;
|
||||
|
||||
public AbstractPartPanel( ItemStack is )
|
||||
public AbstractPartPanel( final ItemStack is )
|
||||
{
|
||||
super( is, false );
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
|
||||
@@ -98,7 +98,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( BlockPos pos, IPartRenderHelper rh, ModelGenerator renderer )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon();
|
||||
final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon();
|
||||
|
||||
@@ -69,12 +69,12 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
private int clientFlags = 0; // sent as byte.
|
||||
private float opacity = -1;
|
||||
|
||||
public AbstractPartReporting( ItemStack is )
|
||||
public AbstractPartReporting( final ItemStack is )
|
||||
{
|
||||
this( is, false );
|
||||
}
|
||||
|
||||
protected AbstractPartReporting( ItemStack is, boolean requireChannel )
|
||||
protected AbstractPartReporting( final ItemStack is, final boolean requireChannel )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -90,7 +90,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public final void bootingRender( MENetworkBootingStatusChange c )
|
||||
public final void bootingRender( final MENetworkBootingStatusChange c )
|
||||
{
|
||||
if( !this.isLightSource() )
|
||||
{
|
||||
@@ -99,13 +99,13 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public final void powerRender( MENetworkPowerStatusChange c )
|
||||
public final void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void getBoxes( IPartCollisionHelper bch )
|
||||
public final void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
bch.addBox( 2, 2, 14, 14, 14, 16 );
|
||||
bch.addBox( 4, 4, 13, 12, 12, 14 );
|
||||
@@ -119,7 +119,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "opacity" ) )
|
||||
@@ -130,7 +130,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setFloat( "opacity", this.opacity );
|
||||
@@ -138,7 +138,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream( ByteBuf data ) throws IOException
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.writeToStream( data );
|
||||
this.clientFlags = this.getSpin() & 3;
|
||||
@@ -169,7 +169,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFromStream( ByteBuf data ) throws IOException
|
||||
public boolean readFromStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.readFromStream( data );
|
||||
final int oldFlags = this.getClientFlags();
|
||||
@@ -189,7 +189,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
final TileEntity te = this.getTile();
|
||||
|
||||
@@ -230,7 +230,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPlacement( EntityPlayer player, ItemStack held, AEPartLocation side )
|
||||
public final void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
|
||||
@@ -245,7 +245,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
}
|
||||
}
|
||||
|
||||
private final int blockLight( int emit )
|
||||
private final int blockLight( final int emit )
|
||||
{
|
||||
if( this.opacity < 0 )
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
private final IConfigManager cm = new ConfigManager( this );
|
||||
private final AppEngInternalInventory viewCell = new AppEngInternalInventory( this, 5 );
|
||||
|
||||
public AbstractPartTerminal( ItemStack is )
|
||||
public AbstractPartTerminal( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
super.getDrops( drops, wrenched );
|
||||
|
||||
@@ -94,7 +94,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.cm.readFromNBT( data );
|
||||
@@ -102,7 +102,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
this.cm.writeToNBT( data );
|
||||
@@ -110,7 +110,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !super.onPartActivate( player, pos ) )
|
||||
{
|
||||
@@ -129,7 +129,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
return false;
|
||||
}
|
||||
|
||||
public GuiBridge getGui( EntityPlayer player )
|
||||
public GuiBridge getGui( final EntityPlayer player )
|
||||
{
|
||||
return GuiBridge.GUI_ME;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
this.host.markForSave();
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
||||
private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartConversionMonitor_Colored;
|
||||
|
||||
@Reflected
|
||||
public PartConversionMonitor( ItemStack is )
|
||||
public PartConversionMonitor( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartShiftActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -121,7 +121,7 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void extractItem( EntityPlayer player )
|
||||
protected void extractItem( final EntityPlayer player )
|
||||
{
|
||||
final IAEItemStack input = (IAEItemStack) this.getDisplayed();
|
||||
if( input != null )
|
||||
|
||||
@@ -40,13 +40,13 @@ public class PartCraftingTerminal extends AbstractPartTerminal
|
||||
private final AppEngInternalInventory craftingGrid = new AppEngInternalInventory( this, 9 );
|
||||
|
||||
@Reflected
|
||||
public PartCraftingTerminal( ItemStack is )
|
||||
public PartCraftingTerminal( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
super.getDrops( drops, wrenched );
|
||||
|
||||
@@ -60,21 +60,21 @@ public class PartCraftingTerminal extends AbstractPartTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.craftingGrid.readFromNBT( data, "craftingGrid" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
this.craftingGrid.writeToNBT( data, "craftingGrid" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGui( EntityPlayer p )
|
||||
public GuiBridge getGui( final EntityPlayer p )
|
||||
{
|
||||
int x = (int) p.posX;
|
||||
int y = (int) p.posY;
|
||||
@@ -94,7 +94,7 @@ public class PartCraftingTerminal extends AbstractPartTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "crafting" ) )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PartDarkPanel extends AbstractPartPanel
|
||||
{
|
||||
|
||||
@Reflected
|
||||
public PartDarkPanel( ItemStack is )
|
||||
public PartDarkPanel( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ public class PartInterfaceTerminal extends AbstractPartDisplay
|
||||
private static final CableBusTextures FRONT_DARK_ICON = CableBusTextures.PartInterfaceTerm_Dark;
|
||||
private static final CableBusTextures FRONT_COLORED_ICON = CableBusTextures.PartInterfaceTerm_Colored;
|
||||
|
||||
public PartInterfaceTerminal( ItemStack is )
|
||||
public PartInterfaceTerminal( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate( EntityPlayer player, Vec3 pos )
|
||||
public boolean onPartActivate( final EntityPlayer player, final Vec3 pos )
|
||||
{
|
||||
if( !super.onPartActivate( player, pos ) )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PartPanel extends AbstractPartPanel
|
||||
{
|
||||
|
||||
@Reflected
|
||||
public PartPanel( ItemStack is )
|
||||
public PartPanel( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
private boolean craftingMode = true;
|
||||
|
||||
@Reflected
|
||||
public PartPatternTerminal( ItemStack is )
|
||||
public PartPatternTerminal( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops( List<ItemStack> drops, boolean wrenched )
|
||||
public void getDrops( final List<ItemStack> drops, final boolean wrenched )
|
||||
{
|
||||
for( final ItemStack is : this.pattern )
|
||||
{
|
||||
@@ -66,7 +66,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound data )
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.setCraftingRecipe( data.getBoolean( "craftingMode" ) );
|
||||
@@ -76,7 +76,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound data )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "craftingMode", this.craftingMode );
|
||||
@@ -86,7 +86,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGui( EntityPlayer p )
|
||||
public GuiBridge getGui( final EntityPlayer p )
|
||||
{
|
||||
int x = (int) p.posX;
|
||||
int y = (int) p.posY;
|
||||
@@ -106,7 +106,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack )
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
if( inv == this.pattern && slot == 1 )
|
||||
{
|
||||
@@ -161,14 +161,14 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
return this.craftingMode;
|
||||
}
|
||||
|
||||
public void setCraftingRecipe( boolean craftingMode )
|
||||
public void setCraftingRecipe( final boolean craftingMode )
|
||||
{
|
||||
this.craftingMode = craftingMode;
|
||||
this.fixCraftingRecipes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( String name )
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
if( name.equals( "crafting" ) )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PartSemiDarkPanel extends AbstractPartPanel
|
||||
{
|
||||
|
||||
@Reflected
|
||||
public PartSemiDarkPanel( ItemStack is )
|
||||
public PartSemiDarkPanel( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PartStorageMonitor extends AbstractPartMonitor
|
||||
private static final CableBusTextures FRONT_COLORED_ICON_LOCKED = CableBusTextures.PartStorageMonitor_Colored_Locked;
|
||||
|
||||
@Reflected
|
||||
public PartStorageMonitor( ItemStack is )
|
||||
public PartStorageMonitor( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import appeng.client.texture.CableBusTextures;
|
||||
public class PartTerminal extends AbstractPartTerminal
|
||||
{
|
||||
|
||||
public PartTerminal( ItemStack is )
|
||||
public PartTerminal( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user