Make fields final if possible to ensure immutability
This commit is contained in:
@@ -21,7 +21,7 @@ public class AppEngCraftingSlot extends AppEngSlot
|
||||
private final IInventory craftMatrix;
|
||||
|
||||
/** The player that is using the GUI where this slot resides. */
|
||||
private EntityPlayer thePlayer;
|
||||
private final EntityPlayer thePlayer;
|
||||
|
||||
/**
|
||||
* The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset.
|
||||
|
||||
@@ -33,7 +33,8 @@ public class AppEngSlot extends Slot
|
||||
|
||||
public int IIcon = -1;
|
||||
public hasCalculatedValidness isValid;
|
||||
public int defX, defY;
|
||||
public final int defX;
|
||||
public final int defY;
|
||||
|
||||
@Override
|
||||
public boolean func_111238_b()
|
||||
|
||||
@@ -6,14 +6,14 @@ import net.minecraft.item.ItemStack;
|
||||
public class OptionalSlotFake extends SlotFake
|
||||
{
|
||||
|
||||
int invSlot;
|
||||
final int invSlot;
|
||||
final int groupNum;
|
||||
IOptionalSlotHost host;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public boolean renderDisabled = true;
|
||||
|
||||
public int srcX;
|
||||
public int srcY;
|
||||
public final int srcX;
|
||||
public final int srcY;
|
||||
|
||||
public OptionalSlotFake(IInventory inv, IOptionalSlotHost containerBus, int idx, int x, int y, int offX, int offY, int groupNum) {
|
||||
super( inv, idx, x + offX * 18, y + offY * 18 );
|
||||
|
||||
@@ -6,7 +6,7 @@ public class OptionalSlotNormal extends AppEngSlot
|
||||
{
|
||||
|
||||
final int groupNum;
|
||||
IOptionalSlotHost host;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public OptionalSlotNormal(IInventory inv, IOptionalSlotHost containerBus, int slot, int xPos, int yPos, int groupNum) {
|
||||
super( inv, slot, xPos, yPos );
|
||||
|
||||
@@ -7,7 +7,7 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput
|
||||
{
|
||||
|
||||
final int groupNum;
|
||||
IOptionalSlotHost host;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public OptionalSlotRestrictedInput(PlacableItemType valid, IInventory i, IOptionalSlotHost host, int slotIndex, int x, int y, int grpNum,
|
||||
InventoryPlayer invPlayer) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack;
|
||||
public class SlotCraftingMatrix extends AppEngSlot
|
||||
{
|
||||
|
||||
Container c;
|
||||
final Container c;
|
||||
|
||||
public SlotCraftingMatrix(Container c, IInventory par1iInventory, int par2, int par3, int par4) {
|
||||
super( par1iInventory, par2, par3, par4 );
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack;
|
||||
public class SlotFake extends AppEngSlot
|
||||
{
|
||||
|
||||
int invSlot;
|
||||
final int invSlot;
|
||||
|
||||
public SlotFake(IInventory inv, int idx, int x, int y) {
|
||||
super( inv, idx, x, y );
|
||||
|
||||
@@ -7,7 +7,7 @@ import appeng.container.implementations.ContainerMAC;
|
||||
public class SlotMACPattern extends AppEngSlot
|
||||
{
|
||||
|
||||
ContainerMAC mac;
|
||||
final ContainerMAC mac;
|
||||
|
||||
public SlotMACPattern(ContainerMAC mac, IInventory i, int slotIdx, int x, int y) {
|
||||
super( i, slotIdx, x, y );
|
||||
|
||||
@@ -16,8 +16,8 @@ import appeng.helpers.IContainerCraftingPacket;
|
||||
public class SlotPatternTerm extends SlotCraftingTerm
|
||||
{
|
||||
|
||||
int groupNum;
|
||||
IOptionalSlotHost host;
|
||||
final int groupNum;
|
||||
final IOptionalSlotHost host;
|
||||
|
||||
public SlotPatternTerm(EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix,
|
||||
IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int groupNumber, IContainerCraftingPacket c)
|
||||
|
||||
@@ -68,10 +68,10 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
return true;
|
||||
}
|
||||
|
||||
public PlacableItemType which;
|
||||
public final PlacableItemType which;
|
||||
public boolean allowEdit = true;
|
||||
public int stackLimit = -1;
|
||||
private InventoryPlayer p;
|
||||
private final InventoryPlayer p;
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
||||
|
||||
Reference in New Issue
Block a user