diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 470cbd4e4e..ee08d192b5 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -36,19 +36,7 @@ import java.lang.reflect.*; public class ContentParser{ private static final boolean ignoreUnknownFields = true; private ObjectMap, ContentType> contentTypes = new ObjectMap<>(); - private StringMap legacyUnitMap = StringMap.of( - "Dagger", "GroundUnit", - "Eruptor", "GroundUnit", - "Titan", "GroundUnit", - "Fortress", "GroundUnit", - "Crawler", "GroundUnit", - "Revenant", "HoverUnit", - "Draug", "MinerDrone", - "Phantom", "BuilderDrone", - "Spirit", "RepairDrone", - "Wraith", "FlyingUnit", - "Ghoul", "FlyingUnit" - ); + private ObjectMap, FieldParser> classParsers = new ObjectMap, FieldParser>(){{ put(Effect.class, (type, data) -> field(Fx.class, data)); put(Schematic.class, (type, data) -> { @@ -289,11 +277,10 @@ public class ContentParser{ ContentType.unit, (TypeParser)(mod, name, value) -> { readBundle(ContentType.unit, name, value); - //TODO fix UnitType unit; if(locate(ContentType.unit, name) == null){ - Class type = resolve(legacyUnitMap.get(Strings.capitalize(getType(value)), getType(value)), "mindustry.entities.type.base"); unit = new UnitType(mod + "-" + name); + unit.constructor = Reflect.cons(resolve(Strings.capitalize(getType(value)), "mindustry.gen")); }else{ unit = locate(ContentType.unit, name); }