From c8d0b783d8d18acd6ef725b29ea6d81b2263e355 Mon Sep 17 00:00:00 2001 From: Konstantin Shandurenko Date: Thu, 25 Feb 2021 09:01:13 +0300 Subject: [PATCH] Made autogenerated fields final --- .../net/minestom/server/entity/EntityType.java | 16 ++++++++-------- .../java/net/minestom/codegen/EnumGenerator.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/autogenerated/java/net/minestom/server/entity/EntityType.java b/src/autogenerated/java/net/minestom/server/entity/EntityType.java index 6f4728d94..2be6b74ca 100644 --- a/src/autogenerated/java/net/minestom/server/entity/EntityType.java +++ b/src/autogenerated/java/net/minestom/server/entity/EntityType.java @@ -340,21 +340,21 @@ public enum EntityType { private static final EntityType[] VALUES = values(); @NotNull - private String namespaceID; + private final String namespaceID; - private double width; + private final double width; - private double height; + private final double height; @NotNull - private BiFunction metaConstructor; + private final BiFunction metaConstructor; @NotNull - private EntitySpawnType spawnType; + private final EntitySpawnType spawnType; - EntityType(@NotNull final String namespaceID, final double width, final double height, - @NotNull final BiFunction metaConstructor, - @NotNull final EntitySpawnType spawnType) { + EntityType(@NotNull String namespaceID, double width, double height, + @NotNull BiFunction metaConstructor, + @NotNull EntitySpawnType spawnType) { this.namespaceID = namespaceID; this.width = width; this.height = height; diff --git a/src/generators/java/net/minestom/codegen/EnumGenerator.java b/src/generators/java/net/minestom/codegen/EnumGenerator.java index 06a3b2eea..4400596f3 100644 --- a/src/generators/java/net/minestom/codegen/EnumGenerator.java +++ b/src/generators/java/net/minestom/codegen/EnumGenerator.java @@ -95,7 +95,7 @@ public class EnumGenerator implements CodeGenerator { // properties for (ParameterSpec property : parameters) { enumClass.addField(FieldSpec.builder(property.type, property.name) - .addModifiers(Modifier.PRIVATE) + .addModifiers(Modifier.PRIVATE, Modifier.FINAL) .addAnnotations(property.annotations) .build()); }