Skip to content

Commit

Permalink
Update to Minecraft 1.17.1, release version 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Johni0702 committed Jul 17, 2021
1 parent 3a52ab5 commit b5ab4de
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 2.0.3
- Update to Minecraft 1.17

### 2.0.2
- Support for Sodium 0.3.0
- Fix nearby fake chunks not loading after server view distance is reduced
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ org.gradle.jvmargs=-Xmx2G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraftVersion=1.17
yarnMappings=1.17+build.9
loaderVersion=0.11.3
minecraftVersion=1.17.1
yarnMappings=1.17.1+build.14
loaderVersion=0.11.6

# Mod Properties
modVersion = 2.0.2
modVersion = 2.0.3
mavenGroup = de.johni0702.minecraft
archivesBaseName = bobby
github.owner = johni0702
Expand Down
19 changes: 17 additions & 2 deletions src/main/java/de/johni0702/minecraft/bobby/FakeChunkStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import net.minecraft.world.chunk.ChunkManager;
import net.minecraft.world.chunk.ChunkNibbleArray;
import net.minecraft.world.chunk.ChunkSection;
import net.minecraft.world.chunk.ColumnChunkNibbleArray;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.world.chunk.light.LightingProvider;
import net.minecraft.world.storage.VersionedChunkStorage;
Expand Down Expand Up @@ -248,7 +247,7 @@ public NbtCompound serialize(Chunk chunk, LightingProvider lightingProvider) {
// If we are missing a section, infer it from the previous full section (the result of that can be re-used)
if (inferredSection == null) {
assert fullSectionAbove != null; // we only clear the cache when we set this
inferredSection = new ChunkNibbleArray((new ColumnChunkNibbleArray(fullSectionAbove, 0)).asByteArray());
inferredSection = floodSkylightFromAbove(fullSectionAbove);
}
skyLight[y] = inferredSection;
}
Expand Down Expand Up @@ -306,4 +305,20 @@ public NbtCompound serialize(Chunk chunk, LightingProvider lightingProvider) {
return chunk;
};
}

private static ChunkNibbleArray floodSkylightFromAbove(ChunkNibbleArray above) {
if (above.isUninitialized()) {
return new ChunkNibbleArray();
} else {
byte[] aboveBytes = above.asByteArray();
byte[] belowBytes = new byte[2048];

// Copy the bottom-most slice from above, 16 time over
for (int i = 0; i < 16; i++) {
System.arraycopy(aboveBytes, 0, belowBytes, i * 128, 128);
}

return new ChunkNibbleArray(belowBytes);
}
}
}
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
],

"depends": {
"fabricloader": ">=0.11.3",
"minecraft": "1.17.x"
"fabricloader": ">=0.11.6",
"minecraft": "~1.17.1"
},
"suggests": {
"cloth-config2": "^${clothConfigVersion}",
Expand Down

0 comments on commit b5ab4de

Please sign in to comment.