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
@@ -30,26 +30,26 @@ import appeng.tile.inventory.AppEngInternalInventory;
public class AppEngSlot extends Slot
{
public final int defX;
public final int defY;
public boolean isDraggable = true;
public boolean isPlayerSide = false;
public AEBaseContainer myContainer = null;
public int IIcon = -1;
public hasCalculatedValidness isValid;
public boolean isDisplay = false;
private final int defX;
private final int defY;
private boolean isDraggable = true;
private boolean isPlayerSide = false;
private AEBaseContainer myContainer = null;
private int IIcon = -1;
private hasCalculatedValidness isValid;
private boolean isDisplay = false;
public AppEngSlot( final IInventory inv, final int idx, final int x, final int y )
{
super( inv, idx, x, y );
this.defX = x;
this.defY = y;
this.isValid = hasCalculatedValidness.NotAvailable;
this.setIsValid( hasCalculatedValidness.NotAvailable );
}
public Slot setNotDraggable()
{
this.isDraggable = false;
this.setDraggable( false );
return this;
}
@@ -92,9 +92,9 @@ public class AppEngSlot extends Slot
return null;
}
if( this.isDisplay )
if( this.isDisplay() )
{
this.isDisplay = false;
this.setDisplay( false );
return this.getDisplayStack();
}
return super.getStack();
@@ -107,9 +107,9 @@ public class AppEngSlot extends Slot
{
super.putStack( par1ItemStack );
if( this.myContainer != null )
if( this.getContainer() != null )
{
this.myContainer.onSlotChange( this );
this.getContainer().onSlotChange( this );
}
}
}
@@ -126,7 +126,7 @@ public class AppEngSlot extends Slot
super.onSlotChanged();
}
this.isValid = hasCalculatedValidness.NotAvailable;
this.setIsValid( hasCalculatedValidness.NotAvailable );
}
@Override
@@ -167,7 +167,7 @@ public class AppEngSlot extends Slot
public int getIcon()
{
return this.IIcon;
return this.getIIcon();
}
public boolean isPlayerSide()
@@ -180,6 +180,71 @@ public class AppEngSlot extends Slot
return this.isEnabled();
}
public int getX()
{
return this.defX;
}
public int getY()
{
return this.defY;
}
private int getIIcon()
{
return this.IIcon;
}
public void setIIcon( final int iIcon )
{
this.IIcon = iIcon;
}
private boolean isDisplay()
{
return this.isDisplay;
}
public void setDisplay( final boolean isDisplay )
{
this.isDisplay = isDisplay;
}
public boolean isDraggable()
{
return this.isDraggable;
}
private void setDraggable( final boolean isDraggable )
{
this.isDraggable = isDraggable;
}
void setPlayerSide( final boolean isPlayerSide )
{
this.isPlayerSide = isPlayerSide;
}
public hasCalculatedValidness getIsValid()
{
return this.isValid;
}
public void setIsValid( final hasCalculatedValidness isValid )
{
this.isValid = isValid;
}
AEBaseContainer getContainer()
{
return this.myContainer;
}
public void setContainer( final AEBaseContainer myContainer )
{
this.myContainer = myContainer;
}
public enum hasCalculatedValidness
{
NotAvailable, Valid, Invalid