Implicit non-nullability for fields

This commit is contained in:
Anuken
2020-10-01 13:33:43 -04:00
parent b15cdfef46
commit 199be4d13d
37 changed files with 71 additions and 87 deletions

View File

@@ -2,7 +2,6 @@ package mindustry.game;
import arc.*;
import arc.scene.ui.layout.*;
import arc.util.ArcAnnotate.*;
import mindustry.ctype.*;
import mindustry.type.*;
@@ -10,7 +9,7 @@ import mindustry.type.*;
public class Objectives{
public static class Research implements Objective{
public @NonNull UnlockableContent content;
public UnlockableContent content;
public Research(UnlockableContent content){
this.content = content;
@@ -50,7 +49,7 @@ public class Objectives{
//TODO merge
public abstract static class SectorObjective implements Objective{
public @NonNull SectorPreset preset;
public SectorPreset preset;
}
/** Defines a specific objective for a game. */

View File

@@ -21,7 +21,7 @@ public class Schematic implements Publishable, Comparable<Schematic>{
/** Associated mod. If null, no mod is associated with this schematic. */
public @Nullable LoadedMod mod;
public Schematic(Seq<Stile> tiles, @NonNull StringMap tags, int width, int height){
public Schematic(Seq<Stile> tiles, StringMap tags, int width, int height){
this.tiles = tiles;
this.tags = tags;
this.width = width;
@@ -52,7 +52,7 @@ public class Schematic implements Publishable, Comparable<Schematic>{
return tiles.contains(s -> s.block instanceof CoreBlock);
}
public @NonNull CoreBlock findCore(){
public CoreBlock findCore(){
Stile tile = tiles.find(s -> s.block instanceof CoreBlock);
if(tile == null) throw new IllegalArgumentException("Schematic is missing a core!");
return (CoreBlock)tile.block;
@@ -118,7 +118,7 @@ public class Schematic implements Publishable, Comparable<Schematic>{
}
public static class Stile{
public @NonNull Block block;
public Block block;
public short x, y;
public Object config;
public byte rotation;

View File

@@ -74,7 +74,7 @@ public class Team implements Comparable<Team>{
/** @return the core items for this team, or an empty item module.
* Never add to the resulting item module, as it is mutable. */
public @NonNull ItemModule items(){
public ItemModule items(){
return core() == null ? ItemModule.empty : core().items;
}