Well is that the top of that chunk?
Draw the bounds of the chunks. So that you can visualize better.
Well is that the top of that chunk?
Draw the bounds of the chunks. So that you can visualize better.
cant my ShapedRenderer overrides my textures for some reason =P
this does not work with the system i want how would i fix like corner blocks and shit then?
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 8; x++) {
if(chunk.chunkBlockList[x][y] != null){
if (chunk.chunkBlockList[x][y + 1] != null) {
//has block on top
chunk.chunkBlockList[x][y].setType(BlockType.DIRT);
} else {
//is top block
chunk.chunkBlockList[x][y].setType(BlockType.GRASS_TOP);
}
}
}
}
this is all that does
https://gyazo.com/b01db316c8a4256f401e519494a73325
There’s an obvious pattern there. You can do it.
i have been trying for hours now please come with a clue or something
please help me with this problem?
Maybe you should redesign this part of your program, as it is clear you don’t understand your current design.
Judging by the code snippets here, you probably have large chunks of code that do too many different things all mixed together in the same places.
Identify the individual problems to be solved and factor them out as functions and/or datatypes, then compose them together to form the overall solution. This style is easier to understand, test, and reuse in other parts of the program.
It is known as url=https://en.wikipedia.org/wiki/Decomposition_(computer_science) Decomposition[/url], a theme that permeates engineering in general, and in the context of computer science is the mark of a good programmer. Practice this pattern of thought and you’ll do well.
I’ll give you a hint. That’s only part of the problem.
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 8; x++) {
well they cant both be 8 if i do [x][y + 1]
You’re looking at it the wrong way.
???
Sigh… try this:
This will solve the problems in the image you showed. But there is another that you probably haven’t noticed yet.
for (int y = 0; y < 8; y++) {
for (int x = 0; x < 8; x++) {
if(chunk.chunkBlockList[x][y] != null){
if (y == 7 || chunk.chunkBlockList[x][y + 1] != null) {
//has block on top
chunk.chunkBlockList[x][y].setType(BlockType.DIRT);
} else {
//is top block
chunk.chunkBlockList[x][y].setType(BlockType.GRASS_TOP);
}
}
}
}
what would that be most off all blocks are as they are suppose to be now i need to be able to check chunk blocks above current chunk