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:
@@ -57,17 +57,17 @@ import appeng.util.Platform;
|
||||
public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
{
|
||||
|
||||
public static final int LEVEL_OFFSET = 200;
|
||||
public static final int SINGLE_OFFSET = LEVEL_OFFSET * 3;
|
||||
private static final int LEVEL_OFFSET = 200;
|
||||
private static final int SINGLE_OFFSET = LEVEL_OFFSET * 3;
|
||||
|
||||
public static final int CERTUS = 0;
|
||||
public static final int NETHER = SINGLE_OFFSET;
|
||||
public static final int FLUIX = SINGLE_OFFSET * 2;
|
||||
public static final int FINAL_STAGE = SINGLE_OFFSET * 3;
|
||||
|
||||
final ModelResourceLocation[] certus = new ModelResourceLocation[3];
|
||||
final ModelResourceLocation[] fluix = new ModelResourceLocation[3];
|
||||
final ModelResourceLocation[] nether = new ModelResourceLocation[3];
|
||||
private final ModelResourceLocation[] certus = new ModelResourceLocation[3];
|
||||
private final ModelResourceLocation[] fluix = new ModelResourceLocation[3];
|
||||
private final ModelResourceLocation[] nether = new ModelResourceLocation[3];
|
||||
|
||||
public ItemCrystalSeed()
|
||||
{
|
||||
@@ -78,10 +78,10 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerIcons( final ClientHelper ir, final String name )
|
||||
{
|
||||
final String preFix = name+".";
|
||||
final String preFix = name + ".";
|
||||
|
||||
this.certus[0] = ir.setIcon( this, preFix + "Certus" );
|
||||
this.certus[1] = ir.setIcon( this, preFix + "Certus2" );
|
||||
@@ -94,9 +94,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
this.fluix[0] = ir.setIcon( this, preFix + "Fluix" );
|
||||
this.fluix[1] = ir.setIcon( this, preFix + "Fluix2" );
|
||||
this.fluix[2] = ir.setIcon( this, preFix + "Fluix3" );
|
||||
|
||||
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this, new ItemMeshDefinition(){
|
||||
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(
|
||||
final ItemStack stack )
|
||||
@@ -139,9 +139,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
return list[2];
|
||||
}
|
||||
}
|
||||
});
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public static ResolverResult getResolver( final int certus2 )
|
||||
{
|
||||
|
||||
@@ -54,18 +54,18 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
// rather simple client side caching.
|
||||
private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<ItemStack, ItemStack>();
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private ModelResourceLocation res;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private ModelResourceLocation encodedPatternModel; // TODO: make encoded pattern model!
|
||||
|
||||
public ItemEncodedPattern()
|
||||
{
|
||||
this.setFeature( EnumSet.of( AEFeature.Patterns ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelResourceLocation res;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelResourceLocation encodedPatternModel; // TODO: make encoded pattern model!
|
||||
|
||||
@Override
|
||||
public void registerIcons(
|
||||
final ClientHelper proxy,
|
||||
@@ -74,34 +74,34 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
this.encodedPatternModel = this.res = proxy.setIcon( this, name );
|
||||
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this, new ItemMeshDefinition(){
|
||||
|
||||
|
||||
boolean recursive = false;
|
||||
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(
|
||||
final ItemStack stack )
|
||||
{
|
||||
if ( this.recursive == false )
|
||||
if( this.recursive == false )
|
||||
{
|
||||
this.recursive = true;
|
||||
|
||||
|
||||
final ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
|
||||
|
||||
final ItemStack is = iep.getOutput( stack );
|
||||
if ( Minecraft.getMinecraft().thePlayer.isSneaking() )
|
||||
if( Minecraft.getMinecraft().thePlayer.isSneaking() )
|
||||
{
|
||||
return ItemEncodedPattern.this.encodedPatternModel;
|
||||
}
|
||||
|
||||
|
||||
this.recursive = false;
|
||||
}
|
||||
|
||||
|
||||
return ItemEncodedPattern.this.res;
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( final ItemStack stack, final World w, final EntityPlayer player )
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ import appeng.items.AEBaseItem;
|
||||
public class ItemPaintBall extends AEBaseItem
|
||||
{
|
||||
|
||||
public static final int DAMAGE_THRESHOLD = 20;
|
||||
private static final int DAMAGE_THRESHOLD = 20;
|
||||
|
||||
public ItemPaintBall()
|
||||
{
|
||||
@@ -76,7 +76,7 @@ public class ItemPaintBall extends AEBaseItem
|
||||
return super.getItemStackDisplayName( is ) + " - " + this.getExtraName( is );
|
||||
}
|
||||
|
||||
public String getExtraName( final ItemStack is )
|
||||
private String getExtraName( final ItemStack is )
|
||||
{
|
||||
return ( is.getItemDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user