Many things

This commit is contained in:
Anuken
2020-08-06 20:00:02 -04:00
parent ac3106728f
commit 176e4a3bb9
20 changed files with 370 additions and 167 deletions

View File

@@ -131,7 +131,7 @@ public class Annotations{
/** Registers a logic node's slot. */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.SOURCE)
public @interface NodeSlotDef{
public @interface Slot{
boolean input() default false;
}

View File

@@ -11,7 +11,7 @@ import javax.annotation.processing.*;
import javax.lang.model.element.*;
import javax.lang.model.type.*;
@SupportedAnnotationTypes("mindustry.annotations.Annotations.NodeSlotDef")
@SupportedAnnotationTypes("mindustry.annotations.Annotations.Slot")
public class NodeSlotProcessor extends BaseProcessor{
@Override
@@ -20,10 +20,10 @@ public class NodeSlotProcessor extends BaseProcessor{
.addModifiers(Modifier.PUBLIC);
ObjectMap<Stype, Seq<String>> fields = new ObjectMap<>();
for(Svar var : fields(NodeSlotDef.class)){
for(Svar var : fields(Slot.class)){
String type = var.mirror().toString();
boolean overrideInput = var.annotation(NodeSlotDef.class).input();
boolean overrideInput = var.annotation(Slot.class).input();
boolean output = (type.contains("SetObj") || type.contains("SetNum") || type.contains("Runnable")) && !overrideInput;
String objType = output ?