1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-24 17:14:50 +00:00

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:21:39 +00:00
parent 1230cabcb0
commit 173ea72001
205 changed files with 3653 additions and 1888 deletions

View File

@@ -6,7 +6,6 @@
package dan200.computercraft.shared;
import com.google.common.base.Preconditions;
import dan200.computercraft.ComputerCraft;
import dan200.computercraft.api.turtle.ITurtleUpgrade;
import dan200.computercraft.shared.computer.core.ComputerFamily;
@@ -27,9 +26,11 @@ public final class TurtleUpgrades
private static final Int2ObjectMap<ITurtleUpgrade> legacyUpgrades = new Int2ObjectOpenHashMap<>();
private static final IdentityHashMap<ITurtleUpgrade, String> upgradeOwners = new IdentityHashMap<>();
private TurtleUpgrades() {}
public static void register( @Nonnull ITurtleUpgrade upgrade )
{
Preconditions.checkNotNull( upgrade, "upgrade cannot be null" );
Objects.requireNonNull( upgrade, "upgrade cannot be null" );
int id = upgrade.getLegacyUpgradeID();
if( id >= 0 && id < 64 )
@@ -44,7 +45,7 @@ public final class TurtleUpgrades
static void registerInternal( ITurtleUpgrade upgrade )
{
Preconditions.checkNotNull( upgrade, "upgrade cannot be null" );
Objects.requireNonNull( upgrade, "upgrade cannot be null" );
// Check conditions
int legacyId = upgrade.getLegacyUpgradeID();