Always use qualified access for fields and methods

This commit is contained in:
yueh
2017-07-20 21:27:22 +02:00
parent f9cad0758d
commit 15582fd1df
211 changed files with 1086 additions and 1086 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
public PartType getType()
{
return ItemPart.instance.getTypeByStack( is );
return ItemPart.instance.getTypeByStack( this.is );
}
@Override
@@ -716,7 +716,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public float getCableConnectionLength( AECableType cable )
{
return getPart( AEPartLocation.INTERNAL ) instanceof IPartCable ? getPart( AEPartLocation.INTERNAL ).getCableConnectionLength( cable ) : -1;
return this.getPart( AEPartLocation.INTERNAL ) instanceof IPartCable ? this.getPart( AEPartLocation.INTERNAL ).getCableConnectionLength( cable ) : -1;
}
@Override
@@ -1150,7 +1150,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
@Override
public CableBusRenderState getRenderState()
{
PartCable cable = (PartCable) getCenter();
PartCable cable = (PartCable) this.getCenter();
CableBusRenderState renderState = new CableBusRenderState();
@@ -1209,13 +1209,13 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
for( EnumFacing facing : EnumFacing.values() )
{
FacadeRenderState facadeState = getFacadeRenderState( facing );
FacadeRenderState facadeState = this.getFacadeRenderState( facing );
if( facadeState != null )
{
renderState.getFacades().put( facing, facadeState );
}
IPart part = getPart( facing );
IPart part = this.getPart( facing );
if( part == null )
{
@@ -1253,14 +1253,14 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
private FacadeRenderState getFacadeRenderState( EnumFacing side )
{
// Store the "masqueraded" itemstack for the given side, if there is a facade
IFacadePart facade = getFacade( side.ordinal() );
IFacadePart facade = this.getFacade( side.ordinal() );
if( facade != null )
{
ItemStack textureItem = facade.getTextureItem();
IBlockState blockState = facade.getBlockState();
if( blockState != null && textureItem != null )
{
EnumSet<EnumFacing> openFaces = calculateFaceOpenFaces( side );
EnumSet<EnumFacing> openFaces = this.calculateFaceOpenFaces( side );
return new FacadeRenderState( blockState, openFaces, textureItem );
}
}
@@ -1271,10 +1271,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
private EnumSet<EnumFacing> calculateFaceOpenFaces( EnumFacing side )
{
final EnumSet<EnumFacing> out = EnumSet.of( side, side.getOpposite() );
final IFacadePart facade = getFacade( side.ordinal() );
final IFacadePart facade = this.getFacade( side.ordinal() );
IBlockAccess blockAccess = getTile().getWorld();
BlockPos pos = getTile().getPos();
IBlockAccess blockAccess = this.getTile().getWorld();
BlockPos pos = this.getTile().getPos();
for( final EnumFacing it : EnumFacing.values() )
{
if( !out.contains( it ) && this.hasAlphaDiff( blockAccess.getTileEntity( pos.offset( it ) ), side, facade ) )
@@ -1285,7 +1285,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if( out.contains( EnumFacing.UP ) && ( side.getFrontOffsetX() != 0 || side.getFrontOffsetZ() != 0 ) )
{
final IFacadePart fp = getFacade( EnumFacing.UP.ordinal() );
final IFacadePart fp = this.getFacade( EnumFacing.UP.ordinal() );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( EnumFacing.UP );
@@ -1294,7 +1294,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if( out.contains( EnumFacing.DOWN ) && ( side.getFrontOffsetX() != 0 || side.getFrontOffsetZ() != 0 ) )
{
final IFacadePart fp = getFacade( EnumFacing.DOWN.ordinal() );
final IFacadePart fp = this.getFacade( EnumFacing.DOWN.ordinal() );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( EnumFacing.DOWN );
@@ -1303,7 +1303,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if( out.contains( EnumFacing.SOUTH ) && ( side.getFrontOffsetX() != 0 ) )
{
final IFacadePart fp = getFacade( EnumFacing.SOUTH.ordinal() );
final IFacadePart fp = this.getFacade( EnumFacing.SOUTH.ordinal() );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( EnumFacing.SOUTH );
@@ -1312,7 +1312,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if( out.contains( EnumFacing.NORTH ) && ( side.getFrontOffsetX() != 0 ) )
{
final IFacadePart fp = getFacade( EnumFacing.NORTH.ordinal() );
final IFacadePart fp = this.getFacade( EnumFacing.NORTH.ordinal() );
if( fp != null && ( fp.isTransparent() == facade.isTransparent() ) )
{
out.remove( EnumFacing.NORTH );
@@ -146,7 +146,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
final EnumFacing facingRight, facingUp;
AEPartLocation location = getSide();
AEPartLocation location = this.getSide();
switch( location )
{
case UP:
@@ -598,7 +598,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( getConnections(), isPowered(), isActive() );
return MODELS.getModel( this.getConnections(), this.isPowered(), this.isActive() );
}
}
@@ -360,11 +360,11 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
@Override
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
if( this.isActive() && this.isPowered() )
{
return MODELS_HAS_CHANNEL;
}
else if( isPowered() )
else if( this.isPowered() )
{
return MODELS_ON;
}
@@ -281,7 +281,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
{
final EnumFacing facingRight, facingUp;
AEPartLocation location = getSide();
AEPartLocation location = this.getSide();
switch( location )
{
case UP:
@@ -617,7 +617,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( getConnections(), isPowered(), isActive() );
return MODELS.getModel( this.getConnections(), this.isPowered(), this.isActive() );
}
}
@@ -108,7 +108,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( getConnections(), isPowered(), isActive() );
return MODELS.getModel( this.getConnections(), this.isPowered(), this.isActive() );
}
}
@@ -317,11 +317,11 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
@Override
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
if( this.isActive() && this.isPowered() )
{
return MODELS_HAS_CHANNEL;
}
else if( isPowered() )
else if( this.isPowered() )
{
return MODELS_ON;
}
@@ -563,17 +563,17 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@Override
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
if( this.isActive() && this.isPowered() )
{
return isLevelEmitterOn() ? MODEL_ON_HAS_CHANNEL : MODEL_OFF_HAS_CHANNEL;
return this.isLevelEmitterOn() ? MODEL_ON_HAS_CHANNEL : MODEL_OFF_HAS_CHANNEL;
}
else if( isPowered() )
else if( this.isPowered() )
{
return isLevelEmitterOn() ? MODEL_ON_ON : MODEL_OFF_ON;
return this.isLevelEmitterOn() ? MODEL_ON_ON : MODEL_OFF_ON;
}
else
{
return isLevelEmitterOn() ? MODEL_ON_OFF : MODEL_OFF_OFF;
return this.isLevelEmitterOn() ? MODEL_ON_OFF : MODEL_OFF_OFF;
}
}
}
@@ -76,7 +76,7 @@ public class PlaneBakedModel implements IBakedModel
{
if( side == null )
{
return quads;
return this.quads;
}
else
{
@@ -105,7 +105,7 @@ public class PlaneBakedModel implements IBakedModel
@Override
public TextureAtlasSprite getParticleTexture()
{
return frontTexture;
return this.frontTexture;
}
@Override
@@ -76,28 +76,28 @@ public final class PlaneConnections
public boolean isUp()
{
return up;
return this.up;
}
public boolean isRight()
{
return right;
return this.right;
}
public boolean isDown()
{
return down;
return this.down;
}
public boolean isLeft()
{
return left;
return this.left;
}
// The combination of connections expressed as a number ranging from [0,15]
public int getIndex()
{
return getIndex( up, right, down, left );
return getIndex( this.up, this.right, this.down, this.left );
}
private static int getIndex( boolean up, boolean right, boolean down, boolean left )
@@ -108,7 +108,7 @@ public final class PlaneConnections
// Returns a suffix that expresses the connection states as a string
public String getFilenameSuffix()
{
String suffix = Integer.toBinaryString( getIndex() );
String suffix = Integer.toBinaryString( this.getIndex() );
return Strings.padStart( suffix, 4, '0' );
}
@@ -119,22 +119,22 @@ public final class PlaneConnections
{
return true;
}
if( o == null || getClass() != o.getClass() )
if( o == null || this.getClass() != o.getClass() )
{
return false;
}
PlaneConnections that = (PlaneConnections) o;
return up == that.up && right == that.right && down == that.down && left == that.left;
return this.up == that.up && this.right == that.right && this.down == that.down && this.left == that.left;
}
@Override
public int hashCode()
{
int result = ( up ? 1 : 0 );
result = 31 * result + ( right ? 1 : 0 );
result = 31 * result + ( down ? 1 : 0 );
result = 31 * result + ( left ? 1 : 0 );
int result = ( this.up ? 1 : 0 );
result = 31 * result + ( this.right ? 1 : 0 );
result = 31 * result + ( this.down ? 1 : 0 );
result = 31 * result + ( this.left ? 1 : 0 );
return result;
}
}
@@ -62,17 +62,17 @@ public class PlaneModel implements IModel
@Override
public Collection<ResourceLocation> getTextures()
{
return Lists.newArrayList( frontTexture, sidesTexture, backTexture );
return Lists.newArrayList( this.frontTexture, this.sidesTexture, this.backTexture );
}
@Override
public IBakedModel bake( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
{
TextureAtlasSprite frontSprite = bakedTextureGetter.apply( frontTexture );
TextureAtlasSprite sidesSprite = bakedTextureGetter.apply( sidesTexture );
TextureAtlasSprite backSprite = bakedTextureGetter.apply( backTexture );
TextureAtlasSprite frontSprite = bakedTextureGetter.apply( this.frontTexture );
TextureAtlasSprite sidesSprite = bakedTextureGetter.apply( this.sidesTexture );
TextureAtlasSprite backSprite = bakedTextureGetter.apply( this.backTexture );
return new PlaneBakedModel( format, frontSprite, sidesSprite, backSprite, connections );
return new PlaneBakedModel( format, frontSprite, sidesSprite, backSprite, this.connections );
}
@Override
@@ -74,24 +74,24 @@ class PlaneModels
{
if( hasPower && hasChannel )
{
return modelsHasChannel.get( connections );
return this.modelsHasChannel.get( connections );
}
else if( hasPower )
{
return modelsOn.get( connections );
return this.modelsOn.get( connections );
}
else
{
return modelsOff.get( connections );
return this.modelsOff.get( connections );
}
}
public List<IPartModel> getModels()
{
List<IPartModel> result = new ArrayList<>();
modelsOff.values().forEach( result::add );
modelsOn.values().forEach( result::add );
modelsHasChannel.values().forEach( result::add );
this.modelsOff.values().forEach( result::add );
this.modelsOn.values().forEach( result::add );
this.modelsHasChannel.values().forEach( result::add );
return result;
}
@@ -71,13 +71,13 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
ItemStack orgInput = iox.getItemStack();
ItemStack remaining = orgInput;
int slotCount = itemHandler.getSlots();
int slotCount = this.itemHandler.getSlots();
boolean simulate = ( type == Actionable.SIMULATE );
// This uses a brute force approach and tries to jam it in every slot the inventory exposes.
for( int i = 0; i < slotCount && !remaining.isEmpty(); i++ )
{
remaining = itemHandler.insertItem( i, remaining, simulate );
remaining = this.itemHandler.insertItem( i, remaining, simulate );
}
// At this point, we still have some items left...
@@ -107,9 +107,9 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
final boolean simulate = ( mode == Actionable.SIMULATE );
for( int i = 0; i < itemHandler.getSlots(); i++ )
for( int i = 0; i < this.itemHandler.getSlots(); i++ )
{
ItemStack stackInInventorySlot = itemHandler.getStackInSlot( i );
ItemStack stackInInventorySlot = this.itemHandler.getStackInSlot( i );
if( !Platform.itemComparisons().isSameItem( stackInInventorySlot, requestedItemStack ) )
{
@@ -124,7 +124,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
// maxSize, even if we request more. So even if it returns a valid stack, it might have more stuff.
do
{
extracted = itemHandler.extractItem( i, remainingCurrentSlot, simulate );
extracted = this.itemHandler.extractItem( i, remainingCurrentSlot, simulate );
if( !extracted.isEmpty() )
{
if( extracted.getCount() > remainingCurrentSlot )
@@ -132,7 +132,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
// Something broke. It should never return more than we requested...
// We're going to silently eat the remainder
AELog.warn( "Mod that provided item handler %1 is broken. Returned %2 items, even though we requested %3.",
itemHandler.getClass().getSimpleName(), extracted.getCount(), remainingCurrentSlot );
this.itemHandler.getClass().getSimpleName(), extracted.getCount(), remainingCurrentSlot );
extracted.setCount( remainingCurrentSlot );
}
@@ -174,17 +174,17 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
private ItemStack getItemStackInCachedSlot( int pos )
{
if( pos > cachedStacks.length )
if( pos > this.cachedStacks.length )
{
return ItemStack.EMPTY;
}
if( cachedStacks[pos] == null )
if( this.cachedStacks[pos] == null )
{
return ItemStack.EMPTY;
}
return cachedStacks[pos];
return this.cachedStacks[pos];
}
@Override
@@ -192,39 +192,39 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
{
LinkedList<IAEItemStack> changes = new LinkedList<>();
int slots = itemHandler.getSlots();
int slots = this.itemHandler.getSlots();
// Make room for new slots
if( slots > cachedStacks.length )
if( slots > this.cachedStacks.length )
{
cachedStacks = Arrays.copyOf( cachedStacks, slots );
cachedAeStacks = Arrays.copyOf( cachedAeStacks, slots );
this.cachedStacks = Arrays.copyOf( this.cachedStacks, slots );
this.cachedAeStacks = Arrays.copyOf( this.cachedAeStacks, slots );
}
for( int slot = 0; slot < slots; slot++ )
{
// Save the old stuff
ItemStack oldIS = getItemStackInCachedSlot( slot );
IAEItemStack oldAeIS = cachedAeStacks[slot];
ItemStack oldIS = this.getItemStackInCachedSlot( slot );
IAEItemStack oldAeIS = this.cachedAeStacks[slot];
ItemStack newIS = itemHandler.getStackInSlot( slot );
ItemStack newIS = this.itemHandler.getStackInSlot( slot );
if( this.isDifferent( newIS, oldIS ) )
{
addItemChange( slot, oldAeIS, newIS, changes );
this.addItemChange( slot, oldAeIS, newIS, changes );
}
else if( !newIS.isEmpty() && !oldIS.isEmpty() )
{
addPossibleStackSizeChange( slot, oldAeIS, newIS, changes );
this.addPossibleStackSizeChange( slot, oldAeIS, newIS, changes );
}
}
// Handle cases where the number of slots actually is lower now than before
if( slots < cachedStacks.length )
if( slots < this.cachedStacks.length )
{
for( int slot = slots; slot < cachedStacks.length; slot++ )
for( int slot = slots; slot < this.cachedStacks.length; slot++ )
{
IAEItemStack aeStack = cachedAeStacks[slot];
IAEItemStack aeStack = this.cachedAeStacks[slot];
if( aeStack != null )
{
IAEItemStack a = aeStack.copy();
@@ -234,8 +234,8 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
}
// Reduce the cache size
cachedStacks = Arrays.copyOf( cachedStacks, slots );
cachedAeStacks = Arrays.copyOf( cachedAeStacks, slots );
this.cachedStacks = Arrays.copyOf( this.cachedStacks, slots );
this.cachedAeStacks = Arrays.copyOf( this.cachedAeStacks, slots );
}
if( !changes.isEmpty() )
@@ -252,8 +252,8 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
private void addItemChange( int slot, IAEItemStack oldAeIS, ItemStack newIS, List<IAEItemStack> changes )
{
// Completely different item
cachedStacks[slot] = newIS;
cachedAeStacks[slot] = AEItemStack.create( newIS );
this.cachedStacks[slot] = newIS;
this.cachedAeStacks[slot] = AEItemStack.create( newIS );
// If we had a stack previously in this slot, notify the newtork about its disappearance
if( oldAeIS != null )
@@ -263,9 +263,9 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
}
// Notify the network about the new stack. Note that this is null if newIS was null
if( cachedAeStacks[slot] != null )
if( this.cachedAeStacks[slot] != null )
{
changes.add( cachedAeStacks[slot] );
changes.add( this.cachedAeStacks[slot] );
}
}
@@ -279,8 +279,8 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
IAEItemStack stack = oldAeIS.copy();
stack.setStackSize( newIS.getCount() );
cachedStacks[slot] = newIS;
cachedAeStacks[slot] = stack;
this.cachedStacks[slot] = newIS;
this.cachedAeStacks[slot] = stack;
final IAEItemStack a = stack.copy();
a.setStackSize( diff );
@@ -307,7 +307,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
final IMEMonitorHandlerReceiver<IAEItemStack> key = l.getKey();
if( key.isValid( l.getValue() ) )
{
key.postChange( this, a, mySource );
key.postChange( this, a, this.mySource );
}
else
{
@@ -326,9 +326,9 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
public IItemList<IAEItemStack> getAvailableItems( IItemList<IAEItemStack> out )
{
for( int i = 0; i < itemHandler.getSlots(); i++ )
for( int i = 0; i < this.itemHandler.getSlots(); i++ )
{
out.addStorage( AEItemStack.create( itemHandler.getStackInSlot( i ) ) );
out.addStorage( AEItemStack.create( this.itemHandler.getStackInSlot( i ) ) );
}
return out;
@@ -418,11 +418,11 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
@Override
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
if( this.isActive() && this.isPowered() )
{
return MODELS_HAS_CHANNEL;
}
else if( isPowered() )
else if( this.isPowered() )
{
return MODELS_ON;
}
@@ -435,13 +435,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
@Override
public boolean hasCapability( Capability<?> capabilityClass )
{
return this.duality.hasCapability( capabilityClass, getSide().getFacing() );
return this.duality.hasCapability( capabilityClass, this.getSide().getFacing() );
}
@Override
public <T> T getCapability( Capability<T> capabilityClass )
{
return this.duality.getCapability( capabilityClass, getSide().getFacing() );
return this.duality.getCapability( capabilityClass, this.getSide().getFacing() );
}
@Override
@@ -57,11 +57,11 @@ public class PartInvertedToggleBus extends PartToggleBus
@Override
public IPartModel getStaticModels()
{
if( hasRedstoneFlag() && isActive() && isPowered() )
if( this.hasRedstoneFlag() && this.isActive() && this.isPowered() )
{
return MODELS_HAS_CHANNEL;
}
else if( hasRedstoneFlag() && isPowered() )
else if( this.hasRedstoneFlag() && this.isPowered() )
{
return MODELS_ON;
}
@@ -374,7 +374,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
if( accessor != null )
{
IStorageMonitorable inventory = accessor.getInventory( mySrc );
IStorageMonitorable inventory = accessor.getInventory( this.mySrc );
if( inventory != null )
{
return inventory.getItemInventory();
@@ -422,7 +422,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
this.monitor = null;
if( target != null )
{
IMEInventory<? extends IAEStack> inv = getInventoryWrapper( target );
IMEInventory<? extends IAEStack> inv = this.getInventoryWrapper( target );
if( inv instanceof MEMonitorIInventory )
{
@@ -586,11 +586,11 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
@Override
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
if( this.isActive() && this.isPowered() )
{
return MODELS_HAS_CHANNEL;
}
else if( isPowered() )
else if( this.isPowered() )
{
return MODELS_ON;
}
@@ -88,7 +88,7 @@ public class PartToggleBus extends PartBasicState
public boolean hasRedstoneFlag()
{
return ( getClientFlags() & REDSTONE_FLAG ) == REDSTONE_FLAG;
return ( this.getClientFlags() & REDSTONE_FLAG ) == REDSTONE_FLAG;
}
protected boolean getIntention()
@@ -225,11 +225,11 @@ public class PartToggleBus extends PartBasicState
@Override
public IPartModel getStaticModels()
{
if( hasRedstoneFlag() && isActive() && isPowered() )
if( this.hasRedstoneFlag() && this.isActive() && this.isPowered() )
{
return MODELS_HAS_CHANNEL;
}
else if( hasRedstoneFlag() && isPowered() )
else if( this.hasRedstoneFlag() && this.isPowered() )
{
return MODELS_ON;
}
@@ -384,7 +384,7 @@ public class PartCable extends AEBasePart implements IPartCable
// Only read channels if there's a part on this side or a cable connection
// This works only because cables are always read *last* from the packet update for
// a cable bus
if( conOnSide || getHost().getPart( d ) != null )
if( conOnSide || this.getHost().getPart( d ) != null )
{
ch = ( (int) data.readByte() ) & 0xFF;
}
@@ -407,7 +407,7 @@ public class PartCable extends AEBasePart implements IPartCable
public int getChannelsOnSide( EnumFacing side )
{
if( !powered )
if( !this.powered )
{
return 0;
}
@@ -46,33 +46,33 @@ class P2PModels
public P2PModels( String frontModelPath )
{
ResourceLocation frontModel = new ResourceLocation( AppEng.MOD_ID, frontModelPath );
modelsOff = new PartModel( MODEL_STATUS_OFF, frontModel );
modelsOn = new PartModel( MODEL_STATUS_ON, frontModel );
modelsHasChannel = new PartModel( MODEL_STATUS_HAS_CHANNEL, frontModel );
this.modelsOff = new PartModel( MODEL_STATUS_OFF, frontModel );
this.modelsOn = new PartModel( MODEL_STATUS_ON, frontModel );
this.modelsHasChannel = new PartModel( MODEL_STATUS_HAS_CHANNEL, frontModel );
}
public IPartModel getModel( boolean hasPower, boolean hasChannel )
{
if( hasPower && hasChannel )
{
return modelsHasChannel;
return this.modelsHasChannel;
}
else if( hasPower )
{
return modelsOn;
return this.modelsOn;
}
else
{
return modelsOff;
return this.modelsOff;
}
}
public List<IPartModel> getModels()
{
List<IPartModel> result = new ArrayList<>();
result.add( modelsOff );
result.add( modelsOn );
result.add( modelsHasChannel );
result.add( this.modelsOff );
result.add( this.modelsOn );
result.add( this.modelsHasChannel );
return result;
}
@@ -60,7 +60,7 @@ public class PartP2PFEPower extends PartP2PTunnel<PartP2PFEPower> implements IEn
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
public PartP2PFEPower( ItemStack is )
@@ -113,7 +113,7 @@ public class PartP2PFluids extends PartP2PTunnel<PartP2PFluids> implements IFlui
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
@Override
@@ -257,7 +257,7 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements I
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
}
@@ -306,7 +306,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
public ItemStack insertItem( int slot, @Nonnull ItemStack stack, boolean simulate )
{
if( isItemValidForSlot( slot, stack ) )
if( this.isItemValidForSlot( slot, stack ) )
{
AdaptorIInventory adaptor = new AdaptorIInventory( this.getDestination() );
@@ -348,7 +348,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
@Override
public int getSlotLimit( int slot )
{
if( slot >= 0 && slot < getDestination().getSizeInventory() )
if( slot >= 0 && slot < this.getDestination().getSizeInventory() )
{
return this.getDestination().getInventoryStackLimit();
}
@@ -498,7 +498,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
@Override
@@ -228,7 +228,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
}
@@ -61,7 +61,7 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
@Override
@@ -211,7 +211,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
}
@@ -264,7 +264,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
return MODELS.getModel( this.isPowered(), this.isActive() );
}
}
@@ -254,7 +254,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
EnumFacing facing = this.getSide().getFacing();
TesrRenderHelper.moveToFace( facing );
TesrRenderHelper.rotateToFace( facing, getSpin() );
TesrRenderHelper.rotateToFace( facing, this.getSpin() );
TesrRenderHelper.renderItem2dWithAmount( ais, 0.8f, 0.17f );
GlStateManager.popMatrix();
@@ -319,9 +319,9 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
protected IPartModel selectModel( IPartModel off, IPartModel on, IPartModel hasChannel, IPartModel lockedOff, IPartModel lockedOn, IPartModel lockedHasChannel )
{
if( isActive() )
if( this.isActive() )
{
if( isLocked() )
if( this.isLocked() )
{
return lockedHasChannel;
}
@@ -330,9 +330,9 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
return hasChannel;
}
}
else if( isPowered() )
else if( this.isPowered() )
{
if( isLocked() )
if( this.isLocked() )
{
return lockedOn;
}
@@ -343,7 +343,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
}
else
{
if( isLocked() )
if( this.isLocked() )
{
return lockedOff;
}
@@ -292,11 +292,11 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
protected IPartModel selectModel( IPartModel offModels, IPartModel onModels, IPartModel hasChannelModels )
{
if( isActive() )
if( this.isActive() )
{
return hasChannelModels;
}
else if( isPowered() )
else if( this.isPowered() )
{
return onModels;
}
@@ -187,7 +187,7 @@ public class PartConversionMonitor extends AbstractPartMonitor
@Override
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL,
return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL,
MODELS_LOCKED_OFF, MODELS_LOCKED_ON, MODELS_LOCKED_HAS_CHANNEL );
}
@@ -117,7 +117,7 @@ public class PartCraftingTerminal extends AbstractPartTerminal
@Override
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
}
@@ -55,7 +55,7 @@ public class PartDarkPanel extends AbstractPartPanel
@Override
public IPartModel getStaticModels()
{
return isPowered() ? MODELS_ON : MODELS_OFF;
return this.isPowered() ? MODELS_ON : MODELS_OFF;
}
}
@@ -74,7 +74,7 @@ public class PartInterfaceTerminal extends AbstractPartDisplay
@Override
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
}
@@ -55,7 +55,7 @@ public class PartPanel extends AbstractPartPanel
@Override
public IPartModel getStaticModels()
{
return isPowered() ? MODELS_ON : MODELS_OFF;
return this.isPowered() ? MODELS_ON : MODELS_OFF;
}
}
@@ -216,6 +216,6 @@ public class PartPatternTerminal extends AbstractPartTerminal
@Override
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
}
@@ -56,7 +56,7 @@ public class PartSemiDarkPanel extends AbstractPartPanel
@Override
public IPartModel getStaticModels()
{
return isPowered() ? MODELS_ON : MODELS_OFF;
return this.isPowered() ? MODELS_ON : MODELS_OFF;
}
}
@@ -64,7 +64,7 @@ public class PartStorageMonitor extends AbstractPartMonitor
@Override
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL,
return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL,
MODELS_LOCKED_OFF, MODELS_LOCKED_ON, MODELS_LOCKED_HAS_CHANNEL );
}
}
@@ -48,6 +48,6 @@ public class PartTerminal extends AbstractPartTerminal
@Override
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
}