mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-11 18:00:29 +00:00
Make many fields final
This commit is contained in:
parent
a3400ecf26
commit
5a60818c99
@ -17,8 +17,8 @@ import java.util.*;
|
||||
|
||||
public class HTTPAPI implements ILuaAPI
|
||||
{
|
||||
private IAPIEnvironment m_apiEnvironment;
|
||||
private List<HTTPRequest> m_httpRequests;
|
||||
private final IAPIEnvironment m_apiEnvironment;
|
||||
private final List<HTTPRequest> m_httpRequests;
|
||||
|
||||
public HTTPAPI( IAPIEnvironment environment )
|
||||
{
|
||||
|
@ -278,8 +278,8 @@ public class HTTPRequest
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object m_lock = new Object();
|
||||
private URL m_url;
|
||||
private final Object m_lock = new Object();
|
||||
private final URL m_url;
|
||||
private final String m_urlString;
|
||||
|
||||
private boolean m_complete;
|
||||
|
@ -235,9 +235,9 @@ public class PeripheralAPI implements ILuaAPI, IAPIEnvironment.IPeripheralChange
|
||||
}
|
||||
}
|
||||
|
||||
private IAPIEnvironment m_environment;
|
||||
private final IAPIEnvironment m_environment;
|
||||
private FileSystem m_fileSystem;
|
||||
private PeripheralWrapper[] m_peripherals;
|
||||
private final PeripheralWrapper[] m_peripherals;
|
||||
private boolean m_running;
|
||||
|
||||
public PeripheralAPI( IAPIEnvironment _environment )
|
||||
|
@ -15,8 +15,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class TermAPI implements ILuaAPI
|
||||
{
|
||||
private Terminal m_terminal;
|
||||
private IComputerEnvironment m_environment;
|
||||
private final Terminal m_terminal;
|
||||
private final IComputerEnvironment m_environment;
|
||||
|
||||
public TermAPI( IAPIEnvironment _environment )
|
||||
{
|
||||
|
@ -186,26 +186,26 @@ public class Computer
|
||||
private boolean m_blinking;
|
||||
|
||||
private ILuaMachine m_machine;
|
||||
private List<ILuaAPI> m_apis;
|
||||
private APIEnvironment m_apiEnvironment;
|
||||
private final List<ILuaAPI> m_apis;
|
||||
private final APIEnvironment m_apiEnvironment;
|
||||
|
||||
private Terminal m_terminal;
|
||||
private final Terminal m_terminal;
|
||||
private FileSystem m_fileSystem;
|
||||
private IWritableMount m_rootMount;
|
||||
|
||||
private int[] m_internalOutput;
|
||||
private int[] m_internalBundledOutput;
|
||||
private final int[] m_internalOutput;
|
||||
private final int[] m_internalBundledOutput;
|
||||
private boolean m_internalOutputChanged;
|
||||
|
||||
private int[] m_externalOutput;
|
||||
private int[] m_externalBundledOutput;
|
||||
private final int[] m_externalOutput;
|
||||
private final int[] m_externalBundledOutput;
|
||||
private boolean m_externalOutputChanged;
|
||||
|
||||
private int[] m_input;
|
||||
private int[] m_bundledInput;
|
||||
private final int[] m_input;
|
||||
private final int[] m_bundledInput;
|
||||
private boolean m_inputChanged;
|
||||
|
||||
private IPeripheral[] m_peripherals;
|
||||
private final IPeripheral[] m_peripherals;
|
||||
|
||||
public Computer( IComputerEnvironment environment, Terminal terminal, int id )
|
||||
{
|
||||
|
@ -13,14 +13,14 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
public class ComputerThread
|
||||
{
|
||||
private static Object m_lock;
|
||||
private static final Object m_lock;
|
||||
|
||||
private static Thread m_thread;
|
||||
private static WeakHashMap <Object, LinkedBlockingQueue<ITask>> m_computerTasks;
|
||||
private static ArrayList <LinkedBlockingQueue<ITask>> m_computerTasksActive;
|
||||
private static ArrayList <LinkedBlockingQueue<ITask>> m_computerTasksPending;
|
||||
private static Object m_defaultQueue;
|
||||
private static Object m_monitor;
|
||||
private static final WeakHashMap <Object, LinkedBlockingQueue<ITask>> m_computerTasks;
|
||||
private static final ArrayList <LinkedBlockingQueue<ITask>> m_computerTasksActive;
|
||||
private static final ArrayList <LinkedBlockingQueue<ITask>> m_computerTasksPending;
|
||||
private static final Object m_defaultQueue;
|
||||
private static final Object m_monitor;
|
||||
|
||||
private static boolean m_running;
|
||||
private static boolean m_stopped;
|
||||
|
@ -84,7 +84,7 @@ public abstract class ModemPeripheral
|
||||
|
||||
private INetwork m_network;
|
||||
private IComputerAccess m_computer;
|
||||
private Map<Integer, IReceiver> m_channels;
|
||||
private final Map<Integer, IReceiver> m_channels;
|
||||
|
||||
private boolean m_open;
|
||||
private boolean m_changed;
|
||||
|
@ -233,13 +233,13 @@ public class TileCable extends TileModemBase
|
||||
|
||||
// Members
|
||||
|
||||
private Map<Integer, Set<IReceiver>> m_receivers;
|
||||
private Queue<Packet> m_transmitQueue;
|
||||
private final Map<Integer, Set<IReceiver>> m_receivers;
|
||||
private final Queue<Packet> m_transmitQueue;
|
||||
|
||||
private boolean m_peripheralAccessAllowed;
|
||||
private int m_attachedPeripheralID;
|
||||
|
||||
private Map<String, IPeripheral> m_peripheralsByName;
|
||||
private final Map<String, IPeripheral> m_peripheralsByName;
|
||||
private Map<String, RemotePeripheralWrapper> m_peripheralWrappersByName;
|
||||
private boolean m_peripheralsKnown;
|
||||
private boolean m_destroyed;
|
||||
|
@ -447,16 +447,8 @@ public class TilePrinter extends TilePeripheralBase
|
||||
{
|
||||
synchronized( m_inventory )
|
||||
{
|
||||
ItemStack inkStack = m_inventory[0];
|
||||
if( inkStack == null || !isInk(inkStack) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( getPaperLevel() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
ItemStack inkStack = m_inventory[ 0 ];
|
||||
return inkStack != null && isInk( inkStack ) && getPaperLevel() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,10 +52,6 @@ public class PocketModemPeripheral extends WirelessModemPeripheral
|
||||
@Override
|
||||
public boolean equals( IPeripheral other )
|
||||
{
|
||||
if( other instanceof PocketModemPeripheral )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return other instanceof PocketModemPeripheral;
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,6 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -245,11 +245,7 @@ public class TileTurtle extends TileComputerBase
|
||||
}
|
||||
else
|
||||
{
|
||||
if( exploder != null && ( exploder instanceof EntityLivingBase || exploder instanceof EntityFireball ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return exploder != null && (exploder instanceof EntityLivingBase || exploder instanceof EntityFireball);
|
||||
}
|
||||
}
|
||||
|
||||
@ -705,11 +701,7 @@ public class TileTurtle extends TileComputerBase
|
||||
case 5: upgrade = getUpgrade( TurtleSide.Left ); break;
|
||||
default: return false;
|
||||
}
|
||||
if( upgrade != null && upgrade.getType().isPeripheral() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return upgrade != null && upgrade.getType().isPeripheral();
|
||||
}
|
||||
|
||||
public void transferStateFrom( TileTurtle copy )
|
||||
|
@ -140,11 +140,7 @@ public class TurtleTool implements ITurtleUpgrade
|
||||
{
|
||||
IBlockState state = world.getBlockState( pos );
|
||||
Block block = state.getBlock();
|
||||
if( block.isAir( state, world, pos ) || block == Blocks.BEDROCK || state.getBlockHardness( world, pos ) <= -1.0F )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !block.isAir( state, world, pos ) && block != Blocks.BEDROCK && state.getBlockHardness( world, pos ) > -1.0F;
|
||||
}
|
||||
|
||||
protected boolean canHarvestBlock( World world, BlockPos pos )
|
||||
|
@ -50,7 +50,6 @@ public class IDAssigner
|
||||
}
|
||||
catch( NumberFormatException e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user