Code cleanup

Added missing this, annotations, etc.
This commit is contained in:
yueh
2018-08-30 20:33:08 +02:00
parent fed12cb99f
commit a2091d10fe
77 changed files with 227 additions and 270 deletions
@@ -97,7 +97,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
{
if( this.cellItems == null )
{
this.cellItems = getChannel().createList();
this.cellItems = this.getChannel().createList();
this.loadCellItems();
}
@@ -186,7 +186,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
{
if( this.cellItems == null )
{
this.cellItems = getChannel().createList();
this.cellItems = this.getChannel().createList();
}
this.cellItems.resetStatus(); // clears totals and stuff.
@@ -299,14 +299,14 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
@Override
public long getUsedBytes()
{
final long bytesForItemCount = ( this.getStoredItemCount() + this.getUnusedItemCount() ) / itemsPerByte;
final long bytesForItemCount = ( this.getStoredItemCount() + this.getUnusedItemCount() ) / this.itemsPerByte;
return this.getStoredItemTypes() * this.getBytesPerType() + bytesForItemCount;
}
@Override
public long getRemainingItemCount()
{
final long remaining = this.getFreeBytes() * itemsPerByte + this.getUnusedItemCount();
final long remaining = this.getFreeBytes() * this.itemsPerByte + this.getUnusedItemCount();
return remaining > 0 ? remaining : 0;
}
@@ -320,7 +320,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
return 0;
}
return itemsPerByte - div;
return this.itemsPerByte - div;
}
@Override
@@ -183,7 +183,7 @@ public class BasicCellInventory<T extends IAEStack<T>> extends AbstractCellInven
if( this.canHoldNewItem() ) // room for new type, and for at least one item!
{
final int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * itemsPerByte;
final int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * this.itemsPerByte;
if( remainingItemCount > 0 )
{
if( input.getStackSize() > remainingItemCount )
@@ -267,7 +267,7 @@ public class BasicCellInventory<T extends IAEStack<T>> extends AbstractCellInven
final T t;
try
{
t = getChannel().createFromNBT( compoundTag );
t = this.getChannel().createFromNBT( compoundTag );
if( t == null )
{
AELog.warn( "Removing item " + compoundTag + " from storage cell because the associated item type couldn't be found." );
@@ -64,7 +64,7 @@ public class ItemWatcher implements IStackWatcher
@Override
public boolean remove( final IAEStack o )
{
return this.myInterests.remove( o ) && this.gsc.getInterestManager().remove( (IAEStack) o, this );
return this.myInterests.remove( o ) && this.gsc.getInterestManager().remove( o, this );
}
@Override