Fixed mono presence "corrupting" older saves

This commit is contained in:
Anuken
2020-11-08 20:24:31 -05:00
parent 23403d0c51
commit 2d4f4015b1
5 changed files with 14 additions and 10 deletions

View File

@@ -98,6 +98,8 @@ public class Annotations{
boolean serialize() default true;
/** Whether to generate IO code. This is for advanced usage only. */
boolean genio() default true;
/** Whether I made a massive mistake by merging two different class branches */
boolean legacy() default false;
}
/** Indicates an internal interface for entity components. */

View File

@@ -240,7 +240,6 @@ public class EntityProcess extends BaseProcessor{
//look at each definition
for(Selement<?> type : allDefs){
EntityDef ann = type.annotation(EntityDef.class);
boolean isFinal = ann.isFinal();
//all component classes (not interfaces)
Seq<Stype> components = allComponents(type);
@@ -274,6 +273,10 @@ public class EntityProcess extends BaseProcessor{
name += "Entity";
}
if(ann.legacy()){
name += "Legacy" + Strings.capitalize(type.name());
}
//skip double classes
if(usedNames.containsKey(name)){
extraNames.get(usedNames.get(name), ObjectSet::new).add(type.name());

View File

@@ -0,0 +1 @@
{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]}