mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-29 04:28:21 +01:00
Formatting
This commit is contained in:
parent
5085f8fa58
commit
641ca02120
@ -1,6 +1,8 @@
|
|||||||
package net.minestom.codegen.attribute;
|
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.google.gson.stream.JsonReader;
|
||||||
import com.squareup.javapoet.*;
|
import com.squareup.javapoet.*;
|
||||||
import net.minestom.codegen.MinestomCodeGenerator;
|
import net.minestom.codegen.MinestomCodeGenerator;
|
||||||
@ -135,13 +137,13 @@ public final class AttributeGenerator extends MinestomCodeGenerator {
|
|||||||
// toString method
|
// toString method
|
||||||
attributeClass.addMethod(
|
attributeClass.addMethod(
|
||||||
MethodSpec.methodBuilder("toString")
|
MethodSpec.methodBuilder("toString")
|
||||||
.addAnnotation(NotNull.class)
|
.addAnnotation(NotNull.class)
|
||||||
.addAnnotation(Override.class)
|
.addAnnotation(Override.class)
|
||||||
.returns(String.class)
|
.returns(String.class)
|
||||||
// this resolves to [Namespace]
|
// this resolves to [Namespace]
|
||||||
.addStatement("return \"[\" + this.id + \"]\"")
|
.addStatement("return \"[\" + this.id + \"]\"")
|
||||||
.addModifiers(Modifier.PUBLIC)
|
.addModifiers(Modifier.PUBLIC)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
// Creating ClampedAttribute
|
// Creating ClampedAttribute
|
||||||
ClassName clampedAttributeClassName = ClassName.get("net.minestom.server.attribute", "ClampedAttribute");
|
ClassName clampedAttributeClassName = ClassName.get("net.minestom.server.attribute", "ClampedAttribute");
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package net.minestom.codegen.entity;
|
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.google.gson.stream.JsonReader;
|
||||||
import com.squareup.javapoet.*;
|
import com.squareup.javapoet.*;
|
||||||
import net.minestom.codegen.MinestomCodeGenerator;
|
import net.minestom.codegen.MinestomCodeGenerator;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package net.minestom.codegen.entity;
|
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.google.gson.stream.JsonReader;
|
||||||
import com.squareup.javapoet.*;
|
import com.squareup.javapoet.*;
|
||||||
import net.minestom.codegen.MinestomCodeGenerator;
|
import net.minestom.codegen.MinestomCodeGenerator;
|
||||||
|
@ -136,9 +136,9 @@ public final class FluidGenerator extends MinestomCodeGenerator {
|
|||||||
String fluidName = fluid.get("name").getAsString();
|
String fluidName = fluid.get("name").getAsString();
|
||||||
|
|
||||||
fluidClass.addEnumConstant(fluidName, TypeSpec.anonymousClassBuilder(
|
fluidClass.addEnumConstant(fluidName, TypeSpec.anonymousClassBuilder(
|
||||||
"$T.from($S)",
|
"$T.from($S)",
|
||||||
namespaceIDClassName,
|
namespaceIDClassName,
|
||||||
fluid.get("id").getAsString()
|
fluid.get("id").getAsString()
|
||||||
).build()
|
).build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ public final class MaterialGenerator extends MinestomCodeGenerator {
|
|||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
if (ap.get("slot") != null) {
|
if (ap.get("slot") != null) {
|
||||||
switch(ap.get("slot").getAsString()) {
|
switch (ap.get("slot").getAsString()) {
|
||||||
case "head": {
|
case "head": {
|
||||||
enumConst.addMethod(
|
enumConst.addMethod(
|
||||||
MethodSpec.methodBuilder("isHelmet")
|
MethodSpec.methodBuilder("isHelmet")
|
||||||
|
Loading…
Reference in New Issue
Block a user