Skip to content

Commit 8d35d16

Browse files
committed
4.1.0 Release
1 parent e70f595 commit 8d35d16

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Supported Versions
1111
**Green** = ViaVersion\
1212
**Purple** = ViaBackwards addition
1313

14-
![supported_versions](https://i.imgur.com/MGmk8Yp.png)
14+
![supported_versions](https://i.imgur.com/O2KAFFL.png)
1515

1616
Releases / Dev Builds
1717
-

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55

66
allprojects {
77
group = "com.viaversion"
8-
version = "4.1.0-1.18-pre5-SNAPSHOT"
8+
version = "4.1.0"
99
description = "Allow older clients to join newer server versions."
1010
}
1111

common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
public interface ViaBackwardsPlatform {
5858

59-
String MINIMUM_VV_VERSION = "4.0.1";
59+
String MINIMUM_VV_VERSION = "4.1.0";
6060
String IMPL_VERSION = "$IMPL_VERSION";
6161

6262
/**

common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/BlockItemPackets1_18.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,23 @@ public void registerMap() {
161161
MathUtil.ceilLog2(tracker.biomesSent()));
162162
final Chunk oldChunk = wrapper.read(chunkType);
163163
final ChunkSection[] sections = oldChunk.getSections();
164+
final BitSet mask = new BitSet(oldChunk.getSections().length);
164165
final int[] biomeData = new int[sections.length * ChunkSection.BIOME_SIZE];
165166
int biomeIndex = 0;
166-
for (final ChunkSection section : sections) {
167-
// TODO remove empty sections (always initialized because of biomes in 1.18)?
167+
for (int j = 0; j < sections.length; j++) {
168+
final ChunkSection section = sections[j];
168169
// Write biome palette into biome array
169170
final DataPalette biomePalette = section.palette(PaletteType.BIOMES);
170171
for (int i = 0; i < ChunkSection.BIOME_SIZE; i++) {
171172
biomeData[biomeIndex++] = biomePalette.idAt(i);
172173
}
174+
175+
// Rewrite to empty section
176+
if (section.getNonAirBlocksCount() == 0) {
177+
sections[j] = null;
178+
} else {
179+
mask.set(j);
180+
}
173181
}
174182

175183
final List<CompoundTag> blockEntityTags = new ArrayList<>(oldChunk.blockEntities().size());
@@ -195,8 +203,6 @@ public void registerMap() {
195203
tag.put("id", new StringTag(id));
196204
}
197205

198-
final BitSet mask = new BitSet(oldChunk.getSections().length);
199-
mask.set(0, oldChunk.getSections().length);
200206
final Chunk chunk = new BaseChunk(oldChunk.getX(), oldChunk.getZ(), true, false, mask,
201207
oldChunk.getSections(), biomeData, oldChunk.getHeightMap(), blockEntityTags);
202208
wrapper.write(new Chunk1_17Type(tracker.currentWorldSectionHeight()), chunk);

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ metadata.format.version = "1.1"
33
[versions]
44

55
# ViaVersion
6-
viaver = "4.1.0-1.18-pre2-SNAPSHOT"
6+
viaver = "4.1.0-1.18-pre8-SNAPSHOT"
77

88
# Common provided
99
netty = "4.0.20.Final"

0 commit comments

Comments
 (0)