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
@@ -44,7 +44,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
private static final WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>> SHARED_TAG_COMPOUND = new WeakHashMap<SharedSearchObject, WeakReference<SharedSearchObject>>();
private final Item item;
private final int meta;
public SharedSearchObject sso;
private SharedSearchObject sso;
private int hash;
private IItemComparison comp;
@@ -72,7 +72,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
/*
* Returns an NBT Compound that is used for accelerating comparisons.
*/
public static synchronized NBTTagCompound getSharedTagCompound( final NBTTagCompound tagCompound, final ItemStack s )
static synchronized NBTTagCompound getSharedTagCompound( final NBTTagCompound tagCompound, final ItemStack s )
{
if( tagCompound.hasNoTags() )
{
@@ -99,18 +99,18 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
final SharedSearchObject cg = c.get();
if( cg != null )
{
return cg.shared; // I don't think I really need to check this
return cg.getShared(); // I don't think I really need to check this
}
// as its already certain to exist..
}
final AESharedNBT clone = AESharedNBT.createFromCompound( item, meta, tagCompound );
sso.compound = (NBTTagCompound) sso.compound.copy(); // prevent
sso.setCompound( (NBTTagCompound) sso.getCompound().copy() ); // prevent
// modification
// of data based
// on original
// item.
sso.shared = clone;
sso.setShared( clone );
clone.sso = sso;
SHARED_TAG_COMPOUND.put( sso, new WeakReference<SharedSearchObject>( sso ) );
@@ -125,7 +125,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
return ta instanceof AESharedNBT;
}
public static AESharedNBT createFromCompound( final Item itemID, final int damageValue, final NBTTagCompound c )
private static AESharedNBT createFromCompound( final Item itemID, final int damageValue, final NBTTagCompound c )
{
final AESharedNBT x = new AESharedNBT( itemID, damageValue );
@@ -145,7 +145,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
return x;
}
public int getHash()
int getHash()
{
return this.hash;
}