Skip to content

Commit f247cae

Browse files
committed
Fix block palette mapping for broken full IDs.
1 parent 1acd6a5 commit f247cae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/cn/nukkit/level/GlobalBlockPalette.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ public static int getOrCreateRuntimeId(int id, int meta) {
6262
int legacyId = id << 6 | meta;
6363
int runtimeId = legacyToRuntimeId.get(legacyId);
6464
if (runtimeId == -1) {
65-
//runtimeId = registerMapping(runtimeIdAllocator.incrementAndGet(), legacyId);
66-
throw new NoSuchElementException("Unmapped block registered id:" + id + " meta:" + meta);
65+
runtimeId = legacyToRuntimeId.get(id << 6);
66+
if (runtimeId == -1) {
67+
throw new NoSuchElementException("Unmapped block registered id:" + id + " meta:" + meta);
68+
}
6769
}
6870
return runtimeId;
6971
}

0 commit comments

Comments
 (0)