Skip to content

Commit f952749

Browse files
authored
Fix water_creature entities no longer being classified correctly (#67)
1 parent 7609276 commit f952749

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mc/1.21.11/src/main/java/dev/u9g/minecraftdatagenerator/generators/EntitiesDataGenerator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import net.minecraft.world.entity.Mob;
1616
import net.minecraft.world.entity.ambient.AmbientCreature;
1717
import net.minecraft.world.entity.animal.Animal;
18-
18+
import net.minecraft.world.entity.animal.fish.WaterAnimal;
1919
import net.minecraft.world.entity.monster.Monster;
2020
import net.minecraft.world.entity.projectile.Projectile;
2121

@@ -89,7 +89,9 @@ private static String getCategoryFrom(EntityType<?> entityType) {
8989
//by the Entity class hierarchy (which has some weirdness too by the way)
9090
private static String getEntityTypeForClass(Class<? extends Entity> entityClass) {
9191
//Top-level classifications
92-
// Note: WaterAnimal was removed in 1.21.11, water creatures now use Animal directly
92+
if (WaterAnimal.class.isAssignableFrom(entityClass)) {
93+
return "water_creature";
94+
}
9395
if (Animal.class.isAssignableFrom(entityClass)) {
9496
return "animal";
9597
}

0 commit comments

Comments
 (0)