Make fields final if possible to ensure immutability
This commit is contained in:
@@ -56,7 +56,7 @@ import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
|
||||
protected List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
|
||||
protected final List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
|
||||
protected GuiScrollbar myScrollBar = null;
|
||||
static public boolean switchingGuis;
|
||||
private boolean subGui;
|
||||
@@ -177,7 +177,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
Slot bl_clicked;
|
||||
|
||||
// drag y
|
||||
Set<Slot> drag_click = new HashSet<Slot>();
|
||||
final Set<Slot> drag_click = new HashSet<Slot>();
|
||||
|
||||
@Override
|
||||
protected void handleMouseClick(Slot slot, int slotIdx, int ctrlDown, int key)
|
||||
@@ -788,7 +788,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
}
|
||||
|
||||
AppEngRenderItem aeRenderItem = new AppEngRenderItem();
|
||||
final AppEngRenderItem aeRenderItem = new AppEngRenderItem();
|
||||
|
||||
protected boolean isPowered()
|
||||
{
|
||||
|
||||
@@ -27,8 +27,8 @@ import appeng.util.Platform;
|
||||
public class GuiCellWorkbench extends GuiUpgradeable
|
||||
{
|
||||
|
||||
ContainerCellWorkbench workbench;
|
||||
TileCellWorkbench tcw;
|
||||
final ContainerCellWorkbench workbench;
|
||||
final TileCellWorkbench tcw;
|
||||
|
||||
GuiImgButton clear;
|
||||
GuiImgButton partition;
|
||||
|
||||
@@ -22,7 +22,7 @@ import appeng.tile.misc.TileCondenser;
|
||||
public class GuiCondenser extends AEBaseGui
|
||||
{
|
||||
|
||||
ContainerCondenser cvc;
|
||||
final ContainerCondenser cvc;
|
||||
GuiProgressBar pb;
|
||||
GuiImgButton mode;
|
||||
|
||||
|
||||
@@ -38,15 +38,15 @@ import com.google.common.base.Joiner;
|
||||
public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
|
||||
ContainerCraftConfirm ccc;
|
||||
final ContainerCraftConfirm ccc;
|
||||
|
||||
int rows = 5;
|
||||
final int rows = 5;
|
||||
|
||||
IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||
IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
|
||||
|
||||
List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
|
||||
final List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
|
||||
|
||||
GuiBridge OriginalGui;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.google.common.base.Joiner;
|
||||
public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
|
||||
int rows = 6;
|
||||
final int rows = 6;
|
||||
|
||||
IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
|
||||
|
||||
@@ -29,7 +29,7 @@ import appeng.parts.reporting.PartTerminal;
|
||||
public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
{
|
||||
|
||||
ContainerCraftingStatus ccc;
|
||||
final ContainerCraftingStatus ccc;
|
||||
GuiButton selectCPU;
|
||||
|
||||
GuiTabButton originalGuiBtn;
|
||||
|
||||
@@ -12,7 +12,7 @@ import appeng.tile.misc.TileInscriber;
|
||||
public class GuiInscriber extends AEBaseGui
|
||||
{
|
||||
|
||||
ContainerInscriber cvc;
|
||||
final ContainerInscriber cvc;
|
||||
GuiProgressBar pb;
|
||||
|
||||
public GuiInscriber(InventoryPlayer inventoryPlayer, TileInscriber te)
|
||||
|
||||
@@ -25,9 +25,9 @@ import com.google.common.collect.HashMultimap;
|
||||
public class GuiInterfaceTerminal extends AEBaseGui
|
||||
{
|
||||
|
||||
HashMap<Long, ClientDCInternalInv> byId = new HashMap<Long, ClientDCInternalInv>();
|
||||
HashMultimap<String, ClientDCInternalInv> byName = HashMultimap.create();
|
||||
ArrayList<String> names = new ArrayList<String>();
|
||||
final HashMap<Long, ClientDCInternalInv> byId = new HashMap<Long, ClientDCInternalInv>();
|
||||
final HashMultimap<String, ClientDCInternalInv> byName = HashMultimap.create();
|
||||
final ArrayList<String> names = new ArrayList<String>();
|
||||
|
||||
ArrayList<Object> lines = new ArrayList<Object>();
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import appeng.tile.crafting.TileMolecularAssembler;
|
||||
public class GuiMAC extends GuiUpgradeable
|
||||
{
|
||||
|
||||
ContainerMAC container;
|
||||
final ContainerMAC container;
|
||||
GuiProgressBar pb;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,14 +58,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
public static int CraftingGridOffsetX;
|
||||
public static int CraftingGridOffsetY;
|
||||
|
||||
ItemRepo repo;
|
||||
final ItemRepo repo;
|
||||
|
||||
GuiText myName;
|
||||
|
||||
int offsetX = 9;
|
||||
final int offsetX = 9;
|
||||
int perRow = 9;
|
||||
int reservedSpace = 0;
|
||||
int lowerTextureOffset = 0;
|
||||
final int lowerTextureOffset = 0;
|
||||
boolean customSortOrder = true;
|
||||
|
||||
int rows = 0;
|
||||
@@ -73,17 +73,17 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
int standardSize;
|
||||
|
||||
IConfigManager configSrc;
|
||||
final IConfigManager configSrc;
|
||||
|
||||
GuiImgButton ViewBox;
|
||||
GuiImgButton SortByBox;
|
||||
GuiImgButton SortDirBox;
|
||||
|
||||
GuiImgButton searchBoxSettings, terminalStyleBox;
|
||||
boolean viewCell;
|
||||
final boolean viewCell;
|
||||
|
||||
ItemStack myCurrentViewCells[] = new ItemStack[5];
|
||||
ContainerMEMonitorable monitorableContainer;
|
||||
final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
final ContainerMEMonitorable monitorableContainer;
|
||||
|
||||
public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
||||
this( inventoryPlayer, te, new ContainerMEMonitorable( inventoryPlayer, te ) );
|
||||
|
||||
@@ -30,10 +30,10 @@ import appeng.util.Platform;
|
||||
public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
{
|
||||
|
||||
ItemRepo repo;
|
||||
final ItemRepo repo;
|
||||
GuiImgButton units;
|
||||
|
||||
int rows = 4;
|
||||
final int rows = 4;
|
||||
|
||||
public GuiNetworkStatus(InventoryPlayer inventoryPlayer, INetworkTool te) {
|
||||
super( new ContainerNetworkStatus( inventoryPlayer, te ) );
|
||||
|
||||
@@ -20,7 +20,7 @@ import appeng.core.sync.packets.PacketValueConfig;
|
||||
public class GuiPatternTerm extends GuiMEMonitorable
|
||||
{
|
||||
|
||||
ContainerPatternTerm container;
|
||||
final ContainerPatternTerm container;
|
||||
|
||||
GuiTabButton tabCraftButton;
|
||||
GuiTabButton tabProcessButton;
|
||||
|
||||
@@ -17,7 +17,7 @@ import appeng.util.Platform;
|
||||
public class GuiSpatialIOPort extends AEBaseGui
|
||||
{
|
||||
|
||||
ContainerSpatialIOPort container;
|
||||
final ContainerSpatialIOPort container;
|
||||
GuiImgButton units;
|
||||
|
||||
public GuiSpatialIOPort(InventoryPlayer inventoryPlayer, TileSpatialIOPort te) {
|
||||
|
||||
@@ -25,8 +25,8 @@ import appeng.parts.automation.PartImportBus;
|
||||
public class GuiUpgradeable extends AEBaseGui
|
||||
{
|
||||
|
||||
ContainerUpgradeable cvb;
|
||||
IUpgradeableHost bc;
|
||||
final ContainerUpgradeable cvb;
|
||||
final IUpgradeableHost bc;
|
||||
|
||||
GuiImgButton redstoneMode;
|
||||
GuiImgButton fuzzyMode;
|
||||
|
||||
@@ -14,7 +14,7 @@ import appeng.tile.misc.TileVibrationChamber;
|
||||
public class GuiVibrationChamber extends AEBaseGui
|
||||
{
|
||||
|
||||
ContainerVibrationChamber cvc;
|
||||
final ContainerVibrationChamber cvc;
|
||||
GuiProgressBar pb;
|
||||
|
||||
public GuiVibrationChamber(InventoryPlayer inventoryPlayer, TileVibrationChamber te)
|
||||
|
||||
@@ -36,8 +36,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
||||
class EnumPair
|
||||
{
|
||||
|
||||
Enum setting;
|
||||
Enum value;
|
||||
final Enum setting;
|
||||
final Enum value;
|
||||
|
||||
EnumPair(Enum a, Enum b) {
|
||||
setting = a;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class GuiProgressBar extends GuiButton implements ITooltip
|
||||
HORIZONTAL, VERTICAL
|
||||
}
|
||||
|
||||
private IProgressProvider source;
|
||||
private final IProgressProvider source;
|
||||
private ResourceLocation texture;
|
||||
private int fill_u;
|
||||
private int fill_v;
|
||||
|
||||
@@ -15,14 +15,14 @@ import appeng.client.texture.ExtraBlockTextures;
|
||||
public class GuiTabButton extends GuiButton implements ITooltip
|
||||
{
|
||||
|
||||
RenderItem itemRenderer;
|
||||
final RenderItem itemRenderer;
|
||||
|
||||
int myIcon = -1;
|
||||
public int hideEdge = 0;
|
||||
|
||||
ItemStack myItem;
|
||||
|
||||
String Msg;
|
||||
final String Msg;
|
||||
|
||||
public void setVisibility(boolean vis)
|
||||
{
|
||||
|
||||
@@ -11,11 +11,11 @@ import appeng.client.texture.ExtraBlockTextures;
|
||||
public class GuiToggleButton extends GuiButton implements ITooltip
|
||||
{
|
||||
|
||||
int iconIdxOn;
|
||||
int iconIdxOff;
|
||||
final int iconIdxOn;
|
||||
final int iconIdxOff;
|
||||
|
||||
String Name;
|
||||
String Hint;
|
||||
final String Name;
|
||||
final String Hint;
|
||||
|
||||
boolean on;
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ import net.minecraft.client.gui.GuiTextField;
|
||||
public class MEGuiTextField extends GuiTextField
|
||||
{
|
||||
|
||||
int posX;
|
||||
int posY;
|
||||
final int posX;
|
||||
final int posY;
|
||||
|
||||
int myWidth;
|
||||
int myHeight;
|
||||
final int myWidth;
|
||||
final int myHeight;
|
||||
|
||||
public MEGuiTextField(FontRenderer par1FontRenderer, int xPos, int yPos, int width, int height) {
|
||||
super( par1FontRenderer, xPos, yPos, width, height );
|
||||
|
||||
Reference in New Issue
Block a user