Jump to content

Recommended Posts

Posted

Im trying to make caves generate in my dimension but no matter what they wont work. I have assigned every block to my blocks so i dont understand why it isn not generating!

 

AC_MapGenCaves

 

package net.minecraft.src;

import java.util.Random;

public class AC_MapGenCaves extends MapGenBase
{
    /**
     * Generates a larger initial cave node than usual. Called 25% of the time.
     */
    protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10)
    {
        this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
    }

    /**
     * Generates a node in the current cave system recursion tree.
     */
    protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
    {
        double var19 = (double)(par3 * 16 + ;
        double var21 = (double)(par4 * 16 + ;
        float var23 = 0.0F;
        float var24 = 0.0F;
        Random var25 = new Random(par1);

        if (par16 <= 0)
        {
            int var26 = this.range * 16 - 16;
            par16 = var26 - var25.nextInt(var26 / 4);
        }

        boolean var54 = false;

        if (par15 == -1)
        {
            par15 = par16 / 2;
            var54 = true;
        }

        int var27 = var25.nextInt(par16 / 2) + par16 / 4;

        for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15)
        {
            double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F);
            double var31 = var29 * par17;
            float var33 = MathHelper.cos(par14);
            float var34 = MathHelper.sin(par14);
            par6 += (double)(MathHelper.cos(par13) * var33);
            par8 += (double)var34;
            par10 += (double)(MathHelper.sin(par13) * var33);

            if (var28)
            {
                par14 *= 0.92F;
            }
            else
            {
                par14 *= 0.7F;
            }

            par14 += var24 * 0.1F;
            par13 += var23 * 0.1F;
            var24 *= 0.9F;
            var23 *= 0.75F;
            var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F;
            var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F;

            if (!var54 && par15 == var27 && par12 > 1.0F && par16 > 0)
            {
                this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D);
                this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D);
                return;
            }

            if (var54 || var25.nextInt(4) != 0)
            {
                double var35 = par6 - var19;
                double var37 = par10 - var21;
                double var39 = (double)(par16 - par15);
                double var41 = (double)(par12 + 2.0F + 16.0F);

                if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41)
                {
                    return;
                }

                if (par6 >= var19 - 16.0D - var29 * 2.0D && par10 >= var21 - 16.0D - var29 * 2.0D && par6 <= var19 + 16.0D + var29 * 2.0D && par10 <= var21 + 16.0D + var29 * 2.0D)
                {
                    int var55 = MathHelper.floor_double(par6 - var29) - par3 * 16 - 1;
                    int var36 = MathHelper.floor_double(par6 + var29) - par3 * 16 + 1;
                    int var57 = MathHelper.floor_double(par8 - var31) - 1;
                    int var38 = MathHelper.floor_double(par8 + var31) + 1;
                    int var56 = MathHelper.floor_double(par10 - var29) - par4 * 16 - 1;
                    int var40 = MathHelper.floor_double(par10 + var29) - par4 * 16 + 1;

                    if (var55 < 0)
                    {
                        var55 = 0;
                    }

                    if (var36 > 16)
                    {
                        var36 = 16;
                    }

                    if (var57 < 1)
                    {
                        var57 = 1;
                    }

                    if (var38 > 120)
                    {
                        var38 = 120;
                    }

                    if (var56 < 0)
                    {
                        var56 = 0;
                    }

                    if (var40 > 16)
                    {
                        var40 = 16;
                    }

                    boolean var58 = false;
                    int var42;
                    int var45;

                    for (var42 = var55; !var58 && var42 < var36; ++var42)
                    {
                        for (int var43 = var56; !var58 && var43 < var40; ++var43)
                        {
                            for (int var44 = var38 + 1; !var58 && var44 >= var57 - 1; --var44)
                            {
                                var45 = (var42 * 16 + var43) * 128 + var44;

                                if (var44 >= 0 && var44 < 128)
                                {
                                    if (par5ArrayOfByte[var45] == Block.ice.blockID || par5ArrayOfByte[var45] == Block.ice.blockID)
                                    {
                                        var58 = true;
                                    }

                                    if (var44 != var57 - 1 && var42 != var55 && var42 != var36 - 1 && var43 != var56 && var43 != var40 - 1)
                                    {
                                        var44 = var57;
                                    }
                                }
                            }
                        }
                    }

                    if (!var58)
                    {
                        for (var42 = var55; var42 < var36; ++var42)
                        {
                            double var59 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29;

                            for (var45 = var56; var45 < var40; ++var45)
                            {
                                double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29;
                                int var48 = (var42 * 16 + var45) * 128 + var38;
                                boolean var49 = false;

                                if (var59 * var59 + var46 * var46 < 1.0D)
                                {
                                    for (int var50 = var38 - 1; var50 >= var57; --var50)
                                    {
                                        double var51 = ((double)var50 + 0.5D - par8) / var31;

                                        if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D)
                                        {
                                            byte var53 = par5ArrayOfByte[var48];

                                            if (var53 == mod_ArcticCraft.FrostedGrass.blockID)
                                            {
                                                var49 = true;
                                            }

                                            if (var53 == mod_ArcticCraft.FrostStone.blockID || var53 == mod_ArcticCraft.FrostedDirt.blockID || var53 == mod_ArcticCraft.FrostedGrass.blockID)
                                            {
                                                if (var50 < 10)
                                                {
                                                    par5ArrayOfByte[var48] = (byte)Block.waterMoving.blockID;
                                                }
                                                else
                                                {
                                                    par5ArrayOfByte[var48] = 0;

                                                    if (var49 && par5ArrayOfByte[var48 - 1] == mod_ArcticCraft.FrostedDirt.blockID)
                                                    {
                                                        par5ArrayOfByte[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + par3 * 16, var45 + par4 * 16).topBlock;
                                                    }
                                                }
                                            }
                                        }

                                        --var48;
                                    }
                                }
                            }
                        }

                        if (var54)
                        {
                            break;
                        }
                    }
                }
            }
        }
    }

    /**
     * Recursively called by generate() (generate) and optionally by itself.
     */
    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
    {
        int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);

        if (this.rand.nextInt(15) != 0)
        {
            var7 = 0;
        }

        for (int var8 = 0; var8 < var7; ++var8)
        {
            double var9 = (double)(par2 * 16 + this.rand.nextInt(16));
            double var11 = (double)this.rand.nextInt(this.rand.nextInt(120) + ;
            double var13 = (double)(par3 * 16 + this.rand.nextInt(16));
            int var15 = 1;

            if (this.rand.nextInt(4) == 0)
            {
                this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13);
                var15 += this.rand.nextInt(4);
            }

            for (int var16 = 0; var16 < var15; ++var16)
            {
                float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F;
                float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
                float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();

                if (this.rand.nextInt(10) == 0)
                {
                    var19 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F;
                }

                this.generateCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D);
            }
        }
    }
}

 

 

Code in ChunkProvider:

 


private MapGenBase caveGenerator = new AC_MapGenCaves();

public Chunk provideChunk(int par1, int par2)
{

byte abyte0[] = new byte[32768];
this.caveGenerator.generate(this, this.worldObj, par1, par2, abyte0);

}

 

 

Help please! :D

Posted

If you create your byte array "byte abyte0[] = new byte[32768];", it's all zero, which is interpreted as all empty (block 0 = air). The cave generator only creates holes in existing structures, it only sets fields to air. If everything is air already, you won't see anything, of course.

Posted

If you create your byte array "byte abyte0[] = new byte[32768];", it's all zero, which is interpreted as all empty (block 0 = air). The cave generator only creates holes in existing structures, it only sets fields to air. If everything is air already, you won't see anything, of course.

 

So, what do I do? I mean why did this code work for the overworld? I have nearly the same generating as the overworld

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 am playing a modpack with the web displays mod and I tried it out and when I logged back into my world i decided to get rid of the display i placed to move it and it started playing the video from last session and crashed my game, when i tried to start the game again it said it could not start becasue it could not delete a debug file that has the link in it that is no longer being displayed but is trying to, here is the debug folder.   [0201/091808.660:WARNING:chrome_browser_cloud_management_controller.cc(88)] Could not create policy manager as CBCM is not enabled. [0201/091930.426:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factors'.", source:  (0) [0201/091932.869:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.290:INFO:CONSOLE(5047)] "LegacyDataMixin will be applied to all legacy elements. Set `_legacyUndefinedCheck: true` on element class to enable.", source:  [0201/091933.529:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.529:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.530:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.530:WARNING:browser_info.cc(309)] Returning a speculative frame for 25769803781 [6,5] [0201/091933.557:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factors'.", source:  (0) [0201/091934.376:WARNING:obfuscated_file_util.cc(1410)] Failed to get origin+type directory: { uri: filesystem:https://www.youtube.com/temporary/, storage key: { origin: https://www.youtube.com, top-level site: https://youtube.com, nonce: <null>, ancestor chain bit: Same-Site }, bucket id: 1 } error:-4 [0201/091935.216:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factors'.", source:  (0) [0201/091935.241:INFO:CONSOLE(7990)] "Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.", source: https://www.youtube.com/s/desktop/3df27587/jsbin/desktop_polymer.vflset/desktop_polymer.js (7990) [0201/091936.766:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091936.767:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091936.767:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091936.767:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091937.243:INFO:CONSOLE(5047)] "LegacyDataMixin will be applied to all legacy elements. Set `_legacyUndefinedCheck: true` on element class to enable.", source: https://www.youtube.com/s/desktop/3df27587/jsbin/desktop_polymer.vflset/desktop_polymer.js (5047) [0201/091938.283:INFO:CONSOLE(7990)] "Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.", source: https://www.youtube.com/s/desktop/3df27587/jsbin/desktop_polymer.vflset/desktop_polymer.js (7990) [0201/091939.496:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705669 [9,5] [0201/091953.165:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091953.165:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091953.166:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091953.166:WARNING:browser_info.cc(309)] Returning a speculative frame for 38654705676 [9,12] [0201/091959.119:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/091959.119:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/091959.119:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092014.122:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092014.122:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092014.122:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092019.126:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092019.126:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092019.126:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092024.512:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092024.512:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092024.512:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092029.812:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092029.812:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092029.812:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092036.154:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092036.165:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092036.165:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092041.464:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092041.464:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092041.464:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092051.842:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092051.843:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092051.843:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092055.373:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092055.373:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0) [0201/092055.373:INFO:CONSOLE(0)] "The resource https://rr5---sn-o097znsr.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=gaRSMacERUQ (0)
    • If you are searching for mods, I would not search here, this is more of a support forum for using/creating mods with minecraft Forge. Try https://www.curseforge.com/minecraft if you are looking for mods/modpacks to use.
    • I was trying to find a mod that added something specific, and was unable to find it with what limited memory I had of seeing it. I don't know why there isn't an option to include words in overviews of mods. I could see it being in the sort tab near filters on the app in my opinion. It might help someone trying to find something specific, only based off something from the overview tab, but idk
    • Please read the FAQ and post logs as described there.   Also, do not just add a post onto someone else's thread with your issue, create a new one please.
  • Topics

×
×
  • Create New...

Important Information

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