Skip to content

Commit

Permalink
feat: add hasData field to particles
Browse files Browse the repository at this point in the history
  • Loading branch information
mworzala committed May 30, 2024
1 parent 32a57f1 commit ceb729a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public enum DataGenType {
SOUND_SOURCES("sound_sources", new SoundSourceGenerator()),
VILLAGER_PROFESSIONS("villager_professions", new VillagerProfessionGenerator()),
VILLAGER_TYPES("villager_types", new VillagerTypeGenerator()),
// COMPONENTS("components", new ComponentGenerator()),
RECIPE_TYPE("recipe_types", new RecipeTypeGenerator()),

BLOCK_TAGS("tags/block_tags", new BlockTagGenerator()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package net.minestom.generators;

import com.google.gson.JsonObject;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minestom.datagen.DataGenerator;

Expand All @@ -13,6 +16,7 @@ public JsonObject generate() {
final var location = registry.getKey(particleType);
JsonObject particle = new JsonObject();
particle.addProperty("id", registry.getId(particleType));
particle.addProperty("hasData", !(particleType instanceof SimpleParticleType));
particles.add(location.toString(), particle);
}
return particles;
Expand Down

0 comments on commit ceb729a

Please sign in to comment.