Updated LZ4 library

This commit is contained in:
Anuken
2025-12-23 21:28:13 -05:00
parent c425828f4e
commit 3c3b2dd7f1
5 changed files with 8 additions and 8 deletions

View File

@@ -503,7 +503,7 @@ public class Control implements ApplicationListener, Loadable{
}
}
//copy over all buildings from the previous save, retaining config and health, and making them derelict. contents are not saved (derelict repair clears them anyway)
//copy over all buildings from the previous save, retaining config and health, and making them derelict
for(var build : previousBuildings){
Tile tile = world.tile(build.tileX(), build.tileY());
if(tile != null && tile.build == null && Build.validPlace(build.block, state.rules.defaultTeam, build.tileX(), build.tileY(), build.rotation, false, false)){

View File

@@ -1112,7 +1112,6 @@ public class Mods implements Loadable{
/** Loads a mod file+meta, but does not add it to the list.
* Note that directories can be loaded as mods. */
private LoadedMod loadMod(Fi sourceFile, boolean overwrite, boolean initialize) throws Exception{
Time.mark();
ZipFi rootZip = null;
@@ -1232,7 +1231,7 @@ public class Mods implements Loadable{
}
if(!headless && Core.settings.getBool("mod-" + baseName + "-enabled", true)){
Log.info("Loaded mod '@' in @ms", meta.name, Time.elapsed());
Log.info("Loading mod: @", meta.name);
}
return new LoadedMod(sourceFile, zip, mainMod, loader, meta);

View File

@@ -34,7 +34,7 @@ public class ArcNetProvider implements NetProvider{
final CopyOnWriteArrayList<ArcConnection> connections = new CopyOnWriteArrayList<>();
Thread serverThread;
private static final LZ4FastDecompressor decompressor = LZ4Factory.fastestInstance().fastDecompressor();
private static final LZ4SafeDecompressor decompressor = LZ4Factory.fastestInstance().safeDecompressor();
private static final LZ4Compressor compressor = LZ4Factory.fastestInstance().fastCompressor();
private volatile int playerLimitCache, packetSpamLimit;
@@ -439,13 +439,14 @@ public class ArcNetProvider implements NetProvider{
byteBuffer.position(byteBuffer.position() + buffer.position());
}else{
//decompress otherwise
int read = decompressor.decompress(byteBuffer, byteBuffer.position(), buffer, 0, length);
int compressedLength = byteBuffer.limit() - byteBuffer.position();
decompressor.decompress(byteBuffer, byteBuffer.position(), compressedLength, buffer, 0, length);
buffer.position(0);
buffer.limit(length);
packet.read(reads.get(), length);
//move buffer forward based on bytes read by decompressor
byteBuffer.position(byteBuffer.position() + read);
byteBuffer.position(byteBuffer.position() + compressedLength);
}
return packet;

View File

@@ -100,7 +100,7 @@ public class ContentInfoDialog extends BaseDialog{
if(contentClass.isAnonymousClass()) contentClass = contentClass.getSuperclass();
Core.app.openURI("https://mindustrygame.github.io/wiki/Modding%20Classes/" + contentClass.getSimpleName());
}).margin(8f).pad(4f).size(300f, 50f).row();
}).margin(8f).pad(4f).padTop(8f).size(300f, 50f).row();
}
content.displayExtra(table);