diff --git a/include/mcpp/util.h b/include/mcpp/util.h index 8a0b0cb3..640eb716 100644 --- a/include/mcpp/util.h +++ b/include/mcpp/util.h @@ -181,7 +181,7 @@ struct Chunk { }; Iterator begin() { return Iterator(&raw_data[0]); } - Iterator end() { return Iterator(&raw_data[_x_len * _z_len * _z_len]); } + Iterator end() { return Iterator(&raw_data[_x_len * _y_len * _z_len]); } /** * Initialized by copying from a flat vector of blocks diff --git a/test/minecraft_tests.cpp b/test/minecraft_tests.cpp index 7f4b707f..7032c9f7 100644 --- a/test/minecraft_tests.cpp +++ b/test/minecraft_tests.cpp @@ -198,7 +198,7 @@ TEST_CASE("getBlocks and Chunk operations") { for (BlockType block : res) { expected_blocks.push_back(block); } - CHECK_NE(blocks, expected_blocks); + CHECK_EQ(blocks, expected_blocks); } mc.setBlock(test_loc, BlockType(0));