Slexom / earth2java

Minecraft Mod that brings mobs , and their mechanics, from MCE to Java Edition
https://www.curseforge.com/minecraft/mc-mods/earth2java
MIT License
26 stars 14 forks source link

[Feature request] Add support for modded biomes #10

Closed calloatti closed 4 years ago

calloatti commented 4 years ago

Target Version Mod Loader: Fabric Minecraft Version: 1.16.1

Tried using the mod with https://www.curseforge.com/minecraft/mc-mods/ecotones

No earth2java mobs spawn due to the config enumerating the biome names. ecotones has like 137 biomes.

Comments about some options on how to implement it in the Fabric Discord: https://discord.com/channels/507304429255393322/608088354042544139/739256784505798708

"support biome types, for instance"

Linguardium commented 4 years ago

Best option i could come up with that wouldnt probably cause false positives (and thus require a blacklist...which is a necessity anyway) is to scan the spawn entries for each biome, if a related animal exists, add your animal to the spawn list.

        Registry.BIOME.forEach(biome -> {
            if (biome.getEntitySpawnList(SpawnGroup.CREATURE).stream().anyMatch(entry->entry.type.equals(EntityType.COW))) {
                biome.getEntitySpawnList(SpawnGroup.CREATURE).add(new Biome.SpawnEntry(COWBLOOM,100,2,4));
            }
        });

something like this (probably not functional code, was ripped from another project) dont forget the registry added callback too :)

Slexom commented 4 years ago

A support for biome category is under development and will be released on the next days. Will work the same way as the forge counterpart.

Slexom commented 4 years ago

The idea around that system was to have the user free to have any creature in the biome the user want. Having a cow, for example, spawn where the vanilla cow is, is a good idea but what about Wooly Cow? Is a creature that live only on cold biomes. Or the Cluckshroom, that live in mushroom fields only. As for the default config I'm trying to keep the base biome found in MCE(Plains, Desert and so on) and expand the options keeping cold to cold, hot to hot, and so on. Enhancing the current way with the addition of Biome Categories is a good solution to have the user free to choose where to place the creature and have the compatibility with other mods. The configuration will change to use categories by default.