mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-30 22:49:06 +07:00
Suppress gen deprecatio warning / Anuken/Mindustry-Suggestions/issues/2888
This commit is contained in:
@ -101,6 +101,8 @@ public class EntityProcess extends BaseProcessor{
|
||||
|
||||
inter.addJavadoc("Interface for {@link $L}", component.fullName());
|
||||
|
||||
skipDeprecated(inter);
|
||||
|
||||
//implement extra interfaces these components may have, e.g. position
|
||||
for(Stype extraInterface : component.interfaces().select(i -> !isCompInterface(i))){
|
||||
//javapoet completely chokes on this if I add `addSuperInterface` or create the type name with TypeName.get
|
||||
@ -570,6 +572,8 @@ public class EntityProcess extends BaseProcessor{
|
||||
.returns(tname(packageName + "." + name))
|
||||
.addStatement(ann.pooled() ? "return Pools.obtain($L.class, " +name +"::new)" : "return new $L()", name).build());
|
||||
|
||||
skipDeprecated(builder);
|
||||
|
||||
definitions.add(new EntityDefinition(packageName + "." + name, builder, type, typeIsBase ? null : baseClass, components, groups, allFieldSpecs, legacy));
|
||||
}
|
||||
|
||||
@ -837,6 +841,8 @@ public class EntityProcess extends BaseProcessor{
|
||||
TypeSpec.Builder nullBuilder = TypeSpec.classBuilder(className)
|
||||
.addModifiers(Modifier.FINAL);
|
||||
|
||||
skipDeprecated(nullBuilder);
|
||||
|
||||
nullBuilder.addSuperinterface(interf.tname());
|
||||
if(superclass != null) nullBuilder.superclass(tname(baseName(superclass)));
|
||||
|
||||
@ -980,6 +986,11 @@ public class EntityProcess extends BaseProcessor{
|
||||
throw new IllegalArgumentException("Missing types.");
|
||||
}
|
||||
|
||||
void skipDeprecated(TypeSpec.Builder builder){
|
||||
//deprecations are irrelevant in generated code
|
||||
builder.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "\"deprecation\"").build());
|
||||
}
|
||||
|
||||
class GroupDefinition{
|
||||
final String name;
|
||||
final ClassName baseType;
|
||||
|
@ -1888,7 +1888,7 @@ public class Blocks implements ContentList{
|
||||
requirements(Category.units, with(Items.copper, 50, Items.lead, 120, Items.silicon, 80));
|
||||
plans = Seq.with(
|
||||
new UnitPlan(UnitTypes.dagger, 60f * 15, with(Items.silicon, 10, Items.lead, 10)),
|
||||
new UnitPlan(UnitTypes.crawler, 60f * 12, with(Items.silicon, 10, Items.coal, 20)),
|
||||
new UnitPlan(UnitTypes.crawler, 60f * 10, with(Items.silicon, 8, Items.coal, 10)),
|
||||
new UnitPlan(UnitTypes.nova, 60f * 40, with(Items.silicon, 30, Items.lead, 20, Items.titanium, 20))
|
||||
);
|
||||
size = 3;
|
||||
|
Reference in New Issue
Block a user