fixed chunk packing bug

This commit is contained in:
Leijurv 2018-08-28 14:15:20 -07:00
parent 324c3a2705
commit a33b515871
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 5 additions and 2 deletions

View File

@ -121,7 +121,10 @@ public final class CachedChunk implements IBlockTypeAccess {
if (heightMap[internalPos] == y) { if (heightMap[internalPos] == y) {
// we have this exact block, it's a surface block // we have this exact block, it's a surface block
IBlockState state = ChunkPacker.stringToBlock(overview[internalPos]).getDefaultState(); IBlockState state = ChunkPacker.stringToBlock(overview[internalPos]).getDefaultState();
//System.out.println("Saying that " + x + "," + y + "," + z + " is " + state); /*System.out.println("Saying that " + x + "," + y + "," + z + " is " + state);
if (!Minecraft.getMinecraft().world.getBlockState(new BlockPos(x + this.x * 16, y, z + this.z * 16)).getBlock().equals(state.getBlock())) {
throw new IllegalStateException("failed " + Minecraft.getMinecraft().world.getBlockState(new BlockPos(x + this.x * 16, y, z + this.z * 16)).getBlock() + " " + state.getBlock() + " " + (x + this.x * 16) + " " + y + " " + (z + this.z * 16));
}*/
return state; return state;
} }
PathingBlockType type = getType(x, y, z); PathingBlockType type = getType(x, y, z);

View File

@ -71,7 +71,7 @@ public final class ChunkPacker implements Helper {
for (int x = 0; x < 16; x++) { for (int x = 0; x < 16; x++) {
for (int y = 255; y >= 0; y--) { for (int y = 255; y >= 0; y--) {
int index = CachedChunk.getPositionIndex(x, y, z); int index = CachedChunk.getPositionIndex(x, y, z);
if (!bitSet.get(index) && !bitSet.get(index + 1)) { if (bitSet.get(index) || bitSet.get(index + 1)) {
String name = blockToString(chunk.getBlockState(x, y, z).getBlock()); String name = blockToString(chunk.getBlockState(x, y, z).getBlock());
blockNames[z << 4 | x] = name; blockNames[z << 4 | x] = name;
continue outerLoop; continue outerLoop;