Use qualified method and field access
This commit is contained in:
@@ -123,7 +123,7 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
|
||||
protected int getStackLimit( int slot, @Nonnull ItemStack stack )
|
||||
{
|
||||
return Math.min( getSlotLimit( slot ), stack.getMaxStackSize() );
|
||||
return Math.min( this.getSlotLimit( slot ), stack.getMaxStackSize() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,8 +151,8 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
ItemStack existing = getStackInSlot( slot );
|
||||
int limit = getStackLimit( slot, stack );
|
||||
ItemStack existing = this.getStackInSlot( slot );
|
||||
int limit = this.getStackLimit( slot, stack );
|
||||
|
||||
if( !existing.isEmpty() )
|
||||
{
|
||||
@@ -181,7 +181,8 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
{
|
||||
existing.grow( reachedLimit ? limit : stack.getCount() );
|
||||
}
|
||||
fireOnChangeInventory( slot, InvOperation.INSERT, ItemStack.EMPTY, reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack );
|
||||
this.fireOnChangeInventory( slot, InvOperation.INSERT, ItemStack.EMPTY,
|
||||
reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack );
|
||||
}
|
||||
return reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, stack.getCount() - limit ) : ItemStack.EMPTY;
|
||||
}
|
||||
@@ -198,7 +199,7 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
if( !simulate )
|
||||
{
|
||||
this.inv[slot] = null;
|
||||
fireOnChangeInventory( slot, InvOperation.EXTRACT, split, ItemStack.EMPTY );
|
||||
this.fireOnChangeInventory( slot, InvOperation.EXTRACT, split, ItemStack.EMPTY );
|
||||
}
|
||||
return split;
|
||||
}
|
||||
@@ -207,7 +208,7 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
if( !simulate )
|
||||
{
|
||||
split.grow( -amount );
|
||||
fireOnChangeInventory( slot, InvOperation.EXTRACT, ItemHandlerHelper.copyStackWithSize( split, amount ), ItemStack.EMPTY );
|
||||
this.fireOnChangeInventory( slot, InvOperation.EXTRACT, ItemHandlerHelper.copyStackWithSize( split, amount ), ItemStack.EMPTY );
|
||||
}
|
||||
return ItemHandlerHelper.copyStackWithSize( split, amount );
|
||||
}
|
||||
@@ -245,7 +246,7 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
removed = added = ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
fireOnChangeInventory( slot, InvOperation.SET, removed, added );
|
||||
this.fireOnChangeInventory( slot, InvOperation.SET, removed, added );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +284,6 @@ public class AppEngInternalAEInventory implements IInternalItemHandler, Iterable
|
||||
@Override
|
||||
public void markDirty( int slot )
|
||||
{
|
||||
fireOnChangeInventory( slot, InvOperation.DIRTY, ItemStack.EMPTY, ItemStack.EMPTY );
|
||||
this.fireOnChangeInventory( slot, InvOperation.DIRTY, ItemStack.EMPTY, ItemStack.EMPTY );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,14 +70,14 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
||||
@Override
|
||||
public int getSlotLimit( int slot )
|
||||
{
|
||||
return maxStack;
|
||||
return this.maxStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStackInSlot( int slot, @Nonnull ItemStack stack )
|
||||
{
|
||||
currentOp = InvOperation.SET;
|
||||
previousStack = getStackInSlot( slot );
|
||||
this.currentOp = InvOperation.SET;
|
||||
this.previousStack = this.getStackInSlot( slot );
|
||||
super.setStackInSlot( slot, stack );
|
||||
}
|
||||
|
||||
@@ -85,13 +85,13 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
||||
@Nonnull
|
||||
public ItemStack insertItem( int slot, @Nonnull ItemStack stack, boolean simulate )
|
||||
{
|
||||
if( filter != null && !filter.allowInsert( this, slot, stack ) )
|
||||
if( this.filter != null && !this.filter.allowInsert( this, slot, stack ) )
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
currentOp = InvOperation.INSERT;
|
||||
previousStack = getStackInSlot( slot ).copy();
|
||||
this.currentOp = InvOperation.INSERT;
|
||||
this.previousStack = this.getStackInSlot( slot ).copy();
|
||||
return super.insertItem( slot, stack, simulate );
|
||||
}
|
||||
|
||||
@@ -99,13 +99,13 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
||||
@Nonnull
|
||||
public ItemStack extractItem( int slot, int amount, boolean simulate )
|
||||
{
|
||||
if( filter != null && !filter.allowExtract( this, slot, amount ) )
|
||||
if( this.filter != null && !this.filter.allowExtract( this, slot, amount ) )
|
||||
{
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
currentOp = InvOperation.EXTRACT;
|
||||
previousStack = getStackInSlot( slot );
|
||||
this.currentOp = InvOperation.EXTRACT;
|
||||
this.previousStack = this.getStackInSlot( slot );
|
||||
return super.extractItem( slot, amount, simulate );
|
||||
}
|
||||
|
||||
@@ -114,18 +114,18 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
||||
{
|
||||
if( this.getTileEntity() != null && this.eventsEnabled() )
|
||||
{
|
||||
ItemStack added = getStackInSlot( slot ).copy();
|
||||
ItemStack removed = previousStack.copy();
|
||||
ItemStack added = this.getStackInSlot( slot ).copy();
|
||||
ItemStack removed = this.previousStack.copy();
|
||||
|
||||
if( currentOp == InvOperation.INSERT )
|
||||
if( this.currentOp == InvOperation.INSERT )
|
||||
{
|
||||
added.grow( -removed.getCount() );
|
||||
}
|
||||
else if( currentOp == InvOperation.EXTRACT )
|
||||
else if( this.currentOp == InvOperation.EXTRACT )
|
||||
{
|
||||
removed.grow( -added.getCount() );
|
||||
}
|
||||
this.getTileEntity().onChangeInventory( this, slot, currentOp, removed, added );
|
||||
this.getTileEntity().onChangeInventory( this, slot, this.currentOp, removed, added );
|
||||
}
|
||||
super.onContentsChanged( slot );
|
||||
}
|
||||
@@ -157,14 +157,14 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
||||
}
|
||||
if( this.filter != null )
|
||||
{
|
||||
return filter.allowInsert( this, slot, stack );
|
||||
return this.filter.allowInsert( this, slot, stack );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeToNBT( final NBTTagCompound data, final String name )
|
||||
{
|
||||
data.setTag( name, serializeNBT() );
|
||||
data.setTag( name, this.serializeNBT() );
|
||||
}
|
||||
|
||||
public void readFromNBT( final NBTTagCompound data, final String name )
|
||||
@@ -172,13 +172,13 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
||||
final NBTTagCompound c = data.getCompoundTag( name );
|
||||
if( c != null )
|
||||
{
|
||||
readFromNBT( c );
|
||||
this.readFromNBT( c );
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
deserializeNBT( data );
|
||||
this.deserializeNBT( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user