mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 09:17:19 +07:00
Fixed UnitReq parsing
This commit is contained in:
parent
78317e6126
commit
d5448b59a2
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user