Jump to content

Recommended Posts

Posted

I am trying to make a Biome(and plan to make multiple more) But I can't figure out what's wrong with my registry, It gives me a red line for this code

BIOMES.register("chocolate_forest", ChocolateForest::new);

it tells me that "no instance(s) of type variable(s) exist so that ChocolateForest conforms to Biome inference variable I has incompatible bounds: equality constraints: Biome lower bounds: ChocolateForest"

here's the full code

public class ModBiomes {
    public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, chocolate.MODID);

    public static void init() { BIOMES.register(FMLJavaModLoadingContext.get().getModEventBus()); }

    public static final RegistryObject<Biome> CHOCOLATE_FOREST = BIOMES.register("chocolate_forest", ChocolateForest::new);

}

I have tried to extend Biome to my ChocolateForest class as was shown in an 1.15 tutorial, but I guess something was switched around since then as it tells me that Biome doesn't have a default constructor to take from.

I have also tried looking for something similar and possibly renamed in the code but without any luck.

And heres my ChocolateForest class just in case you need it.

public class ChocolateForest{

    protected ChocolateForest() {
        super();
    }

    protected void configureBiome(Biome.Builder builder) {
        builder.precipitation(Biome.RainType.RAIN).category(Biome.Category.FOREST).depth(-0.1F).temperature(0.6F).downfall(0.9F);

        builder.setEffects((new BiomeAmbience.Builder()).setWaterColor(329011).setWaterFogColor(329011).setFogColor(12638463).withSkyColor(5).withGrassColor(0x85CE71).withFoliageColor(0x63BF66).build());
    }

    protected void configureGeneration(BiomeGenerationSettings.Builder builder) {
        builder.withSurfaceBuilder(ConfiguredSurfaceBuilders.GRASS);

        DefaultBiomeFeatures.withOverworldOres(builder);
        DefaultBiomeFeatures.withCavesAndCanyons(builder);
        DefaultBiomeFeatures.withLavaAndWaterLakes(builder);
        DefaultBiomeFeatures.withMonsterRoom(builder);
    }
    protected void configureMobSpawns(MobSpawnInfo.Builder builder) {
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SHEEP, 12, 4, 4));
        builder.withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(EntityType.PIG, 10, 4, 4));
        builder.withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(EntityType.CHICKEN, 10, 4, 4));
        builder.withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(EntityType.COW, 8, 4, 4));
        builder.withSpawner(EntityClassification.AMBIENT, new MobSpawnInfo.Spawners(EntityType.BAT, 10, 8, 8));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SPIDER, 100, 4, 4));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.ZOMBIE, 95, 4, 4));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.ZOMBIE_VILLAGER, 5, 1, 1));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SKELETON, 100, 4, 4));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.CREEPER, 100, 4, 4));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.SLIME, 100, 4, 4));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.ENDERMAN, 10, 1, 4));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(EntityType.WITCH, 5, 1, 1));
        builder.withSpawner(EntityClassification.MONSTER, new MobSpawnInfo.Spawners(ModEntities.CHOCOLATE_SLIME.get(), 100, 3, 7));
    }
}

I haven't completely finished it as of yet because I've been trying to work out the registry problem.
 

Posted (edited)

Well, your ChocolateForest class is not extending the Biome class, its just a normal class that, for the compiler, has absolutely nothing to do with the Biome class. This is why the compiler is complaining there and not accepting the constructor of your class. On the other hand, it is true that you cannot extends the Biome class anymore, so you have to find a different way to obtain a Biome object to supply to your registry object. I suggest taking a good look here: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/1.16.x/src/main/java/choonster/testmod3/init/ModBiomes.java

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.