diff --git a/DataGenerator/src/main/java/net/minestom/generators/FeatureFlagGenerator.java b/DataGenerator/src/main/java/net/minestom/generators/FeatureFlagGenerator.java index 78913db..926b3e1 100644 --- a/DataGenerator/src/main/java/net/minestom/generators/FeatureFlagGenerator.java +++ b/DataGenerator/src/main/java/net/minestom/generators/FeatureFlagGenerator.java @@ -1,6 +1,7 @@ package net.minestom.generators; import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.flag.FeatureFlags; import net.minestom.datagen.DataGenerator; @@ -9,12 +10,15 @@ public final class FeatureFlagGenerator extends DataGenerator { @Override - public JsonArray generate() throws Exception { - JsonArray flags = new JsonArray(); + public JsonObject generate() throws Exception { + JsonObject flags = new JsonObject(); Set featureFlags = FeatureFlags.REGISTRY.toNames(FeatureFlags.REGISTRY.allFlags()); + int idCounter = 0; for (ResourceLocation namespace : featureFlags) { - flags.add(namespace.toString()); + JsonObject flag = new JsonObject(); + flag.addProperty("id", idCounter++); + flags.add(namespace.toString(), flag); } return flags;