Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

(SOLVED) Why won't my caves generate?


  • Please log in to reply
9 replies to this topic

#1

Mevans
    Mevans

    Lapis Lazuli Collector

  • Members
  • 1156 posts
  • Location: The Pride Lands

Posted 12 November 2011 - 11:34 AM

So I've made a new dimension, the Egg Dimension, where the stone layer is replaced with Egg Stone (a new kind of stone block) and I am trying to get caves to generate in the egg stone. The top of the world is dirt and caves generate normally in the dirt, but when you get to the stone layer, the caves don't cut through.

Posted Image

I use a cave generator called MapGenCavesEgg in the ChunkProviderEggDimension which is basically everything copied from the MapGenCaves but where it mentioned Block.stone.blockID, I replaced it with mod_EggStone.eggstone.blockID. For some reason, the generator doesn't seem to want to remove any egg stone. I tried changing things so the chunk provider generated a layer of a different block instead of the egg stone (e.g. wood) and changed the Block.stone.blockID to Block.wood.blockID in the cave generator and caves generated fine in the wood. I also tried this with normal stone and it worked.

What is going on?  :(
Help would be greatly appreciated   :)

MapGenCavesEgg.java:
Spoiler:

ChunkProviderEggDimension.java:
Spoiler:

mod_EggStone.java (Contains code for other blocks as well)
Spoiler:

Posted Image

Register or log in to remove.

#2

Volgon8
    Volgon8

    Redstone Miner

  • Members
  • 656 posts
  • Minecraft: Volgon8

Posted 12 November 2011 - 03:59 PM

Looking at the files, it looks like you need to change it all the way back to ChunkProviderGenerate. MapGenBase is called from this and in ChunkProviderGenerate it has some lines with Block.stone.blockID.
If you want to get my attention Quote me(MCforums will send me a message)
Posted Image

#3

riccardoNL
  • Minecraft: riccardoNL

Posted 16 November 2011 - 12:29 AM

They DO generatew, actually. They are only just filled with blocks... You need to add air blocks in the generation code...
Posted Image

#4

Mevans
    Mevans

    Lapis Lazuli Collector

  • Members
  • 1156 posts
  • Location: The Pride Lands

Posted 21 November 2011 - 06:53 PM

View PostriccardoNL, on 16 November 2011 - 12:29 AM, said:

They DO generatew, actually. They are only just filled with blocks... You need to add air blocks in the generation code...
How do I do that?
Posted Image

#5

riccardoNL
  • Minecraft: riccardoNL

Posted 21 November 2011 - 07:15 PM

View PostMevans, on 21 November 2011 - 06:53 PM, said:

How do I do that?

Create 'for' loops like you generated your caves, setting the block '0'.
Posted Image

#6

Mevans
    Mevans

    Lapis Lazuli Collector

  • Members
  • 1156 posts
  • Location: The Pride Lands

Posted 30 November 2011 - 01:45 PM

View PostriccardoNL, on 21 November 2011 - 07:15 PM, said:

Create 'for' loops like you generated your caves, setting the block '0'.
But there already is one:

byte byte0 = abyte0[i4];
if(byte0 == Block.grass.blockID)
{
flag3 = true;
}
if(byte0 == mod_EggStone.eggstone.blockID || byte0 == Block.dirt.blockID || byte0 == Block.grass.blockID)
{
if(j4 < 10)
{
abyte0[i4] = (byte)Block.lavaMoving.blockID;
} else
{
abyte0[i4] = 0;
if(flag3 && abyte0[i4 - 1] == Block.dirt.blockID)
{
abyte0[i4 - 1] = (byte)Block.grass.blockID;
}
}
}
}
i4--;
j4--;
} while(true);
}

Is it something to do with the fact that the eggstone block is declared in a mod_ file rather than the Block file?
Posted Image

#7

riccardoNL
  • Minecraft: riccardoNL

Posted 30 November 2011 - 04:04 PM

View PostMevans, on 30 November 2011 - 01:45 PM, said:

But there already is one:

byte byte0 = abyte0[i4];
if(byte0 == Block.grass.blockID)
{
flag3 = true;
}
if(byte0 == mod_EggStone.eggstone.blockID || byte0 == Block.dirt.blockID || byte0 == Block.grass.blockID)
{
if(j4 < 10)
{
abyte0[i4] = (byte)Block.lavaMoving.blockID;
} else
{
abyte0[i4] = 0;
if(flag3 && abyte0[i4 - 1] == Block.dirt.blockID)
{
abyte0[i4 - 1] = (byte)Block.grass.blockID;
}
}
}
}
i4--;
j4--;
} while(true);
}

Is it something to do with the fact that the eggstone block is declared in a mod_ file rather than the Block file?

No, that can't be it... I think you have to replace mod_EggStone.eggstone.lockID with '0', now it generates stone inside the caves..Not sure at this case...
Posted Image

#8

Kwauhn
    Kwauhn

    Void Walker

  • Members
  • 1559 posts
  • Location: Circumventing cataclysmic celestial anomalies
  • Minecraft: Kwauhn

Posted 30 November 2011 - 05:30 PM

What is the hight limit that eggstone can generate up to? If the generation is sound the generator could just not be understanding the variables properly. If you arent using a program like eclipse simple syntax errors like that could be ignored.

Posted Image

Previously known as GreyZap


#9

Mevans
    Mevans

    Lapis Lazuli Collector

  • Members
  • 1156 posts
  • Location: The Pride Lands

Posted 30 November 2011 - 07:00 PM

View PostGreyZap, on 30 November 2011 - 05:30 PM, said:

What is the hight limit that eggstone can generate up to? If the generation is sound the generator could just not be understanding the variables properly. If you arent using a program like eclipse simple syntax errors like that could be ignored.

There is no height limit, it forms into mountains and things.
The strange thing is that when I changed all the "eggstone" in the caves and chunk provider to other blocks(to try and find out about this problem) the caves worked perfectly. :/
Posted Image

#10

bioxx
    bioxx

    Redstone Miner

  • Members
  • 524 posts

Posted 02 January 2012 - 04:13 AM

Slight necro here but it's good info nonetheless and should help anyone that searches this problem up. After struggling for several hours with this, I finally got a solution. I'll use the example from above.
if(byte0 == mod_EggStone.eggstone.blockID || byte0 == Block.dirt.blockID || byte0 == Block.grass.blockID)
This code is mostly right. However java isn't as smart as other languages such as C# and so you cannot compare an integer with a byte. Block.dirt.blockID is <128 and so it works fine. However do to the way that i guess java handles unsigned bytes, you need to cast mod_EggStone.eggstone.blockID to a byte like this
(byte)mod_EggStone.eggstone.blockID

Once you do that, everything will work flawlessly.
Posted Image