par1 being X, par2 being Y, radius being either 2048 for blocks or 256 for chunk.
I succeeded to make everything disappear beyond this limit, but there is still a nagging bedrock and mineshaft, so I am not sure where exactly to put it. I would like to have only one placed modified, but if it needs more, then it's fine.
If you wonder why I want to do this, here is the Mod Request I made while back.
Also, since doing will change an existing class, how can I make it so I only modify one method of the class?
Thanks a lot for your help!
EDIT: SOLVED
Thank you Mazetar, as with your help I was able to see my flaws in programming
ChunkProvideGenerate, method: provideChunk
if(Math.sqrt(Math.pow(par1,2) + Math.pow(par2,2))>=64)
{
Chunk chunk = new Chunk(this.worldObj, par1, par2);
return chunk;
}
//Remaining as normal
Look at the world Chunk manager?
If the chunk it wants to create is to far away from the center chunk, then just don't generate it?
Look at the ChunkProvider, the generate terrain and provide chunk methods should be the place to start looking
Hi, thank you Mazetar for your answer!
So here is what I have at the moment and however I try to put it, I can't find out how to make it work. This is in the ChunkProviderGenerate class:
public Chunk provideChunk(int par1, int par2)
{
if(Math.sqrt(par1-8) + Math.sqrt(par2-8) > Math.sqrt(32))
{
EmptyChunk chunk = new EmptyChunk(this.worldObj, par1, par2);
return chunk;
}
//I only added the if statement at the beginning, here how the method ends:
Chunk chunk = new Chunk(this.worldObj, abyte, par1, par2);
byte[] abyte1 = chunk.getBiomeArray();
for (int k = 0; k < abyte1.length; ++k)
{
abyte1[k] = (byte)this.biomesForGeneration[k].biomeID;
}
chunk.generateSkylightMap();
return chunk;
}
32 is a small chunk radius so to see if this works. Unfortunately it does not, as I am trying to generate a with an EmptyChunk what should be generated with a chunk, so the program quits unexpectedly.
Are you familiar with programming fundamentals mate?
If so, then why not show the crash log so we can see what's causing it to crash?
That being said, I'd guess that your EmptyChunk class is improperly implemented and therefore causes the crash due to a NPE (Null Pointer Exception) or some other error
Do you really need a custom chunk class though?
Can't you return a regular chunk which contains no blocks?
In fact, I am not a java programmer and I am not used with event handling, like, at all. I am more of a PHP programmer but I think I can "get it".
The EmptyChunk class is existing in the program at net.minecraft.world.chunk but it seems like I should not use another object than from a Chunk class. When I use a Chunk class though, it does not crash, but it does not make any change.
The thing is, I am just unaware on how to return a regular Chunk with no blocks.
In fact, I am not a java programmer and I am not used with event handling, like, at all. I am more of a PHP programmer but I think I can "get it".
Haha I'm struggling to wrap my head around PHP at this very moment!
Java is an OOP language, PHP is somewhat Object Oriented, but not fully so there are probably a lot of concepts unkown to you such as polymorphism and all that yadayada
If you want a proper jump into java (recommended) take a look at this awesome series of lectures (with all assignments and their own eclipse version, just like the real class had!): http://see.stanford.edu/see/lecturelist.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111 It's ofc free
Being used to PHP you are already leagues ahead of most guys around here
Now back to your issue.
The thing is, I am just unaware on how to return a regular Chunk with no blocks.
Look into the Chunk class, especially the methods involving the setting and getting of blocks.
(Go into the world.SetBlock(x.y,z. blockID) method and see how it leads into chunk and what it does )
I'm pretty confident that if you spend a little time on it you will learn a lot and figure it out.
If you don't then respond here and I'll help you more directly
Good luck and have fun exploring
PS:
Heres a GREAT blog about how minecraft works internally, you may have use of reading the Block post as well as many of the others.
A very nice reference for understanding and remembering how minecraft's codebase is built up. (It's not complete, new posts are added as the author learns more himself)
What's great about programming languages is that they follow the same general principles and they are - let's admit it - more static than we see them, as opposed to living languages. I'm currently learning the chinese language and boy she's demanding.
Thank you very much for your I will look at the Standford courses as well as your tutorial, but for the moment I'd like to see magic happen before my eyes
I will look through the different classes and let you (y'all?) know about what I discovered, or discovered not.
Everyone will soon know that the Minecraft worlds are not only flat but disc shaped! And possibly later with moons and diamond asteroids ^^
The main thing people don't get about programming, is that the language is almost irrelevant.
(Yes yes language specific quirks, minor details in the long run! but now I've mention it so sshss )
Programming is about logic, it's about software design. Planning and designing logic to solve a problem.
Regardless of language, the logic is the same for what you want to accomplish and how you want it done.
When that's decided it's just a matter of implementing it, and that's mere details compared to planning and designing the system
Anyways the reason I post back is that I see the link never got added to the post.
Here's the link for the mentioned blog posts, I recommend that you look at it now already and just see what the Block post is about. I'm sure you will quickly see if it's of interest or not http://greyminecraftcoder.blogspot.no/p/list-of-topics.html
I haven't read Pratchett's version of the myth, I just like the myth itself
In fact it just makes for a smaller sandbox to play in and a more or less compacted area if somebody uses it for multiplayers.
I may - and this is only may in the cloudiest and farthest of ways cause I don't believe in other dimensions - make a dimension for the turtle's back with elephants and stuff. But I am not sure of the use for it.
I am doing this mod as a go-together with a Town mod I will be making when I can wrap my head around random generation. But not yet.
Agreed with programming languages. Choice of one over an other is less about capacity than about preference and public accessibility. How about spoken languages on your side? My first tongue is French.
Cool! thanks for the link, I thought you meant the one in your signature, I'm going through it and it seems interesting. Give you (y'all?) more news on that matter when I have the time to learn and try
I am erecting a temple for you Mazetar! I just figured it out! What is explored by the way?
With your websites and insight, I finally figured out the chunk issue, but it made weird quadratic-like emptiness in the positive quadrant.
So I realized my stupidest error. The formula was wrong all along.
ChunkProvideGenerate, method: provideChunk
if(Math.sqrt(Math.pow(par1,2) + Math.pow(par2,2))>=64)
{
Chunk chunk = new Chunk(this.worldObj, par1, par2);
return chunk;
}
//Remaining as normal
I guess I will be able to add moons and asteroids in a similar way. Cool. And I don't know why but this chunk is apparently empty. I won't try to understand lol.
This is a pizza-map of the result.
So the two details about the generations that can be harassing are small and in fact interesting.
The edge is chunky, squarey and stops right at whatever the biome was trying to make. I guess it's a style.
Also, mineshaft are sometimes fluffing out of caves and go haywire in the unknown. Let's keep it that way I think.
I guess my last question on that subject is this:
Where should I put this bit so I don't modify the class' file but only the whole method in a separate file?
Thanks a lot for your help Mazetar
Small notice, your present level in the forum is void walker...
I am trying to make a mod stopping world generation about the size of one greatest map, in the form of a disc.
I have the impression that this should be easy, but I don't know where to put
par1 being X, par2 being Y, radius being either 2048 for blocks or 256 for chunk.
I succeeded to make everything disappear beyond this limit, but there is still a nagging bedrock and mineshaft, so I am not sure where exactly to put it. I would like to have only one placed modified, but if it needs more, then it's fine.
If you wonder why I want to do this, here is the Mod Request I made while back.
Also, since doing will change an existing class, how can I make it so I only modify one method of the class?
Thanks a lot for your help!
EDIT: SOLVED
Thank you Mazetar, as with your help I was able to see my flaws in programming
ChunkProvideGenerate, method: provideChunk
If the chunk it wants to create is to far away from the center chunk, then just don't generate it?
Look at the ChunkProvider, the generate terrain and provide chunk methods should be the place to start looking
Hi, thank you Mazetar for your answer!
So here is what I have at the moment and however I try to put it, I can't find out how to make it work. This is in the ChunkProviderGenerate class:
32 is a small chunk radius so to see if this works. Unfortunately it does not, as I am trying to generate a with an EmptyChunk what should be generated with a chunk, so the program quits unexpectedly.
Do you have an idea of what I should do?
Are you familiar with programming fundamentals mate?
If so, then why not show the crash log so we can see what's causing it to crash?
That being said, I'd guess that your EmptyChunk class is improperly implemented and therefore causes the crash due to a NPE (Null Pointer Exception) or some other error
Do you really need a custom chunk class though?
Can't you return a regular chunk which contains no blocks?
The EmptyChunk class is existing in the program at net.minecraft.world.chunk but it seems like I should not use another object than from a Chunk class. When I use a Chunk class though, it does not crash, but it does not make any change.
The thing is, I am just unaware on how to return a regular Chunk with no blocks.
Haha I'm struggling to wrap my head around PHP at this very moment!
Java is an OOP language, PHP is somewhat Object Oriented, but not fully so there are probably a lot of concepts unkown to you such as polymorphism and all that yadayada
If you want a proper jump into java (recommended) take a look at this awesome series of lectures (with all assignments and their own eclipse version, just like the real class had!): http://see.stanford.edu/see/lecturelist.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111 It's ofc free
Being used to PHP you are already leagues ahead of most guys around here
Now back to your issue.
Look into the Chunk class, especially the methods involving the setting and getting of blocks.
(Go into the world.SetBlock(x.y,z. blockID) method and see how it leads into chunk and what it does )
I'm pretty confident that if you spend a little time on it you will learn a lot and figure it out.
If you don't then respond here and I'll help you more directly
Good luck and have fun exploring
PS:
Heres a GREAT blog about how minecraft works internally, you may have use of reading the Block post as well as many of the others.
A very nice reference for understanding and remembering how minecraft's codebase is built up. (It's not complete, new posts are added as the author learns more himself)
Thank you very much for your I will look at the Standford courses as well as your tutorial, but for the moment I'd like to see magic happen before my eyes
I will look through the different classes and let you (y'all?) know about what I discovered, or discovered not.
Everyone will soon know that the Minecraft worlds are not only flat but disc shaped! And possibly later with moons and diamond asteroids ^^
The main thing people don't get about programming, is that the language is almost irrelevant.
(Yes yes language specific quirks, minor details in the long run! but now I've mention it so sshss )
Programming is about logic, it's about software design. Planning and designing logic to solve a problem.
Regardless of language, the logic is the same for what you want to accomplish and how you want it done.
When that's decided it's just a matter of implementing it, and that's mere details compared to planning and designing the system
Anyways the reason I post back is that I see the link never got added to the post.
Here's the link for the mentioned blog posts, I recommend that you look at it now already and just see what the Block post is about. I'm sure you will quickly see if it's of interest or not
http://greyminecraftcoder.blogspot.no/p/list-of-topics.html
In fact it just makes for a smaller sandbox to play in and a more or less compacted area if somebody uses it for multiplayers.
I may - and this is only may in the cloudiest and farthest of ways cause I don't believe in other dimensions - make a dimension for the turtle's back with elephants and stuff. But I am not sure of the use for it.
I am doing this mod as a go-together with a Town mod I will be making when I can wrap my head around random generation. But not yet.
Agreed with programming languages. Choice of one over an other is less about capacity than about preference and public accessibility. How about spoken languages on your side? My first tongue is French.
Cool! thanks for the link, I thought you meant the one in your signature, I'm going through it and it seems interesting. Give you (y'all?) more news on that matter when I have the time to learn and try
With your websites and insight, I finally figured out the chunk issue, but it made weird quadratic-like emptiness in the positive quadrant.
So I realized my stupidest error. The formula was wrong all along.
ChunkProvideGenerate, method: provideChunk
I guess I will be able to add moons and asteroids in a similar way. Cool. And I don't know why but this chunk is apparently empty. I won't try to understand lol.
This is a pizza-map of the result.
So the two details about the generations that can be harassing are small and in fact interesting.
The edge is chunky, squarey and stops right at whatever the biome was trying to make. I guess it's a style.
Also, mineshaft are sometimes fluffing out of caves and go haywire in the unknown. Let's keep it that way I think.
I guess my last question on that subject is this:
Where should I put this bit so I don't modify the class' file but only the whole method in a separate file?
Thanks a lot for your help Mazetar
Small notice, your present level in the forum is void walker...