Skip to content

Commit 95a433d

Browse files
committed
Remove unused code
1 parent 19798b2 commit 95a433d

File tree

6 files changed

+445
-283
lines changed

6 files changed

+445
-283
lines changed

core/src/main/java/org/geysermc/geyser/level/chunk/GeyserChunk.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@
2626
package org.geysermc.geyser.level.chunk;
2727

2828
import org.geysermc.mcprotocollib.protocol.data.game.chunk.DataPalette;
29+
import org.geysermc.mcprotocollib.protocol.data.game.level.LightUpdateData;
30+
import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityInfo;
2931

3032
/**
31-
* Acts as a lightweight chunk class that doesn't store biomes, heightmaps or block entities.
33+
* Acts as a lightweight chunk class that doesn't store biomes.
3234
*/
33-
public record GeyserChunk(DataPalette[] sections) {
35+
public record GeyserChunk(DataPalette[] sections, BlockEntityInfo[][] blockEntities, LightUpdateData lightData) {
3436

35-
public static GeyserChunk from(DataPalette[] sections) {
36-
return new GeyserChunk(sections);
37+
public static GeyserChunk from(DataPalette[] sections, BlockEntityInfo[][] blockEntities, LightUpdateData lightData) {
38+
return new GeyserChunk(sections, blockEntities, lightData);
3739
}
3840
}

core/src/main/java/org/geysermc/geyser/network/CodecProcessor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
import org.cloudburstmc.protocol.bedrock.packet.SetEntityMotionPacket;
8282
import org.cloudburstmc.protocol.bedrock.packet.SettingsCommandPacket;
8383
import org.cloudburstmc.protocol.bedrock.packet.SimpleEventPacket;
84-
import org.cloudburstmc.protocol.bedrock.packet.SubChunkRequestPacket;
8584
import org.cloudburstmc.protocol.bedrock.packet.SubClientLoginPacket;
8685
import org.cloudburstmc.protocol.common.util.VarInts;
8786

@@ -265,7 +264,6 @@ static BedrockCodec processCodec(BedrockCodec codec) {
265264
// Illegal unusued serverbound packets that relate to unused features
266265
.updateSerializer(ClientCacheBlobStatusPacket.class, ILLEGAL_SERIALIZER)
267266
.updateSerializer(SubClientLoginPacket.class, ILLEGAL_SERIALIZER)
268-
.updateSerializer(SubChunkRequestPacket.class, ILLEGAL_SERIALIZER)
269267
.updateSerializer(GameTestRequestPacket.class, ILLEGAL_SERIALIZER)
270268
// Ignored serverbound packets
271269
.updateSerializer(ClientToServerHandshakePacket.class, IGNORED_SERIALIZER)

core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import org.geysermc.geyser.session.GeyserSession;
3636
import org.geysermc.geyser.util.MathUtils;
3737
import org.geysermc.mcprotocollib.protocol.data.game.chunk.DataPalette;
38+
import org.geysermc.mcprotocollib.protocol.data.game.level.LightUpdateData;
39+
import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityInfo;
3840

3941
public class ChunkCache {
4042
private final boolean cache;
@@ -50,20 +52,20 @@ public ChunkCache(GeyserSession session) {
5052
chunks = cache ? new Long2ObjectOpenHashMap<>() : null;
5153
}
5254

53-
public void addToCache(int x, int z, DataPalette[] chunks) {
55+
public void addToCache(int x, int z, DataPalette[] chunks, BlockEntityInfo[][] blockEntities, LightUpdateData lightData) {
5456
if (!cache) {
5557
return;
5658
}
5759

5860
long chunkPosition = MathUtils.chunkPositionToLong(x, z);
59-
GeyserChunk geyserChunk = GeyserChunk.from(chunks);
61+
GeyserChunk geyserChunk = GeyserChunk.from(chunks, blockEntities, lightData);
6062
this.chunks.put(chunkPosition, geyserChunk);
6163
}
6264

6365
/**
6466
* Doesn't check for cache enabled, so don't use this without checking that first!
6567
*/
66-
private GeyserChunk getChunk(int chunkX, int chunkZ) {
68+
public GeyserChunk getChunk(int chunkX, int chunkZ) {
6769
long chunkPosition = MathUtils.chunkPositionToLong(chunkX, chunkZ);
6870
return chunks.getOrDefault(chunkPosition, null);
6971
}

0 commit comments

Comments
 (0)