Skip to content

Commit

Permalink
nit: Refactor calculateChunkSize
Browse files Browse the repository at this point in the history
  • Loading branch information
NotStirred authored and CursedFlames committed Jul 12, 2024
1 parent aa9ad16 commit a4097f2
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@ private ByteBuf getWriteBuffer() {
return bytebuf;
}

private static int calculateChunkSize(LevelCube pChunk) {
private static int calculateChunkSize(LevelCube cube) {
int i = 0;
LevelChunkSection[] var2 = pChunk.getSections();
int var3 = var2.length;

for(int var4 = 0; var4 < var3; ++var4) {
LevelChunkSection levelchunksection = var2[var4];
for(LevelChunkSection levelchunksection : cube.getSections()) {
i += levelchunksection.getSerializedSize();
}

return i;
}

public static void extractChunkData(FriendlyByteBuf pBuffer, LevelCube pChunk) {
for (LevelChunkSection levelchunksection : pChunk.getSections()) {
public static void extractChunkData(FriendlyByteBuf pBuffer, LevelCube cube) {
for (LevelChunkSection levelchunksection : cube.getSections()) {
levelchunksection.write(pBuffer);
}
}
Expand Down

0 comments on commit a4097f2

Please sign in to comment.