Fixed UnitReq parsing

This commit is contained in:
Anuken 2021-02-18 21:07:48 -05:00
parent 78317e6126
commit d5448b59a2
4 changed files with 12 additions and 12 deletions

View File

@ -275,15 +275,6 @@ public class ContentParser{
if(value.has("requirements")){
JsonValue rec = value.remove("requirements");
//intermediate class for parsing
class UnitReq{
public Block block;
public ItemStack[] requirements = {};
@Nullable
public UnitType previous;
public float time = 60f * 10f;
}
UnitReq req = parser.readValue(UnitReq.class, rec);
if(req.block instanceof Reconstructor r){
@ -732,4 +723,13 @@ public class ContentParser{
T parse(String mod, String name, JsonValue value) throws Exception;
}
//intermediate class for parsing
static class UnitReq{
public Block block;
public ItemStack[] requirements = {};
@Nullable
public UnitType previous;
public float time = 60f * 10f;
}
}

View File

@ -21,7 +21,7 @@ public class Accelerator extends Block{
public @Load("launch-arrow") TextureRegion arrowRegion;
public Block launching = Blocks.coreNucleus;
public int[] capacities;
public int[] capacities = {};
public Accelerator(String name){
super(name);

View File

@ -24,7 +24,7 @@ import static mindustry.Vars.*;
public class Reconstructor extends UnitBlock{
public float constructTime = 60 * 2;
public Seq<UnitType[]> upgrades = new Seq<>();
public int[] capacities;
public int[] capacities = {};
public Reconstructor(String name){
super(name);

View File

@ -24,7 +24,7 @@ import mindustry.world.consumers.*;
import mindustry.world.meta.*;
public class UnitFactory extends UnitBlock{
public int[] capacities;
public int[] capacities = {};
public Seq<UnitPlan> plans = new Seq<>(4);