Skip to content

Commit 1c21ac9

Browse files
committed
Added support for chunk format version 3458
Disabled SNAPSHOT option as it was redundant
1 parent ed00dac commit 1c21ac9

File tree

6 files changed

+4
-41
lines changed

6 files changed

+4
-41
lines changed

CMakeLists.txt

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ PROJECT(mcmap LANGUAGES CXX VERSION 3.0.1)
55
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
66

77
OPTION(DEBUG_BUILD "Debug build" OFF)
8-
OPTION(SNAPSHOT "Support snapshot versions" OFF)
98

109
IF(STATIC_BUILD)
1110
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
@@ -63,10 +62,6 @@ ELSE()
6362
ADD_COMPILE_OPTIONS(-O3)
6463
ENDIF()
6564

66-
IF(SNAPSHOT)
67-
ADD_DEFINITIONS(-DSNAPSHOT_SUPPORT)
68-
ENDIF()
69-
7065
IF(WIN32)
7166
# 100M stack + 3.5G heap on windows
7267
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:104857600 /HEAP:3758096384")

README.md

-12
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,6 @@ cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DSTATIC_BUILD=1^
222222

223223
You can also download and set up [Ubuntu on windows](https://ubuntu.com/tutorials/tutorial-ubuntu-on-windows#1-overview) then the steps are the same as Linux/Ubuntu.
224224

225-
### Snapshot support
226-
227-
Snapshots are unsupported by default. One can enable support by using the `SNAPSHOT` `CMake` option. In linux/macOS:
228-
```
229-
git clone https://github.com/spoutn1k/mcmap
230-
mkdir -p mcmap/build && cd mcmap/build
231-
cmake .. -DSNAPSHOT=1
232-
make -j
233-
```
234-
235-
On Windows, this will depend on the software you are using to compile `mcmap`.
236-
237225
## Troubleshooting
238226

239227
### Compilation fails

src/chunk.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ namespace mcmap {
88

99
namespace versions {
1010
std::map<int, std::function<bool(const nbt::NBT &)>> assert = {
11-
{3465, assert_versions::v3465}, {2844, assert_versions::v2844},
12-
#ifdef SNAPSHOT_SUPPORT
13-
{2840, assert_versions::v2840},
14-
#endif
11+
{3458, assert_versions::v3458}, {2844, assert_versions::v2844},
1512
{1976, assert_versions::v1976}, {1628, assert_versions::v1628},
1613
{0, assert_versions::catchall},
1714
};

src/chunk_format_versions/assert.cpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace mcmap {
44
namespace versions {
55
namespace assert_versions {
6-
bool v3465(const nbt::NBT &chunk) {
7-
// Snapshot 21w43a
6+
bool v3458(const nbt::NBT &chunk) {
7+
// Minecraft 1.20-pre5, randomly changing things
88
return chunk.contains("sections") // No sections mean no blocks
99
&& chunk.contains("Status") // Ensure the status is `minecraft:full`
1010
&& chunk["Status"].get<nbt::NBT::tag_string_t>() == "minecraft:full";
@@ -17,16 +17,6 @@ bool v2844(const nbt::NBT &chunk) {
1717
&& chunk["Status"].get<nbt::NBT::tag_string_t>() == "full";
1818
}
1919

20-
#ifdef SNAPSHOT_SUPPORT
21-
bool v2840(const nbt::NBT &chunk) {
22-
// Snapshot 21w42a
23-
return chunk.contains("Level") && // Level data is required
24-
chunk["Level"].contains("Sections") // No sections mean no blocks
25-
&& chunk["Level"].contains("Status") // Ensure the status is `full`
26-
&& chunk["Level"]["Status"].get<nbt::NBT::tag_string_t>() == "full";
27-
}
28-
#endif
29-
3020
bool v1976(const nbt::NBT &chunk) {
3121
// From 1.14 onwards
3222
return chunk.contains("Level") // Level data is required

src/chunk_format_versions/assert.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
namespace mcmap {
44
namespace versions {
55
namespace assert_versions {
6-
bool v3465(const nbt::NBT &chunk);
6+
bool v3458(const nbt::NBT &chunk);
77

88
bool v2844(const nbt::NBT &chunk);
99

10-
#ifdef SNAPSHOT_SUPPORT
11-
bool v2840(const nbt::NBT &chunk);
12-
#endif
13-
1410
bool v1976(const nbt::NBT &chunk);
1511

1612
bool v1628(const nbt::NBT &chunk);

src/mcmap.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ std::map<std::string, std::string> compilation_options() {
184184
#endif
185185
#ifdef DEBUG_BUILD
186186
{"Debug", "Enabled"},
187-
#endif
188-
#ifdef SNAPSHOT_SUPPORT
189-
{"Snapshot compatibility", "Enabled"},
190187
#endif
191188
};
192189

0 commit comments

Comments
 (0)