This commit is contained in:
Anuken 2022-10-26 15:52:51 -04:00
parent 4a7231fb5a
commit 6566bf9dd5
6 changed files with 18 additions and 3 deletions

View File

@ -381,12 +381,14 @@ public class EntityProcess extends BaseProcessor{
syncedFields.sortComparing(Selement::name); syncedFields.sortComparing(Selement::name);
//override toString method if(!methods.containsKey("toString()")){
builder.addMethod(MethodSpec.methodBuilder("toString") //override toString method
builder.addMethod(MethodSpec.methodBuilder("toString")
.addAnnotation(Override.class) .addAnnotation(Override.class)
.returns(String.class) .returns(String.class)
.addModifiers(Modifier.PUBLIC) .addModifiers(Modifier.PUBLIC)
.addStatement("return $S + $L", name + "#", "id").build()); .addStatement("return $S + $L", name + "#", "id").build());
}
EntityIO io = new EntityIO(type.name(), builder, allFieldSpecs, serializer, rootDirectory.child("annotations/src/main/resources/revisions").child(type.name())); EntityIO io = new EntityIO(type.name(), builder, allFieldSpecs, serializer, rootDirectory.child("annotations/src/main/resources/revisions").child(type.name()));
//entities with no sync comp and no serialization gen no code //entities with no sync comp and no serialization gen no code

Binary file not shown.

View File

@ -2016,5 +2016,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
out.setCentered(x, y, block.size * tilesize, block.size * tilesize); out.setCentered(x, y, block.size * tilesize, block.size * tilesize);
} }
@Override
@Replace
public String toString(){
return "Building#" + id() + "[" + tileX() + "," + tileY() + "]:" + block;
}
//endregion //endregion
} }

View File

@ -688,4 +688,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
//deaths are synced; this calls killed() //deaths are synced; this calls killed()
Call.unitDeath(id); Call.unitDeath(id);
} }
@Override
@Replace
public String toString(){
return "Unit#" + id() + ":" + type;
}
} }

View File

@ -17,6 +17,7 @@ import mindustry.world.meta.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
//TODO visuals! //TODO visuals!
/** Do not use this class! */
public class PayloadAmmoTurret extends Turret{ public class PayloadAmmoTurret extends Turret{
public ObjectMap<UnlockableContent, BulletType> ammoTypes = new ObjectMap<>(); public ObjectMap<UnlockableContent, BulletType> ammoTypes = new ObjectMap<>();

View File

@ -25,4 +25,4 @@ org.gradle.caching=true
#used for slow jitpack builds; TODO see if this actually works #used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
archash=5a1cbb8b59 archash=2b9b7c4a1d