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
@@ -31,8 +31,8 @@ import net.minecraft.item.ItemStack;
public class BlockStackSrc implements IStackSrc
{
public final Block block;
public final int damage;
private final Block block;
private final int damage;
private final boolean enabled;
public BlockStackSrc( final Block block, final int damage, final ActivityState state )
@@ -30,7 +30,7 @@ import appeng.api.util.AEColoredItemDefinition;
public final class ColoredItemDefinition implements AEColoredItemDefinition
{
final ItemStackSrc[] colors = new ItemStackSrc[17];
private final ItemStackSrc[] colors = new ItemStackSrc[17];
public void add( final AEColor v, final ItemStackSrc is )
{
@@ -96,6 +96,6 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
return false;
}
return comparableItem.getItem() == is.getItem() && comparableItem.getItemDamage() == is.damage;
return comparableItem.getItem() == is.getItem() && comparableItem.getItemDamage() == is.getDamage();
}
}
@@ -33,7 +33,7 @@ public final class FeaturedActiveChecker
this.features = features;
}
public ActivityState getActivityState()
ActivityState getActivityState()
{
for( final AEFeature f : this.features )
{
@@ -31,7 +31,7 @@ public class ItemStackSrc implements IStackSrc
{
private final Item item;
public final int damage;
private final int damage;
private final boolean enabled;
public ItemStackSrc( final Item item, final int damage, final ActivityState state )
@@ -46,13 +46,13 @@ public class MaterialStackSrc implements IStackSrc
@Override
public Item getItem()
{
return this.src.itemInstance;
return this.src.getItemInstance();
}
@Override
public int getDamage()
{
return this.src.damageValue;
return this.src.getDamageValue();
}
@Override
@@ -33,7 +33,7 @@ import appeng.api.storage.StorageChannel;
public class CellRegistry implements ICellRegistry
{
final List<ICellHandler> handlers;
private final List<ICellHandler> handlers;
public CellRegistry()
{
@@ -34,8 +34,8 @@ import appeng.core.features.registries.entries.ExternalIInv;
public class ExternalStorageRegistry implements IExternalStorageRegistry
{
final List<IExternalStorageHandler> Handlers;
final ExternalIInv lastHandler = new ExternalIInv();
private final List<IExternalStorageHandler> Handlers;
private final ExternalIInv lastHandler = new ExternalIInv();
public ExternalStorageRegistry()
{
@@ -163,7 +163,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
return null;
}
public void log( final String o )
private void log( final String o )
{
AELog.grinder( o );
}
@@ -1,36 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.core.features.registries;
import net.minecraft.tileentity.TileEntity;
public class WirelessRangeResult
{
public final float dist;
public final TileEntity te;
public WirelessRangeResult( final TileEntity t, final float d )
{
this.dist = d;
this.te = t;
}
}
@@ -30,7 +30,7 @@ public final class WorldGenRegistry implements IWorldGen
{
public static final WorldGenRegistry INSTANCE = new WorldGenRegistry();
final TypeSet[] types;
private final TypeSet[] types;
private WorldGenRegistry()
{