Turn inspections up to 11

OK, so let's get this out of the way, there's some actual changes mixed
in here too. I'm really sorry:
 - Turtles can now not be renamed with unnamed item tags (previously it
   would clear the name, this seemed a little unideal).
 - commands.getBlock(s)Data will also include NBT.

Now, onto the horror story which is these inspection changes:
 - Make a lot of methods static
 - Typo fixes
 - Make utility classes final + private constructor
 - Lots of reformatting (ifs -> ternary, invert control flow, etc...)
 - ???
 - Profit!

I'm so going to regret this - can pretty much guarantee this is going to
break something.
This commit is contained in:
SquidDev
2019-03-29 21:26:21 +00:00
parent 1230cabcb0
commit 173ea72001
205 changed files with 3653 additions and 1888 deletions
@@ -157,7 +157,7 @@ public class ComputerCraft
public static final int terminalHeight_pocketComputer = 20;
// Blocks and Items
public static class Blocks
public static final class Blocks
{
public static BlockComputer computer;
public static BlockCommandComputer commandComputer;
@@ -172,7 +172,7 @@ public class ComputerCraft
public static BlockWiredModemFull wiredModemFull;
}
public static class Items
public static final class Items
{
public static ItemComputer computer;
public static ItemCommandComputer commandComputer;
@@ -195,7 +195,7 @@ public class ComputerCraft
public static ItemBlock wiredModemFull;
}
public static class TurtleUpgrades
public static final class TurtleUpgrades
{
public static TurtleModem wirelessModem;
public static TurtleModem advancedModem;
@@ -209,7 +209,7 @@ public class ComputerCraft
public static TurtleHoe diamondHoe;
}
public static class PocketUpgrades
public static final class PocketUpgrades
{
public static PocketModem wirelessModem;
public static PocketModem advancedModem;
@@ -220,7 +220,7 @@ public class ComputerCraft
}
@Deprecated
public static class Upgrades
public static final class Upgrades
{
public static TurtleModem advancedModem;
}
@@ -239,7 +239,7 @@ public class ComputerCraft
public static List<IPeripheralProvider> peripheralProviders = new ArrayList<>();
// Implementation
@Mod.Instance( value = ComputerCraft.MOD_ID )
@Mod.Instance( ComputerCraft.MOD_ID )
public static ComputerCraft instance;
@SidedProxy(
@@ -556,7 +556,7 @@ public class ComputerCraft
private static File getContainingJar( Class<?> modClass )
{
String path = modClass.getProtectionDomain().getCodeSource().getLocation().getPath();
int bangIndex = path.indexOf( "!" );
int bangIndex = path.indexOf( '!' );
if( bangIndex >= 0 )
{
path = path.substring( 0, bangIndex );
@@ -587,7 +587,7 @@ public class ComputerCraft
private static File getDebugCodeDir( Class<?> modClass )
{
String path = modClass.getProtectionDomain().getCodeSource().getLocation().getPath();
int bangIndex = path.indexOf( "!" );
int bangIndex = path.indexOf( '!' );
return bangIndex >= 0 ? null : new File( new File( path ).getParentFile(), "../.." );
}