Make fields final if possible to ensure immutability
This commit is contained in:
@@ -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