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 committed 2015-10-30 18:52:20 +01:00
1 parent 1ea48fb389
commit 500fc47490
463 files changed
+5670 -3757

No files matched your search

@@ -19,15 +19,17 @@
package appeng.client.texture;
import javax.annotation.Nonnull;
import net.minecraft.util.IIcon;
public class FlippableIcon implements IIcon
{
protected IIcon original;
boolean flip_u;
boolean flip_v;
private IIcon original;
private boolean flip_u;
private boolean flip_v;
public FlippableIcon( final IIcon o )
{
@@ -36,87 +38,87 @@ public class FlippableIcon implements IIcon
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
}
this.original = o;
this.flip_u = false;
this.flip_v = false;
this.setOriginal( o );
this.setFlipU( false );
this.setFlipV( false );
}
@Override
public int getIconWidth()
{
return this.original.getIconWidth();
return this.getOriginal().getIconWidth();
}
@Override
public int getIconHeight()
{
return this.original.getIconHeight();
return this.getOriginal().getIconHeight();
}
@Override
public float getMinU()
{
if( this.flip_u )
if( this.isFlipU() )
{
return this.original.getMaxU();
return this.getOriginal().getMaxU();
}
return this.original.getMinU();
return this.getOriginal().getMinU();
}
@Override
public float getMaxU()
{
if( this.flip_u )
if( this.isFlipU() )
{
return this.original.getMinU();
return this.getOriginal().getMinU();
}
return this.original.getMaxU();
return this.getOriginal().getMaxU();
}
@Override
public float getInterpolatedU( final double px )
{
if( this.flip_u )
if( this.isFlipU() )
{
return this.original.getInterpolatedU( 16 - px );
return this.getOriginal().getInterpolatedU( 16 - px );
}
return this.original.getInterpolatedU( px );
return this.getOriginal().getInterpolatedU( px );
}
@Override
public float getMinV()
{
if( this.flip_v )
if( this.isFlipV() )
{
return this.original.getMaxV();
return this.getOriginal().getMaxV();
}
return this.original.getMinV();
return this.getOriginal().getMinV();
}
@Override
public float getMaxV()
{
if( this.flip_v )
if( this.isFlipV() )
{
return this.original.getMinV();
return this.getOriginal().getMinV();
}
return this.original.getMaxV();
return this.getOriginal().getMaxV();
}
@Override
public float getInterpolatedV( final double px )
{
if( this.flip_v )
if( this.isFlipV() )
{
return this.original.getInterpolatedV( 16 - px );
return this.getOriginal().getInterpolatedV( 16 - px );
}
return this.original.getInterpolatedV( px );
return this.getOriginal().getInterpolatedV( px );
}
@Override
public String getIconName()
{
return this.original.getIconName();
return this.getOriginal().getIconName();
}
public IIcon getOriginal()
@@ -126,14 +128,39 @@ public class FlippableIcon implements IIcon
public void setFlip( final boolean u, final boolean v )
{
this.flip_u = u;
this.flip_v = v;
this.setFlipU( u );
this.setFlipV( v );
}
public int setFlip( final int orientation )
{
this.flip_u = ( orientation & 8 ) == 8;
this.flip_v = ( orientation & 16 ) == 16;
this.setFlipU( ( orientation & 8 ) == 8 );
this.setFlipV( ( orientation & 16 ) == 16 );
return orientation & 7;
}
boolean isFlipU()
{
return this.flip_u;
}
void setFlipU( final boolean flipU )
{
this.flip_u = flipU;
}
boolean isFlipV()
{
return this.flip_v;
}
void setFlipV( final boolean flipV )
{
this.flip_v = flipV;
}
public void setOriginal( @Nonnull final IIcon original )
{
this.original = original;
}
}