starfish-studios / Naturalist

🦌 Enhances the overworld by adding new wildlife with unique behavior!
https://starfish-studios.com/mods/naturalist/downloads
Other
21 stars 17 forks source link

[Bug]: `Lion::finalizeSpawn` does not call super, preventing Forge from saving the `MobSpawnType` #20

Open Fuzss opened 4 months ago

Fuzss commented 4 months ago

Mod Version

4.0.3

Mod Loader

Forge

Mod Loader Version

47.2.0

What happened?

Lion::finalizeSpawn does not call super and therefore does not allow Forge to save the MobSpawnType: https://github.com/MinecraftForge/MinecraftForge/blob/309116520b7f308de93f93ff27b67762c3c57c9a/patches/minecraft/net/minecraft/world/entity/Mob.java.patch#L97 I don't really see a reason in your implementation why super shouldn't be called: https://github.com/starfish-studios/Naturalist/blob/d44a99bec6a9453fffe2655fb6d141cf55dda2bd/common/src/main/java/com/starfish_studios/naturalist/common/entity/Lion.java#L68 Having access to the MobSpawnType is important to mods like my Respawning Animals mod. Would be great if this could be fixed. Not sure if it's an issue with other mobs from this mod, too, only found the lion for now.

Also on another note I noticed this: [Respawning Animals/]: Mismatched spawn type for naturalist:butterfly! Mob is registered as AMBIENT, but spawning as CREATURE. Report this to the author of Naturalist at https://github.com/starfish-studios/Naturalist/issues. Registering an EntityType with a different MobCategory than is used for spawning is generally not so great since the mob will not count towards its own spawn cap which can lead to infinite spawning. In vanilla this is not an issue since there are vanilla mobs without this mismatch in the spawning pool which will fill up the mob cap on their own, but with mods such as Respawning Animals the mismatch has serious implications in game due to the spawning cycle changes. I honestly don't even know why the vanilla implementation works this way and even allows such a mismatch to exist. Is there any reason why you do not use the same MobCategory in both places?