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 f054bd699b
commit e94a0cfccf
497 changed files with 7865 additions and 6908 deletions
@@ -43,17 +43,17 @@ import appeng.util.Platform;
public class CraftingTreeProcess
{
final CraftingTreeNode parent;
private final CraftingTreeNode parent;
final ICraftingPatternDetails details;
final CraftingJob job;
final Map<CraftingTreeNode, Long> nodes = new HashMap<CraftingTreeNode, Long>();
private final CraftingJob job;
private final Map<CraftingTreeNode, Long> nodes = new HashMap<CraftingTreeNode, Long>();
private final int depth;
public boolean possible = true;
World world;
long crafts = 0;
boolean containerItems;
boolean limitQty;
boolean fullSimulation;
boolean possible = true;
private World world;
private long crafts = 0;
private boolean containerItems;
private boolean limitQty;
private boolean fullSimulation;
private long bytes = 0;
public CraftingTreeProcess( final ICraftingGrid cc, final CraftingJob job, final ICraftingPatternDetails details, final CraftingTreeNode craftingTreeNode, final int depth )
@@ -169,7 +169,7 @@ public class CraftingTreeProcess
}
}
public boolean notRecursive( final ICraftingPatternDetails details )
boolean notRecursive( final ICraftingPatternDetails details )
{
return this.parent == null || this.parent.notRecursive( details );
}
@@ -183,7 +183,7 @@ public class CraftingTreeProcess
return ( remaining / stackSize ) + ( remaining % stackSize != 0 ? 1 : 0 );
}
public void request( final MECraftingInventory inv, final long i, final BaseActionSource src ) throws CraftBranchFailure, InterruptedException
void request( final MECraftingInventory inv, final long i, final BaseActionSource src ) throws CraftBranchFailure, InterruptedException
{
this.job.handlePausing();
@@ -196,7 +196,7 @@ public class CraftingTreeProcess
final IAEItemStack item = entry.getKey().getStack( entry.getValue() );
final IAEItemStack stack = entry.getKey().request( inv, item.getStackSize(), src );
ic.setInventorySlotContents( entry.getKey().slot, stack.getItemStack() );
ic.setInventorySlotContents( entry.getKey().getSlot(), stack.getItemStack() );
}
FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.world ), this.details.getOutput( ic, this.world ), ic );
@@ -248,7 +248,7 @@ public class CraftingTreeProcess
this.crafts += i;
}
public void dive( final CraftingJob job )
void dive( final CraftingJob job )
{
job.addTask( this.getAmountCrafted( this.parent.getStack( 1 ) ), this.crafts, this.details, this.depth );
for( final CraftingTreeNode pro : this.nodes.keySet() )
@@ -285,7 +285,7 @@ public class CraftingTreeProcess
throw new IllegalStateException( "Crafting Tree construction failed." );
}
public void setSimulate()
void setSimulate()
{
this.crafts = 0;
this.bytes = 0;
@@ -296,7 +296,7 @@ public class CraftingTreeProcess
}
}
public void setJob( final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src ) throws CraftBranchFailure
void setJob( final MECraftingInventory storage, final CraftingCPUCluster craftingCPUCluster, final BaseActionSource src ) throws CraftBranchFailure
{
craftingCPUCluster.addCrafting( this.details, this.crafts );
@@ -306,7 +306,7 @@ public class CraftingTreeProcess
}
}
public void getPlan( final IItemList<IAEItemStack> plan )
void getPlan( final IItemList<IAEItemStack> plan )
{
for( IAEItemStack i : this.details.getOutputs() )
{