From 641ca02120517ea7bf3c07a6d59fa7763d0eafb4 Mon Sep 17 00:00:00 2001 From: TheMode Date: Sun, 6 Jun 2021 04:48:43 +0200 Subject: [PATCH] Formatting --- build.gradle | 2 +- code-generators/build.gradle | 2 +- .../java/net/minestom/codegen/Generators.java | 2 +- .../codegen/MinestomCodeGenerator.java | 2 +- .../codegen/attribute/AttributeGenerator.java | 18 ++++++++++-------- .../codegen/blocks/BlockGenerator.java | 2 +- .../codegen/entity/EntityTypeGenerator.java | 2 +- .../entity/VillagerProfessionGenerator.java | 6 ++++-- .../codegen/entity/VillagerTypeGenerator.java | 6 ++++-- .../minestom/codegen/fluid/FluidGenerator.java | 8 ++++---- .../codegen/item/EnchantmentGenerator.java | 2 +- .../codegen/item/MaterialGenerator.java | 4 ++-- .../codegen/particle/ParticleGenerator.java | 2 +- .../codegen/potion/PotionEffectGenerator.java | 2 +- .../codegen/potion/PotionTypeGenerator.java | 2 +- .../codegen/sound/SoundEventGenerator.java | 2 +- .../codegen/statistics/StatisticGenerator.java | 2 +- .../net/minestom/codegen/util/NameUtil.java | 2 +- 18 files changed, 37 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index fcc1a1989..5cb87fb49 100644 --- a/build.gradle +++ b/build.gradle @@ -218,4 +218,4 @@ publishing { task copyData(type: Copy) { from("MinestomDataGenerator/Minestom-Data/$mcVersion/") into(new File(project.projectDir, "/src/main/resources/minecraft_data/")) -} \ No newline at end of file +} diff --git a/code-generators/build.gradle b/code-generators/build.gradle index aedc7a40d..8a32a67f9 100644 --- a/code-generators/build.gradle +++ b/code-generators/build.gradle @@ -40,4 +40,4 @@ run { ] ) dependsOn(project.rootProject.tasks.getByName("copyData")) -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/Generators.java b/code-generators/src/main/java/net/minestom/codegen/Generators.java index ef8cf2fb9..24d721b2a 100644 --- a/code-generators/src/main/java/net/minestom/codegen/Generators.java +++ b/code-generators/src/main/java/net/minestom/codegen/Generators.java @@ -94,4 +94,4 @@ public class Generators { ).generate(); LOGGER.info("Finished generating code"); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/MinestomCodeGenerator.java b/code-generators/src/main/java/net/minestom/codegen/MinestomCodeGenerator.java index 51e0c5d19..6f2787267 100644 --- a/code-generators/src/main/java/net/minestom/codegen/MinestomCodeGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/MinestomCodeGenerator.java @@ -26,4 +26,4 @@ public abstract class MinestomCodeGenerator { } } } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/attribute/AttributeGenerator.java b/code-generators/src/main/java/net/minestom/codegen/attribute/AttributeGenerator.java index 48144483c..c1c71832e 100644 --- a/code-generators/src/main/java/net/minestom/codegen/attribute/AttributeGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/attribute/AttributeGenerator.java @@ -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 ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/blocks/BlockGenerator.java b/code-generators/src/main/java/net/minestom/codegen/blocks/BlockGenerator.java index 1bead6959..a7752d71c 100644 --- a/code-generators/src/main/java/net/minestom/codegen/blocks/BlockGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/blocks/BlockGenerator.java @@ -412,4 +412,4 @@ public final class BlockGenerator extends MinestomCodeGenerator { // Write files to outputFolder writeFiles(filesToWrite, outputFolder); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/entity/EntityTypeGenerator.java b/code-generators/src/main/java/net/minestom/codegen/entity/EntityTypeGenerator.java index e4dede1aa..001184111 100644 --- a/code-generators/src/main/java/net/minestom/codegen/entity/EntityTypeGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/entity/EntityTypeGenerator.java @@ -435,4 +435,4 @@ public final class EntityTypeGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/entity/VillagerProfessionGenerator.java b/code-generators/src/main/java/net/minestom/codegen/entity/VillagerProfessionGenerator.java index c0513aba2..5974d0ebb 100644 --- a/code-generators/src/main/java/net/minestom/codegen/entity/VillagerProfessionGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/entity/VillagerProfessionGenerator.java @@ -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 ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/entity/VillagerTypeGenerator.java b/code-generators/src/main/java/net/minestom/codegen/entity/VillagerTypeGenerator.java index bdc019ba7..190375301 100644 --- a/code-generators/src/main/java/net/minestom/codegen/entity/VillagerTypeGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/entity/VillagerTypeGenerator.java @@ -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 ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/fluid/FluidGenerator.java b/code-generators/src/main/java/net/minestom/codegen/fluid/FluidGenerator.java index a058190e8..86d66e554 100644 --- a/code-generators/src/main/java/net/minestom/codegen/fluid/FluidGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/fluid/FluidGenerator.java @@ -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 ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/item/EnchantmentGenerator.java b/code-generators/src/main/java/net/minestom/codegen/item/EnchantmentGenerator.java index 44f567d83..5919c5ce1 100644 --- a/code-generators/src/main/java/net/minestom/codegen/item/EnchantmentGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/item/EnchantmentGenerator.java @@ -153,4 +153,4 @@ public final class EnchantmentGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/item/MaterialGenerator.java b/code-generators/src/main/java/net/minestom/codegen/item/MaterialGenerator.java index c42b24fe9..a0366cb2e 100644 --- a/code-generators/src/main/java/net/minestom/codegen/item/MaterialGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/item/MaterialGenerator.java @@ -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 ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/particle/ParticleGenerator.java b/code-generators/src/main/java/net/minestom/codegen/particle/ParticleGenerator.java index af759f378..af59f09cd 100644 --- a/code-generators/src/main/java/net/minestom/codegen/particle/ParticleGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/particle/ParticleGenerator.java @@ -152,4 +152,4 @@ public final class ParticleGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/potion/PotionEffectGenerator.java b/code-generators/src/main/java/net/minestom/codegen/potion/PotionEffectGenerator.java index 2144aa838..fdfa2a95d 100644 --- a/code-generators/src/main/java/net/minestom/codegen/potion/PotionEffectGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/potion/PotionEffectGenerator.java @@ -153,4 +153,4 @@ public final class PotionEffectGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/potion/PotionTypeGenerator.java b/code-generators/src/main/java/net/minestom/codegen/potion/PotionTypeGenerator.java index c8ea5c835..29ba63fb3 100644 --- a/code-generators/src/main/java/net/minestom/codegen/potion/PotionTypeGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/potion/PotionTypeGenerator.java @@ -153,4 +153,4 @@ public final class PotionTypeGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/sound/SoundEventGenerator.java b/code-generators/src/main/java/net/minestom/codegen/sound/SoundEventGenerator.java index a18d9ce4e..c56f71935 100644 --- a/code-generators/src/main/java/net/minestom/codegen/sound/SoundEventGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/sound/SoundEventGenerator.java @@ -152,4 +152,4 @@ public final class SoundEventGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/statistics/StatisticGenerator.java b/code-generators/src/main/java/net/minestom/codegen/statistics/StatisticGenerator.java index 2e648b19d..dfdc7e5da 100644 --- a/code-generators/src/main/java/net/minestom/codegen/statistics/StatisticGenerator.java +++ b/code-generators/src/main/java/net/minestom/codegen/statistics/StatisticGenerator.java @@ -153,4 +153,4 @@ public final class StatisticGenerator extends MinestomCodeGenerator { outputFolder ); } -} \ No newline at end of file +} diff --git a/code-generators/src/main/java/net/minestom/codegen/util/NameUtil.java b/code-generators/src/main/java/net/minestom/codegen/util/NameUtil.java index 7f7f3d08b..b0fd38471 100644 --- a/code-generators/src/main/java/net/minestom/codegen/util/NameUtil.java +++ b/code-generators/src/main/java/net/minestom/codegen/util/NameUtil.java @@ -18,4 +18,4 @@ public final class NameUtil { sb.setCharAt(0, Character.toUpperCase(sb.charAt(0))); return sb.toString(); } -} \ No newline at end of file +}