Make fields final if possible to ensure immutability
This commit is contained in:
@@ -32,7 +32,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
|
||||
public static AEConfig instance;
|
||||
|
||||
public static double TunnelPowerLoss = 0.05;
|
||||
public static final double TunnelPowerLoss = 0.05;
|
||||
|
||||
public String latestVersion = VERSION;
|
||||
public long latestTimeStamp = 0;
|
||||
@@ -42,8 +42,8 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
|
||||
public final static String PACKET_CHANNEL = "AE";
|
||||
|
||||
public IConfigManager settings = new ConfigManager( this );
|
||||
public EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
|
||||
public final IConfigManager settings = new ConfigManager( this );
|
||||
public final EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
|
||||
PowerUnits selectedPowerUnit = PowerUnits.AE;
|
||||
|
||||
public int storageBiomeID = -1;
|
||||
@@ -60,7 +60,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
|
||||
private double WirelessBaseCost = 8;
|
||||
private double WirelessCostMultiplier = 1;
|
||||
private double WirelessHighWirelessCount = 64;
|
||||
private final double WirelessHighWirelessCount = 64;
|
||||
private double WirelessTerminalDrainMultiplier = 1;
|
||||
|
||||
private double WirelessBaseRange = 16;
|
||||
@@ -113,9 +113,9 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
|
||||
|
||||
public boolean enableEffects = true;
|
||||
public boolean useLargeFonts = false;
|
||||
public int[] craftByStacks = new int[] { 1, 10, 100, 1000 };
|
||||
public int[] priorityByStacks = new int[] { 1, 10, 100, 1000 };
|
||||
public int[] levelByStacks = new int[] { 1, 10, 100, 1000 };
|
||||
public final int[] craftByStacks = new int[] { 1, 10, 100, 1000 };
|
||||
public final int[] priorityByStacks = new int[] { 1, 10, 100, 1000 };
|
||||
public final int[] levelByStacks = new int[] { 1, 10, 100, 1000 };
|
||||
|
||||
public int wirelessTerminalBattery = 1600000;
|
||||
public int entropyManipulatorBattery = 200000;
|
||||
|
||||
@@ -30,15 +30,15 @@ public class Api implements IAppEngApi
|
||||
}
|
||||
|
||||
// private MovableTileRegistry MovableRegistry = new MovableTileRegistry();
|
||||
private RegistryContainer rc = new RegistryContainer();
|
||||
private ApiStorage storageHelper = new ApiStorage();
|
||||
private final RegistryContainer rc = new RegistryContainer();
|
||||
private final ApiStorage storageHelper = new ApiStorage();
|
||||
|
||||
public ApiPart partHelper = new ApiPart();
|
||||
public final ApiPart partHelper = new ApiPart();
|
||||
|
||||
private Materials materials = new Materials();
|
||||
private Items items = new Items();
|
||||
private Blocks blocks = new Blocks();
|
||||
private Parts parts = new Parts();
|
||||
private final Materials materials = new Materials();
|
||||
private final Items items = new Items();
|
||||
private final Blocks blocks = new Blocks();
|
||||
private final Parts parts = new Parts();
|
||||
|
||||
@Override
|
||||
public IRegistryContainer registries()
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AppEng
|
||||
public final static String modid = "appliedenergistics2";
|
||||
public final static String name = "Applied Energistics 2";
|
||||
|
||||
HashMap<String, IIMCHandler> IMCHandlers = new HashMap<String, IIMCHandler>();
|
||||
final HashMap<String, IIMCHandler> IMCHandlers = new HashMap<String, IIMCHandler>();
|
||||
|
||||
public static AppEng instance;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class FacadeConfig extends Configuration
|
||||
{
|
||||
|
||||
public static FacadeConfig instance;
|
||||
Pattern replacementPattern;
|
||||
final Pattern replacementPattern;
|
||||
|
||||
public FacadeConfig(String path) {
|
||||
super( new File( path + "Facades.cfg" ) );
|
||||
|
||||
@@ -183,7 +183,7 @@ public class Registration
|
||||
|
||||
final public static Registration instance = new Registration();
|
||||
|
||||
public RecipeHandler recipeHandler;
|
||||
public final RecipeHandler recipeHandler;
|
||||
public BiomeGenBase storageBiome;
|
||||
|
||||
private Registration()
|
||||
|
||||
@@ -44,9 +44,9 @@ public class WorldSettings extends Configuration
|
||||
long lastGridStorage = 0;
|
||||
int lastPlayer = 0;
|
||||
|
||||
private CompassService compass;
|
||||
private final CompassService compass;
|
||||
|
||||
File AEFolder;
|
||||
final File AEFolder;
|
||||
|
||||
public WorldSettings(File aeFolder)
|
||||
{
|
||||
@@ -224,7 +224,7 @@ public class WorldSettings extends Configuration
|
||||
instance = null;
|
||||
}
|
||||
|
||||
List<Integer> storageCellDims = new ArrayList<Integer>();
|
||||
final List<Integer> storageCellDims = new ArrayList<Integer>();
|
||||
HashMap<Integer, UUID> idToUUID;
|
||||
|
||||
public void addStorageCellDim(int newDim)
|
||||
@@ -317,7 +317,7 @@ public class WorldSettings extends Configuration
|
||||
save();
|
||||
}
|
||||
|
||||
private WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
|
||||
private final WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
|
||||
|
||||
public WorldCoord getStoredSize(int dim)
|
||||
{
|
||||
|
||||
@@ -44,12 +44,12 @@ public class ApiPart implements IPartHelper
|
||||
|
||||
int classNum = 1;
|
||||
|
||||
HashMap<String, Class> TileImplementations = new HashMap<String, Class>();
|
||||
final HashMap<String, Class> TileImplementations = new HashMap<String, Class>();
|
||||
HashMap<String, ClassNode> readerCache = new HashMap<String, ClassNode>();
|
||||
HashMap<Class, String> interfaces2Layer = new HashMap<Class, String>();
|
||||
HashMap<String, Class> roots = new HashMap<String, Class>();
|
||||
final HashMap<Class, String> interfaces2Layer = new HashMap<Class, String>();
|
||||
final HashMap<String, Class> roots = new HashMap<String, Class>();
|
||||
|
||||
List<String> desc = new LinkedList<String>();
|
||||
final List<String> desc = new LinkedList<String>();
|
||||
|
||||
public void initFMPSupport()
|
||||
{
|
||||
@@ -199,7 +199,7 @@ public class ApiPart implements IPartHelper
|
||||
class DefaultPackageClassNameRemapper extends Remapper
|
||||
{
|
||||
|
||||
public HashMap<String, String> inputOutput = new HashMap<String, String>();
|
||||
public final HashMap<String, String> inputOutput = new HashMap<String, String>();
|
||||
|
||||
@Override
|
||||
public String map(String typeName)
|
||||
|
||||
@@ -24,7 +24,7 @@ public class AEFeatureHandler implements AEItemDefinition
|
||||
private final EnumSet<AEFeature> features;
|
||||
|
||||
private final String subName;
|
||||
private IAEFeature feature;
|
||||
private final IAEFeature feature;
|
||||
|
||||
private Item ItemData;
|
||||
private Block BlockData;
|
||||
|
||||
@@ -10,7 +10,7 @@ import appeng.api.util.AEColoredItemDefinition;
|
||||
public class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
{
|
||||
|
||||
ItemStackSrc colors[] = new ItemStackSrc[17];
|
||||
final ItemStackSrc[] colors = new ItemStackSrc[17];
|
||||
|
||||
@Override
|
||||
public Item item(AEColor color)
|
||||
|
||||
@@ -7,7 +7,7 @@ import appeng.items.materials.MaterialType;
|
||||
public class MaterialStackSrc implements IStackSrc
|
||||
{
|
||||
|
||||
MaterialType src;
|
||||
final MaterialType src;
|
||||
|
||||
public MaterialStackSrc(MaterialType src) {
|
||||
this.src = src;
|
||||
|
||||
@@ -13,7 +13,7 @@ import appeng.api.storage.StorageChannel;
|
||||
public class CellRegistry implements ICellRegistry
|
||||
{
|
||||
|
||||
List<ICellHandler> handlers;
|
||||
final List<ICellHandler> handlers;
|
||||
|
||||
public CellRegistry() {
|
||||
handlers = new ArrayList<ICellHandler>();
|
||||
|
||||
@@ -14,7 +14,7 @@ import appeng.core.features.registries.entries.ExternalIInv;
|
||||
public class ExternalStorageRegistry implements IExternalStorageRegistry
|
||||
{
|
||||
|
||||
List<IExternalStorageHandler> Handlers;
|
||||
final List<IExternalStorageHandler> Handlers;
|
||||
final ExternalIInv lastHandler = new ExternalIInv();
|
||||
|
||||
public ExternalStorageRegistry() {
|
||||
|
||||
@@ -21,7 +21,7 @@ import appeng.util.Platform;
|
||||
public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
|
||||
public List<IGrinderEntry> RecipeList;
|
||||
public final List<IGrinderEntry> RecipeList;
|
||||
|
||||
private ItemStack copy(ItemStack is)
|
||||
{
|
||||
@@ -149,9 +149,9 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
return 2;
|
||||
}
|
||||
|
||||
public Map<ItemStack, String> Ores = new HashMap<ItemStack, String>();
|
||||
public Map<ItemStack, String> Ingots = new HashMap<ItemStack, String>();
|
||||
public Map<String, ItemStack> Dusts = new HashMap<String, ItemStack>();
|
||||
public final Map<ItemStack, String> Ores = new HashMap<ItemStack, String>();
|
||||
public final Map<ItemStack, String> Ingots = new HashMap<ItemStack, String>();
|
||||
public final Map<String, ItemStack> Dusts = new HashMap<String, ItemStack>();
|
||||
|
||||
private void addOre(String name, ItemStack item)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
public class LocatableRegistry implements ILocatableRegistry
|
||||
{
|
||||
|
||||
private HashMap<Long, ILocatable> set;
|
||||
private final HashMap<Long, ILocatable> set;
|
||||
|
||||
@SubscribeEvent
|
||||
public void updateLocatable(LocatableEventAnnounce e)
|
||||
|
||||
@@ -12,7 +12,7 @@ import appeng.util.Platform;
|
||||
public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmoRegistry
|
||||
{
|
||||
|
||||
private HashMap<ItemStack, Double> DamageModifiers = new HashMap<ItemStack, Double>();
|
||||
private final HashMap<ItemStack, Double> DamageModifiers = new HashMap<ItemStack, Double>();
|
||||
|
||||
@Override
|
||||
public void registerAmmo(ItemStack ammo, double weight)
|
||||
|
||||
@@ -15,14 +15,14 @@ import appeng.spatial.DefaultSpatialHandler;
|
||||
public class MovableTileRegistry implements IMovableRegistry
|
||||
{
|
||||
|
||||
private HashSet<Block> blacklisted = new HashSet<Block>();
|
||||
private final HashSet<Block> blacklisted = new HashSet<Block>();
|
||||
|
||||
private HashMap<Class<? extends TileEntity>, IMovableHandler> Valid = new HashMap<Class<? extends TileEntity>, IMovableHandler>();
|
||||
private LinkedList<Class<? extends TileEntity>> test = new LinkedList<Class<? extends TileEntity>>();
|
||||
private LinkedList<IMovableHandler> handlers = new LinkedList<IMovableHandler>();
|
||||
private DefaultSpatialHandler dsh = new DefaultSpatialHandler();
|
||||
private final HashMap<Class<? extends TileEntity>, IMovableHandler> Valid = new HashMap<Class<? extends TileEntity>, IMovableHandler>();
|
||||
private final LinkedList<Class<? extends TileEntity>> test = new LinkedList<Class<? extends TileEntity>>();
|
||||
private final LinkedList<IMovableHandler> handlers = new LinkedList<IMovableHandler>();
|
||||
private final DefaultSpatialHandler dsh = new DefaultSpatialHandler();
|
||||
|
||||
private IMovableHandler nullHandler = new DefaultSpatialHandler();
|
||||
private final IMovableHandler nullHandler = new DefaultSpatialHandler();
|
||||
|
||||
private IMovableHandler testClass(Class myClass, TileEntity te)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
{
|
||||
|
||||
HashMap<ItemStack, TunnelType> Tunnels = new HashMap<ItemStack, TunnelType>();
|
||||
final HashMap<ItemStack, TunnelType> Tunnels = new HashMap<ItemStack, TunnelType>();
|
||||
|
||||
public ItemStack getModItem(String modID, String Name, int meta)
|
||||
{
|
||||
|
||||
@@ -13,8 +13,8 @@ import appeng.recipes.RecipeHandler;
|
||||
public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
{
|
||||
|
||||
HashMap<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>();
|
||||
LinkedList<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
|
||||
final HashMap<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>();
|
||||
final LinkedList<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
|
||||
|
||||
@Override
|
||||
public void addNewCraftHandler(String name, Class<? extends ICraftHandler> handler)
|
||||
|
||||
@@ -18,18 +18,18 @@ import appeng.api.storage.IExternalStorageRegistry;
|
||||
public class RegistryContainer implements IRegistryContainer
|
||||
{
|
||||
|
||||
private GrinderRecipeManager GrinderRecipes = new GrinderRecipeManager();
|
||||
private ExternalStorageRegistry ExternalStorageHandlers = new ExternalStorageRegistry();
|
||||
private CellRegistry CellRegistry = new CellRegistry();
|
||||
private LocatableRegistry LocatableRegistry = new LocatableRegistry();
|
||||
private SpecialComparisonRegistry SpecialComparisonRegistry = new SpecialComparisonRegistry();
|
||||
private WirelessRegistry WirelessRegistry = new WirelessRegistry();
|
||||
private GridCacheRegistry GridCacheRegistry = new GridCacheRegistry();
|
||||
private P2PTunnelRegistry P2PRegistry = new P2PTunnelRegistry();
|
||||
private MovableTileRegistry MovableReg = new MovableTileRegistry();
|
||||
private MatterCannonAmmoRegistry matterCannonReg = new MatterCannonAmmoRegistry();
|
||||
private PlayerRegistry playerRegistry = new PlayerRegistry();
|
||||
private IRecipeHandlerRegistry recipeReg = new RecipeHandlerRegistry();
|
||||
private final GrinderRecipeManager GrinderRecipes = new GrinderRecipeManager();
|
||||
private final ExternalStorageRegistry ExternalStorageHandlers = new ExternalStorageRegistry();
|
||||
private final CellRegistry CellRegistry = new CellRegistry();
|
||||
private final LocatableRegistry LocatableRegistry = new LocatableRegistry();
|
||||
private final SpecialComparisonRegistry SpecialComparisonRegistry = new SpecialComparisonRegistry();
|
||||
private final WirelessRegistry WirelessRegistry = new WirelessRegistry();
|
||||
private final GridCacheRegistry GridCacheRegistry = new GridCacheRegistry();
|
||||
private final P2PTunnelRegistry P2PRegistry = new P2PTunnelRegistry();
|
||||
private final MovableTileRegistry MovableReg = new MovableTileRegistry();
|
||||
private final MatterCannonAmmoRegistry matterCannonReg = new MatterCannonAmmoRegistry();
|
||||
private final PlayerRegistry playerRegistry = new PlayerRegistry();
|
||||
private final IRecipeHandlerRegistry recipeReg = new RecipeHandlerRegistry();
|
||||
|
||||
@Override
|
||||
public IWirelessTermRegistry wireless()
|
||||
|
||||
@@ -11,7 +11,7 @@ import appeng.api.features.ISpecialComparisonRegistry;
|
||||
public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
|
||||
{
|
||||
|
||||
private List<IItemComparisonProvider> CompRegistry;
|
||||
private final List<IItemComparisonProvider> CompRegistry;
|
||||
|
||||
public SpecialComparisonRegistry() {
|
||||
CompRegistry = new ArrayList<IItemComparisonProvider>();
|
||||
|
||||
@@ -16,7 +16,7 @@ import appeng.util.Platform;
|
||||
public class WirelessRegistry implements IWirelessTermRegistry
|
||||
{
|
||||
|
||||
List<IWirelessTermHandler> handlers;
|
||||
final List<IWirelessTermHandler> handlers;
|
||||
|
||||
public WirelessRegistry() {
|
||||
handlers = new ArrayList<IWirelessTermHandler>();
|
||||
|
||||
@@ -12,12 +12,12 @@ public class WorldGenRegistry implements IWorldGen
|
||||
private class TypeSet
|
||||
{
|
||||
|
||||
HashSet<Class<? extends WorldProvider>> badProviders = new HashSet<Class<? extends WorldProvider>>();
|
||||
HashSet<Integer> badDimensions = new HashSet<Integer>();
|
||||
final HashSet<Class<? extends WorldProvider>> badProviders = new HashSet<Class<? extends WorldProvider>>();
|
||||
final HashSet<Integer> badDimensions = new HashSet<Integer>();
|
||||
|
||||
}
|
||||
|
||||
TypeSet[] types;
|
||||
final TypeSet[] types;
|
||||
|
||||
static final public WorldGenRegistry instance = new WorldGenRegistry();
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public enum ButtonToolTips
|
||||
|
||||
Craft, Mod, DoesntDespawn, EmitterMode, CraftViaRedstone, EmitWhenCrafting, ReportInaccessibleItems, ReportInaccessibleItemsYes, ReportInaccessibleItemsNo;
|
||||
|
||||
String root;
|
||||
final String root;
|
||||
|
||||
ButtonToolTips() {
|
||||
root = "gui.tooltips.appliedenergistics2";
|
||||
|
||||
@@ -52,7 +52,7 @@ public enum GuiText
|
||||
|
||||
Included, Excluded, Partitioned, Precise, Fuzzy;
|
||||
|
||||
String root;
|
||||
final String root;
|
||||
|
||||
GuiText() {
|
||||
root = "gui.appliedenergistics2";
|
||||
|
||||
@@ -11,7 +11,7 @@ public enum WailaText
|
||||
|
||||
Contains, Channels;
|
||||
|
||||
String root;
|
||||
final String root;
|
||||
|
||||
WailaText() {
|
||||
root = "waila.appliedenergistics2";
|
||||
|
||||
@@ -35,7 +35,7 @@ import appeng.core.sync.packets.PacketValueConfig;
|
||||
public class AppEngPacketHandlerBase
|
||||
{
|
||||
|
||||
public static Map<Class, PacketTypes> reverseLookup = new HashMap<Class, AppEngPacketHandlerBase.PacketTypes>();
|
||||
public static final Map<Class, PacketTypes> reverseLookup = new HashMap<Class, AppEngPacketHandlerBase.PacketTypes>();
|
||||
|
||||
public enum PacketTypes
|
||||
{
|
||||
|
||||
@@ -169,9 +169,9 @@ public enum GuiBridge implements IGuiHandler
|
||||
|
||||
GUI_CRAFTING_STATUS(ContainerCraftingStatus.class, ITerminalHost.class, ITEM_OR_WORLD, SecurityPermissions.CRAFT);
|
||||
|
||||
private Class Tile;
|
||||
private final Class Tile;
|
||||
private Class Gui;
|
||||
private Class Container;
|
||||
private final Class Container;
|
||||
private GuiHostType type;
|
||||
private SecurityPermissions requiredPermission;
|
||||
|
||||
|
||||
@@ -18,8 +18,13 @@ import appeng.items.tools.powered.ToolColorApplicator;
|
||||
public class PacketClick extends AppEngPacket
|
||||
{
|
||||
|
||||
int x, y, z, side;
|
||||
float hitX, hitY, hitZ;
|
||||
final int x;
|
||||
final int y;
|
||||
final int z;
|
||||
final int side;
|
||||
final float hitX;
|
||||
final float hitY;
|
||||
final float hitZ;
|
||||
|
||||
// automatic.
|
||||
public PacketClick(ByteBuf stream) throws IOException {
|
||||
|
||||
@@ -15,8 +15,8 @@ import appeng.hooks.TickHandler.PlayerColor;
|
||||
public class PacketPaintedEntity extends AppEngPacket
|
||||
{
|
||||
|
||||
private AEColor myColor;
|
||||
private int entityId;
|
||||
private final AEColor myColor;
|
||||
private final int entityId;
|
||||
private int ticks;
|
||||
|
||||
// automatic.
|
||||
|
||||
@@ -13,8 +13,8 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketPartialItem extends AppEngPacket
|
||||
{
|
||||
|
||||
short pageNum;
|
||||
byte[] data;
|
||||
final short pageNum;
|
||||
final byte[] data;
|
||||
|
||||
// automatic.
|
||||
public PacketPartialItem(ByteBuf stream) throws IOException {
|
||||
|
||||
@@ -14,8 +14,8 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketProgressBar extends AppEngPacket
|
||||
{
|
||||
|
||||
short id;
|
||||
long value;
|
||||
final short id;
|
||||
final long value;
|
||||
|
||||
// automatic.
|
||||
public PacketProgressBar(ByteBuf stream) throws IOException {
|
||||
|
||||
@@ -13,7 +13,8 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketSwapSlots extends AppEngPacket
|
||||
{
|
||||
|
||||
int slotA, slotB;
|
||||
final int slotA;
|
||||
final int slotB;
|
||||
|
||||
// automatic.
|
||||
public PacketSwapSlots(ByteBuf stream) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user