From b8dac1e408f94fb52d007c208e50664b728a2eee Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 21 May 2022 12:40:16 -0400 Subject: [PATCH] JSON UnitType `type: ` support --- core/src/mindustry/entities/part/RegionPart.java | 1 - core/src/mindustry/mod/ContentParser.java | 4 +++- core/src/mindustry/world/draw/DrawFlame.java | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/part/RegionPart.java b/core/src/mindustry/entities/part/RegionPart.java index a03d407001..8aa9b31f3c 100644 --- a/core/src/mindustry/entities/part/RegionPart.java +++ b/core/src/mindustry/entities/part/RegionPart.java @@ -143,7 +143,6 @@ public class RegionPart extends DrawPart{ String realName = this.name == null ? name + suffix : this.name; if(drawRegion){ - //TODO l/r if(mirror && turretShading){ regions = new TextureRegion[]{ Core.atlas.find(realName + "-r"), diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 69810ab76e..39c7f9bfba 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -437,7 +437,9 @@ public class ContentParser{ UnitType unit; if(locate(ContentType.unit, name) == null){ - unit = new UnitType(mod + "-" + name); + + unit = make(resolve(value.getString("type", ""), UnitType.class), mod + "-" + name); + var typeVal = value.get("type"); if(typeVal != null && !typeVal.isString()){ diff --git a/core/src/mindustry/world/draw/DrawFlame.java b/core/src/mindustry/world/draw/DrawFlame.java index 6a678f4ede..8137549efe 100644 --- a/core/src/mindustry/world/draw/DrawFlame.java +++ b/core/src/mindustry/world/draw/DrawFlame.java @@ -9,7 +9,6 @@ import mindustry.gen.*; import mindustry.graphics.*; import mindustry.world.*; -//TODO remake/remove public class DrawFlame extends DrawBlock{ public Color flameColor = Color.valueOf("ffc999"); public TextureRegion top;