Reduces visibility of internal fields/methods

Reduces the visibility of all fields to private and create setters/getters
when necessary. Exceptions are fields with GuiSync as these need to be
public.

Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
yueh
2015-10-08 15:42:42 +02:00
parent 1ea48fb389
commit 500fc47490
463 changed files with 5670 additions and 3757 deletions
@@ -55,7 +55,6 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
public CopyMode copyMode = CopyMode.CLEAR_ON_REMOVE;
private ItemStack prevStack = null;
private int lastUpgrades = 0;
private ItemStack LastCell;
public ContainerCellWorkbench( final InventoryPlayer ip, final TileCellWorkbench te )
{
@@ -72,12 +71,12 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
}
}
public void nextCopyMode()
public void nextWorkBenchCopyMode()
{
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, Platform.nextEnum( this.getCopyMode() ) );
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, Platform.nextEnum( this.getWorkBenchCopyMode() ) );
}
public CopyMode getCopyMode()
private CopyMode getWorkBenchCopyMode()
{
return (CopyMode) this.workBench.getConfigManager().getSetting( Settings.COPY_MODE );
}
@@ -91,10 +90,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
@Override
protected void setupConfig()
{
final IInventory cell = this.upgradeable.getInventoryByName( "cell" );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) );
final IInventory cell = this.getUpgradeable().getInventoryByName( "cell" );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getInventoryPlayer() ) );
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
final IInventory upgradeInventory = new Upgrades();
// null, 3 * 8 );
@@ -115,7 +114,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
for( int z = 0; z < 8; z++ )
{
final int iSLot = zz * 8 + z;
this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.invPlayer ) );
this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.getInventoryPlayer() ) );
}
}
/*
@@ -148,7 +147,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
{
if( this.workBench.getWorldObj().getTileEntity( this.workBench.xCoord, this.workBench.yCoord, this.workBench.zCoord ) != this.workBench )
{
this.isContainerValid = false;
this.setValidContainer( false );
}
for( final Object crafter : this.crafters )
@@ -170,8 +169,8 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
}
}
this.copyMode = this.getCopyMode();
this.fzMode = this.getFuzzyMode();
this.setCopyMode( this.getWorkBenchCopyMode() );
this.setFuzzyMode( this.getWorkBenchFuzzyMode() );
}
this.prevStack = is;
@@ -196,7 +195,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
{
if( field.equals( "copyMode" ) )
{
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, this.copyMode );
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, this.getCopyMode() );
}
super.onUpdate( field, oldValue, newValue );
@@ -204,7 +203,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
public void clear()
{
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
for( int x = 0; x < inv.getSizeInventory(); x++ )
{
inv.setInventorySlotContents( x, null );
@@ -212,7 +211,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
this.detectAndSendChanges();
}
private FuzzyMode getFuzzyMode()
private FuzzyMode getWorkBenchFuzzyMode()
{
final ICellWorkbenchItem cwi = this.workBench.getCell();
if( cwi != null )
@@ -224,9 +223,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
public void partition()
{
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS );
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( this.getUpgradeable().getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS );
Iterator<IAEItemStack> i = new NullIterator<IAEItemStack>();
if( cellInv != null )
@@ -252,6 +251,16 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
this.detectAndSendChanges();
}
public CopyMode getCopyMode()
{
return this.copyMode;
}
private void setCopyMode( final CopyMode copyMode )
{
this.copyMode = copyMode;
}
private class Upgrades implements IInventory
{