You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -145,7 +145,7 @@ public record SerializableChunkData(
@@ -34368,20 +34367,17 @@ index 480623c30777fd230bf8428b16364db09806562b..22a83f312d357176a5489e5b6b71c3ef
34368
34367
return tag;
34369
34368
}
34370
34369
34371
-
@@ -668,6 +775,66 @@ public record SerializableChunkData(
34370
+
@@ -668,6 +775,60 @@ public record SerializableChunkData(
34372
34371
}
34373
34372
}
34374
34373
34375
34374
- public record SectionData(int y, @Nullable LevelChunkSection chunkSection, @Nullable DataLayer blockLight, @Nullable DataLayer skyLight) {
34376
34375
+ // Paper start - starlight - convert from record
34377
34376
+ public static final class SectionData implements ca.spottedleaf.moonrise.patches.starlight.storage.StarlightSectionData { // Paper - starlight - our diff
34378
34377
+ private final int y;
34379
-
+ @javax.annotation.Nullable
34380
-
+ private final net.minecraft.world.level.chunk.LevelChunkSection chunkSection;
34381
-
+ @javax.annotation.Nullable
34382
-
+ private final net.minecraft.world.level.chunk.DataLayer blockLight;
34383
-
+ @javax.annotation.Nullable
34384
-
+ private final net.minecraft.world.level.chunk.DataLayer skyLight;
34378
+
+ private final @Nullable LevelChunkSection chunkSection;
34379
+
+ private final @Nullable DataLayer blockLight;
34380
+
+ private final @Nullable DataLayer skyLight;
34385
34381
+
34386
34382
+ // Paper start - starlight - our diff
34387
34383
+ private int blockLightState = -1;
@@ -34408,30 +34404,27 @@ index 480623c30777fd230bf8428b16364db09806562b..22a83f312d357176a5489e5b6b71c3ef
34408
34404
+ }
34409
34405
+ // Paper end - starlight - our diff
34410
34406
+
34411
-
+ public SectionData(int y, @javax.annotation.Nullable net.minecraft.world.level.chunk.LevelChunkSection chunkSection, @javax.annotation.Nullable net.minecraft.world.level.chunk.DataLayer blockLight, @javax.annotation.Nullable net.minecraft.world.level.chunk.DataLayer skyLight) {
34407
+
+ public SectionData(int y, @Nullable LevelChunkSection chunkSection, @Nullable DataLayer blockLight, @Nullable DataLayer skyLight) {
34412
34408
+ this.y = y;
34413
34409
+ this.chunkSection = chunkSection;
34414
34410
+ this.blockLight = blockLight;
34415
34411
+ this.skyLight = skyLight;
34416
34412
+ }
34417
34413
+
34418
34414
+ public int y() {
34419
-
+ return y;
34415
+
+ return this.y;
34420
34416
+ }
34421
34417
+
34422
-
+ @javax.annotation.Nullable
34423
-
+ public net.minecraft.world.level.chunk.LevelChunkSection chunkSection() {
34424
-
+ return chunkSection;
34418
+
+ public @Nullable LevelChunkSection chunkSection() {
34419
+
+ return this.chunkSection;
34425
34420
+ }
34426
34421
+
34427
-
+ @javax.annotation.Nullable
34428
-
+ public net.minecraft.world.level.chunk.DataLayer blockLight() {
34429
-
+ return blockLight;
34422
+
+ public @Nullable DataLayer blockLight() {
34423
+
+ return this.blockLight;
34430
34424
+ }
34431
34425
+
34432
-
+ @javax.annotation.Nullable
34433
-
+ public net.minecraft.world.level.chunk.DataLayer skyLight() {
public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
179
179
- private final byte[] encodeBuf = new byte[8192];
180
-
+@javax.annotation.Nullable private final byte[] encodeBuf; // Paper - Use Velocity cipher
181
-
+@javax.annotation.Nullable // Paper - Use Velocity cipher
182
-
private final Deflater deflater;
183
-
+@javax.annotation.Nullable private final com.velocitypowered.natives.compression.VelocityCompressor compressor; // Paper - Use Velocity cipher
180
+
- private final Deflater deflater;
181
+
+private final byte @org.jspecify.annotations.Nullable [] encodeBuf; // Paper - Use Velocity cipher
182
+
+ private final @org.jspecify.annotations.Nullable Deflater deflater; // Paper - Use Velocity cipher
183
+
+ private final com.velocitypowered.natives.compression.@org.jspecify.annotations.Nullable VelocityCompressor compressor; // Paper - Use Velocity cipher
184
184
private int threshold;
185
185
186
186
+ // Paper start - Use Velocity cipher
187
187
public CompressionEncoder(final int threshold) {
188
188
+ this(null, threshold);
189
189
+ }
190
-
+ public CompressionEncoder(@javax.annotation.Nullable final com.velocitypowered.natives.compression.VelocityCompressor compressor, final int threshold) {
190
+
+ public CompressionEncoder(final com.velocitypowered.natives.compression.@org.jspecify.annotations.Nullable VelocityCompressor compressor, final int threshold) {
191
191
this.threshold = threshold;
192
192
- this.deflater = new Deflater();
193
193
+ if (compressor == null) {
@@ -207,15 +207,15 @@ index 319325e741cc314b84844bb49ea569aaf014f319..7d8986fe3c96cef829275ddd113bcd8a
207
207
int uncompressedLength = uncompressed.readableBytes();
208
208
if (uncompressedLength > 8388608) {
209
209
throw new IllegalArgumentException("Packet too big (is " + uncompressedLength + ", should be less than 8388608)");
210
-
@@ -25,6 +39,7 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
210
+
@@ -25,6 +38,7 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
211
211
VarInt.write(out, 0);
212
212
out.writeBytes(uncompressed);
213
213
} else {
214
214
+ if (this.deflater != null) { // Paper - Use Velocity cipher
215
215
byte[] input = new byte[uncompressedLength];
216
216
uncompressed.readBytes(input);
217
217
VarInt.write(out, input.length);
218
-
@@ -37,6 +52,17 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
218
+
@@ -37,6 +51,17 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
219
219
}
220
220
221
221
this.deflater.reset();
@@ -233,7 +233,7 @@ index 319325e741cc314b84844bb49ea569aaf014f319..7d8986fe3c96cef829275ddd113bcd8a
233
233
}
234
234
}
235
235
}
236
-
@@ -48,4 +74,31 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
236
+
@@ -48,4 +73,31 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
0 commit comments