diff --git a/common/build.gradle b/common/build.gradle index 0226ca0f..a1f46228 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,12 +1,11 @@ import org.apache.tools.ant.taskdefs.condition.Os -import org.tukaani.xz.LZMA2Options -import org.tukaani.xz.XZOutputStream +import net.jpountz.lz4.LZ4FrameOutputStream import java.nio.file.Files buildscript { dependencies { - classpath 'org.tukaani:xz:1.10' + classpath 'at.yawk.lz4:lz4-java:1.11.0' } } @@ -185,7 +184,7 @@ tasks.register('copyRustNativesDev', Copy) { } tasks.register('packRustNatives', Tar) { group = 'rust' - archiveFile.set file("${nativesDir}/sable_rapier_binaries.tar.xz") + archiveFile.set file("${nativesDir}/sable_rapier_binaries.tar.l4z") into nativesDir mustRunAfter copyRustNatives, copyRustNativesDev @@ -197,7 +196,7 @@ tasks.register('packRustNatives', Tar) { doLast { byte[] bytes = Files.readAllBytes(getArchiveFile().get().asFile.toPath()) try (var f = new FileOutputStream(getArchiveFile().get().asFile)) { - try (var x = new XZOutputStream(f, new LZMA2Options(LZMA2Options.PRESET_MAX))) { + try (var x = new LZ4FrameOutputStream(f, LZ4FrameOutputStream.BLOCKSIZE.SIZE_4MB, bytes.length, LZ4FrameOutputStream.FLG.Bits.BLOCK_INDEPENDENCE)) { x.write(bytes) } } diff --git a/common/src/main/java/dev/ryanhcode/sable/physics/impl/rapier/Rapier3D.java b/common/src/main/java/dev/ryanhcode/sable/physics/impl/rapier/Rapier3D.java index ceb2cf85..affd9436 100644 --- a/common/src/main/java/dev/ryanhcode/sable/physics/impl/rapier/Rapier3D.java +++ b/common/src/main/java/dev/ryanhcode/sable/physics/impl/rapier/Rapier3D.java @@ -6,6 +6,9 @@ import dev.ryanhcode.sable.api.physics.mass.MassData; import dev.ryanhcode.sable.mixinterface.physics.ServerLevelSceneExtension; import dev.ryanhcode.sable.physics.impl.rapier.collider.RapierVoxelColliderData; +import net.jpountz.lz4.LZ4Factory; +import net.jpountz.lz4.LZ4FrameInputStream; +import net.jpountz.xxhash.XXHashFactory; import net.minecraft.Util; import net.minecraft.Util.OS; import net.minecraft.server.level.ServerLevel; @@ -64,9 +67,9 @@ private static String getNativeName() { private static void loadLibrary() { final String nativeName = getNativeName(); - try (final InputStream is = Rapier3D.class.getResourceAsStream("/natives/" + LIB_NAME + "/sable_rapier_binaries.tar.xz")) { + try (final InputStream is = Rapier3D.class.getResourceAsStream("/natives/" + LIB_NAME + "/sable_rapier_binaries.tar.l4z")) { if (is == null) { - throw new FileNotFoundException("sable_rapier_binaries.tar.xz"); + throw new FileNotFoundException("sable_rapier_binaries.tar.l4z"); } final Path dir = Paths.get(NATIVE_DIR); @@ -74,7 +77,7 @@ private static void loadLibrary() { Files.createDirectories(dir); } - try (final XZInputStream is2 = new XZInputStream(is); + try (final LZ4FrameInputStream is2 = new LZ4FrameInputStream(is); final TarArchiveInputStream ti = new TarArchiveInputStream(is2)) { TarArchiveEntry entry; diff --git a/common/src/main/resources/natives/sable_rapier/sable_rapier_binaries.tar.xz b/common/src/main/resources/natives/sable_rapier/sable_rapier_binaries.tar.xz deleted file mode 100644 index ff89a8bd..00000000 Binary files a/common/src/main/resources/natives/sable_rapier/sable_rapier_binaries.tar.xz and /dev/null differ diff --git a/fabric/build.gradle b/fabric/build.gradle index e6c83ffc..e76e2804 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -29,7 +29,6 @@ dependencies { modCompileOnly("foundry.imguimc:imguimc-fabric-${project.minecraft_version}:${project.imguimc_version}") include(modApi("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${forgeconfigapiport_version}")) //source: https://github.com/Fuzss/forgeconfigapiport-fabric - include(implementation('org.tukaani:xz:1.10')) } loom { diff --git a/neoforge/build.gradle b/neoforge/build.gradle index c7723fac..f87dfbbb 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -72,10 +72,6 @@ dependencies { } } - additionalRuntimeClasspath("org.tukaani:xz:1.10") - jarJar(implementation("org.tukaani:xz:1.10")) - - compileOnly "maven.modrinth:distanthorizons:$rootProject.distant_horizons_version" compileOnly "maven.modrinth:backpacks-for-dummies:$rootProject.backpacks_for_dummies_version"