mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-27 19:47:44 +01:00
Formatting
This commit is contained in:
parent
5085f8fa58
commit
641ca02120
@ -218,4 +218,4 @@ publishing {
|
||||
task copyData(type: Copy) {
|
||||
from("MinestomDataGenerator/Minestom-Data/$mcVersion/")
|
||||
into(new File(project.projectDir, "/src/main/resources/minecraft_data/"))
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,4 @@ run {
|
||||
]
|
||||
)
|
||||
dependsOn(project.rootProject.tasks.getByName("copyData"))
|
||||
}
|
||||
}
|
||||
|
@ -94,4 +94,4 @@ public class Generators {
|
||||
).generate();
|
||||
LOGGER.info("Finished generating code");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,4 @@ public abstract class MinestomCodeGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package net.minestom.codegen.attribute;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.squareup.javapoet.*;
|
||||
import net.minestom.codegen.MinestomCodeGenerator;
|
||||
@ -135,13 +137,13 @@ public final class AttributeGenerator extends MinestomCodeGenerator {
|
||||
// toString method
|
||||
attributeClass.addMethod(
|
||||
MethodSpec.methodBuilder("toString")
|
||||
.addAnnotation(NotNull.class)
|
||||
.addAnnotation(Override.class)
|
||||
.returns(String.class)
|
||||
.addAnnotation(NotNull.class)
|
||||
.addAnnotation(Override.class)
|
||||
.returns(String.class)
|
||||
// this resolves to [Namespace]
|
||||
.addStatement("return \"[\" + this.id + \"]\"")
|
||||
.addModifiers(Modifier.PUBLIC)
|
||||
.build()
|
||||
.addStatement("return \"[\" + this.id + \"]\"")
|
||||
.addModifiers(Modifier.PUBLIC)
|
||||
.build()
|
||||
);
|
||||
// Creating ClampedAttribute
|
||||
ClassName clampedAttributeClassName = ClassName.get("net.minestom.server.attribute", "ClampedAttribute");
|
||||
@ -251,4 +253,4 @@ public final class AttributeGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -412,4 +412,4 @@ public final class BlockGenerator extends MinestomCodeGenerator {
|
||||
// Write files to outputFolder
|
||||
writeFiles(filesToWrite, outputFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -435,4 +435,4 @@ public final class EntityTypeGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package net.minestom.codegen.entity;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.squareup.javapoet.*;
|
||||
import net.minestom.codegen.MinestomCodeGenerator;
|
||||
@ -216,4 +218,4 @@ public final class VillagerProfessionGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package net.minestom.codegen.entity;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.squareup.javapoet.*;
|
||||
import net.minestom.codegen.MinestomCodeGenerator;
|
||||
@ -168,4 +170,4 @@ public final class VillagerTypeGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,9 +136,9 @@ public final class FluidGenerator extends MinestomCodeGenerator {
|
||||
String fluidName = fluid.get("name").getAsString();
|
||||
|
||||
fluidClass.addEnumConstant(fluidName, TypeSpec.anonymousClassBuilder(
|
||||
"$T.from($S)",
|
||||
namespaceIDClassName,
|
||||
fluid.get("id").getAsString()
|
||||
"$T.from($S)",
|
||||
namespaceIDClassName,
|
||||
fluid.get("id").getAsString()
|
||||
).build()
|
||||
);
|
||||
}
|
||||
@ -154,4 +154,4 @@ public final class FluidGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,4 +153,4 @@ public final class EnchantmentGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ public final class MaterialGenerator extends MinestomCodeGenerator {
|
||||
.build()
|
||||
);
|
||||
if (ap.get("slot") != null) {
|
||||
switch(ap.get("slot").getAsString()) {
|
||||
switch (ap.get("slot").getAsString()) {
|
||||
case "head": {
|
||||
enumConst.addMethod(
|
||||
MethodSpec.methodBuilder("isHelmet")
|
||||
@ -348,4 +348,4 @@ public final class MaterialGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,4 +152,4 @@ public final class ParticleGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,4 +153,4 @@ public final class PotionEffectGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,4 +153,4 @@ public final class PotionTypeGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,4 +152,4 @@ public final class SoundEventGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,4 +153,4 @@ public final class StatisticGenerator extends MinestomCodeGenerator {
|
||||
outputFolder
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,4 +18,4 @@ public final class NameUtil {
|
||||
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user