Jump to content

Recommended Posts

Posted (edited)

Ever since I started this mod in 1.7 I have had an optional world type that enabled me to have my jungle biomes spawn within the boundaries of existing jungles. Although it doesn't really affect the mod to not use the world type many people have expressed the desire to have access to the biomes in conjunction with using mods such as biomes o plenty. Recently, I was directed to the mod Buildcraft (1.12) who have their code on github. The link below takes you to the folder where most of the magic occurs. I reproduced this code with only name changes for making sense of it amongst my own mod. 

BuildCraft

I've fiddled with the noise scale and threshold number to increase the biome size and frequency, but the result was not desirable. I think the problem is that the world type event is called after magnification of the biome map so that each passed in coordinate represents a single chunk on the map, instead of a full biome as it does during my current world type code, partially reproduced here:

Spoiler

    public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i = 0; i < areaHeight; ++i)
        {
            for (int j = 0; j < areaWidth; ++j)
            {
                this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
                int k = aint[j + i * areaWidth];
                int l1 = (k & 3840) >> 8;
                k &= -3841;

                if (this.settings != null && this.settings.fixedBiome >= 0)
                {
                    aint1[j + i * areaWidth] = this.settings.fixedBiome;
                }
                else if (isBiomeOceanic(k))
                {
                    aint1[j + i * areaWidth] = k;
                }
                else if (k == Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND))
                {
                    aint1[j + i * areaWidth] = k;
                }
                else if (k == 1)
                {
                    if (l1 > 0)
                    {
                        if (this.nextInt(3) == 0)
                        {
                            aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MESA_CLEAR_ROCK);
                        }
                        else
                        {
                            aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MESA_ROCK);
                        }
                    }
                    else
                    {
                        aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeManager.BiomeType.DESERT).biome);
                    }
                }
                else if (k == 2)
                {
                    if (l1 > 0)
                    {
                    	int r = this.nextInt(5);
                    	
                    	if(r == 0) {
                    		
                    		aint1[j + i * areaWidth] = Biome.getIdForBiome(JungleBiomeRegistry.biomeJungleMountain);
                    		
                    		} else
                    			if(r == 4) {
                            		aint1[j + i * areaWidth] = Biome.getIdForBiome(JungleBiomeRegistry.biomeJungleSwamp);
                    			} else {
                    				aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.JUNGLE);
                    			}
                    	}
                    else
                    {
                        aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeType.WARM).biome);
                    }
                }
                else if (k == 3)
                {
                    if (l1 > 0)
                    {
                        aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.REDWOOD_TAIGA);
                    }
                    else
                    {
                        aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeType.COOL).biome);
                    }
                }
                else if (k == 4)
                {
                    aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeType.ICY).biome);
                }
                else
                {
                    aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND);
                }
            }
        }

        return aint1;
    }

 

I originally cut out the Buildcraft noise generation check in favour of reproducing the jungle section of the JungleGenLayer I had created. This is where I discovered the issue that the random check is applied for every single X, Z coordinate within a chunk leading to a patchwork of biomes one block in size. 

 

Edit: I also wanted to note that using the Buildcraft code doesn't seem to affect the actual terrain/landscape. My mountain biome will be flat and my swamp biome will be hilly. None of the values from my biome classes appear to get applied.

 

1.14
I'm in the middle of updating from 1.12 to 1.14 and thought I would check back to see what had changed with the above. Although the world type event class still exists the hook for it is no longer in the code, so as of now – even if the above were working – I wouldn't be able to use it.

 

The ideal solution would seem to be a hook that occurs before any zooming. Anyone got any other suggestions?

Edited by salvestrom
Missed information

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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