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
@@ -53,16 +53,16 @@ import appeng.util.Platform;
public class SlotRestrictedInput extends AppEngSlot
{
public final PlacableItemType which;
private final PlacableItemType which;
private final InventoryPlayer p;
public boolean allowEdit = true;
public int stackLimit = -1;
private boolean allowEdit = true;
private int stackLimit = -1;
public SlotRestrictedInput( final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, final int y, final InventoryPlayer p )
{
super( i, slotIndex, x, y );
this.which = valid;
this.IIcon = valid.IIcon;
this.setIIcon( valid.IIcon );
this.p = p;
}
@@ -95,7 +95,7 @@ public class SlotRestrictedInput extends AppEngSlot
@Override
public boolean isItemValid( final ItemStack i )
{
if( !this.myContainer.isValidForSlot( this, i ) )
if( !this.getContainer().isValidForSlot( this, i ) )
{
return false;
}
@@ -114,7 +114,7 @@ public class SlotRestrictedInput extends AppEngSlot
return false;
}
if( !this.allowEdit )
if( !this.isAllowEdit() )
{
return false;
}
@@ -232,7 +232,7 @@ public class SlotRestrictedInput extends AppEngSlot
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
{
return this.allowEdit;
return this.isAllowEdit();
}
@Override
@@ -275,6 +275,16 @@ public class SlotRestrictedInput extends AppEngSlot
return false;
}
private boolean isAllowEdit()
{
return this.allowEdit;
}
public void setAllowEdit( final boolean allowEdit )
{
this.allowEdit = allowEdit;
}
public enum PlacableItemType
{
STORAGE_CELLS( 15 ), ORE( 16 + 15 ), STORAGE_COMPONENT( 3 * 16 + 15 ),