Skip to content

Commit

Permalink
4.1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Nov 29, 2021
1 parent e70f595 commit 8d35d16
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Supported Versions
**Green** = ViaVersion\
**Purple** = ViaBackwards addition

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

Releases / Dev Builds
-
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

allprojects {
group = "com.viaversion"
version = "4.1.0-1.18-pre5-SNAPSHOT"
version = "4.1.0"
description = "Allow older clients to join newer server versions."
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

public interface ViaBackwardsPlatform {

String MINIMUM_VV_VERSION = "4.0.1";
String MINIMUM_VV_VERSION = "4.1.0";
String IMPL_VERSION = "$IMPL_VERSION";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,23 @@ public void registerMap() {
MathUtil.ceilLog2(tracker.biomesSent()));
final Chunk oldChunk = wrapper.read(chunkType);
final ChunkSection[] sections = oldChunk.getSections();
final BitSet mask = new BitSet(oldChunk.getSections().length);
final int[] biomeData = new int[sections.length * ChunkSection.BIOME_SIZE];
int biomeIndex = 0;
for (final ChunkSection section : sections) {
// TODO remove empty sections (always initialized because of biomes in 1.18)?
for (int j = 0; j < sections.length; j++) {
final ChunkSection section = sections[j];
// Write biome palette into biome array
final DataPalette biomePalette = section.palette(PaletteType.BIOMES);
for (int i = 0; i < ChunkSection.BIOME_SIZE; i++) {
biomeData[biomeIndex++] = biomePalette.idAt(i);
}

// Rewrite to empty section
if (section.getNonAirBlocksCount() == 0) {
sections[j] = null;
} else {
mask.set(j);
}
}

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

final BitSet mask = new BitSet(oldChunk.getSections().length);
mask.set(0, oldChunk.getSections().length);
final Chunk chunk = new BaseChunk(oldChunk.getX(), oldChunk.getZ(), true, false, mask,
oldChunk.getSections(), biomeData, oldChunk.getHeightMap(), blockEntityTags);
wrapper.write(new Chunk1_17Type(tracker.currentWorldSectionHeight()), chunk);
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions]

# ViaVersion
viaver = "4.1.0-1.18-pre2-SNAPSHOT"
viaver = "4.1.0-1.18-pre8-SNAPSHOT"

# Common provided
netty = "4.0.20.Final"
Expand Down

0 comments on commit 8d35d16

Please sign in to comment.