Fixed mono presence "corrupting" older saves
This commit is contained in:
@@ -98,6 +98,8 @@ public class Annotations{
|
|||||||
boolean serialize() default true;
|
boolean serialize() default true;
|
||||||
/** Whether to generate IO code. This is for advanced usage only. */
|
/** Whether to generate IO code. This is for advanced usage only. */
|
||||||
boolean genio() default true;
|
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. */
|
/** Indicates an internal interface for entity components. */
|
||||||
|
|||||||
@@ -240,7 +240,6 @@ public class EntityProcess extends BaseProcessor{
|
|||||||
//look at each definition
|
//look at each definition
|
||||||
for(Selement<?> type : allDefs){
|
for(Selement<?> type : allDefs){
|
||||||
EntityDef ann = type.annotation(EntityDef.class);
|
EntityDef ann = type.annotation(EntityDef.class);
|
||||||
boolean isFinal = ann.isFinal();
|
|
||||||
|
|
||||||
//all component classes (not interfaces)
|
//all component classes (not interfaces)
|
||||||
Seq<Stype> components = allComponents(type);
|
Seq<Stype> components = allComponents(type);
|
||||||
@@ -274,6 +273,10 @@ public class EntityProcess extends BaseProcessor{
|
|||||||
name += "Entity";
|
name += "Entity";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ann.legacy()){
|
||||||
|
name += "Legacy" + Strings.capitalize(type.name());
|
||||||
|
}
|
||||||
|
|
||||||
//skip double classes
|
//skip double classes
|
||||||
if(usedNames.containsKey(name)){
|
if(usedNames.containsKey(name)){
|
||||||
extraNames.get(usedNames.get(name), ObjectSet::new).add(type.name());
|
extraNames.get(usedNames.get(name), ObjectSet::new).add(type.name());
|
||||||
|
|||||||
1
annotations/src/main/resources/revisions/quad/3.json
Normal file
1
annotations/src/main/resources/revisions/quad/3.json
Normal 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}]}
|
||||||
@@ -2,17 +2,13 @@ package mindustry.ai.types;
|
|||||||
|
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
import arc.struct.*;
|
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.ai.formations.*;
|
import mindustry.ai.formations.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
|
||||||
import mindustry.world.*;
|
|
||||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||||
|
|
||||||
public class FormationAI extends AIController implements FormationMember{
|
public class FormationAI extends AIController implements FormationMember{
|
||||||
private static Seq<Tile> tiles = new Seq<>();
|
|
||||||
public Unit leader;
|
public Unit leader;
|
||||||
|
|
||||||
private Vec3 target = new Vec3();
|
private Vec3 target = new Vec3();
|
||||||
@@ -30,9 +26,8 @@ public class FormationAI extends AIController implements FormationMember{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateUnit(){
|
public void updateUnit(){
|
||||||
UnitType type = unit.type;
|
|
||||||
|
|
||||||
if(leader.dead){
|
if(leader == null || leader.dead){
|
||||||
unit.resetController();
|
unit.resetController();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ public class UnitTypes implements ContentList{
|
|||||||
public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType spiroct, arkyid, toxopid;
|
public static @EntityDef({Unitc.class, Legsc.class, Builderc.class}) UnitType spiroct, arkyid, toxopid;
|
||||||
|
|
||||||
//air (no special traits)
|
//air (no special traits)
|
||||||
public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra, mono;
|
public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra;
|
||||||
|
|
||||||
|
//air, legacy mining
|
||||||
|
public static @EntityDef(value = {Unitc.class}, legacy = true) UnitType mono;
|
||||||
|
|
||||||
//air + building + mining
|
//air + building + mining
|
||||||
public static @EntityDef({Unitc.class, Builderc.class}) UnitType poly;
|
public static @EntityDef({Unitc.class, Builderc.class}) UnitType poly;
|
||||||
@@ -42,13 +45,13 @@ public class UnitTypes implements ContentList{
|
|||||||
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType mega;
|
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType mega;
|
||||||
|
|
||||||
//air + building + payload
|
//air + building + payload
|
||||||
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType quad;
|
public static @EntityDef(value = {Unitc.class, Builderc.class, Payloadc.class}, legacy = true) UnitType quad;
|
||||||
|
|
||||||
//air + building + payload
|
//air + building + payload
|
||||||
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class, AmmoDistributec.class}) UnitType oct;
|
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class, AmmoDistributec.class}) UnitType oct;
|
||||||
|
|
||||||
//air + building + mining
|
//air + building + mining
|
||||||
public static @EntityDef({Unitc.class, Builderc.class,}) UnitType alpha, beta, gamma;
|
public static @EntityDef({Unitc.class, Builderc.class}) UnitType alpha, beta, gamma;
|
||||||
|
|
||||||
//water
|
//water
|
||||||
public static @EntityDef({Unitc.class, WaterMovec.class}) UnitType risso, minke, bryde, sei, omura;
|
public static @EntityDef({Unitc.class, WaterMovec.class}) UnitType risso, minke, bryde, sei, omura;
|
||||||
|
|||||||
Reference in New Issue
Block a user