ComunidadAylas / PackSquash

📦 Minecraft: Java Edition resource and data pack optimizer which aims to achieve the best possible compression, performance and protection, improving pack distribution, storage and in-game load times.
https://packsquash.aylas.org
GNU Affero General Public License v3.0
597 stars 25 forks source link

Fatal if Java 22 #294

Open mihannnik opened 5 months ago

mihannnik commented 5 months ago

Distribution

Linux x64 APT package

Bug description

After the release of the Minecraft 1.20.5 update, I decided to check out the new features. Since this version started to require JAVA 21 and higher, I installed JAVA 22 from www.oracle.com. Later, when I launched Minecraft 1.20.1 I encountered a problem: server resourcepack is not applied. The error in the logs is as follows:

Failed to open pack C:\Program Files (x86)\MultiMC\instances\1.20.1 fabric Nvidium\.minecraft\server-resource-packs\c61ba9417f15b6c6b920677edc4322e25ce7548d
java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra len size)
    at java.util.zip.ZipFile$Source.zerror(ZipFile.java:1827) ~[?:?]
    at java.util.zip.ZipFile$Source.checkAndAddEntry(ZipFile.java:1239) ~[?:?]
    at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1766) ~[?:?]
    at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1761) ~[?:?]
    at java.util.zip.ZipFile$Source.<init>(ZipFile.java:1541) ~[?:?]
    at java.util.zip.ZipFile$Source.get(ZipFile.java:1504) ~[?:?]
    at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:251) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:180) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:194) ~[?:?]
    at net.minecraft.class_3258.method_14399(class_3258.java:44) ~[client-intermediary.jar:?]
    at net.minecraft.class_3258.method_14391(class_3258.java:72) ~[client-intermediary.jar:?]
    at net.minecraft.class_3258.method_14410(class_3258.java:62) ~[client-intermediary.jar:?]
    at net.minecraft.class_3255.method_14407(class_3255.java:30) ~[client-intermediary.jar:?]
    at net.minecraft.class_3288.method_45274(class_3288.java:71) ~[client-intermediary.jar:?]
    at net.minecraft.class_1066.method_4638(class_1066.java:216) ~[client-intermediary.jar:?]
    at net.minecraft.class_1066.method_4634(class_1066.java:114) ~[client-intermediary.jar:?]
    at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
    at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1570) ~[?:?]
[18:44:34] [Downloader 0/WARN]: Missing metadata in pack server
[18:44:35] [IO-Worker-15/WARN]: Pack application failed: java.lang.IllegalArgumentException: Invalid pack metadata at C:\Program Files (x86)\MultiMC\instances\1.20.1 fabric Nvidium\.minecraft\server-resource-packs\c61ba9417f15b6c6b920677edc4322e25ce7548d, deleting file C:\Program Files (x86)\MultiMC\instances\1.20.1 fabric Nvidium\.minecraft\server-resource-packs\c61ba9417f15b6c6b920677edc4322e25ce7548d

Since this is a modified Sodium client, tried the vanilla Minecraft 1.20.1 client and the error persisted:

[18:48:19] [Downloader 0/ERROR]: Failed to open pack C:\Program Files (x86)\MultiMC\instances\1.20.1\.minecraft\server-resource-packs\c61ba9417f15b6c6b920677edc4322e25ce7548d
java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra len size)
    at java.util.zip.ZipFile$Source.zerror(ZipFile.java:1827) ~[?:?]
    at java.util.zip.ZipFile$Source.checkAndAddEntry(ZipFile.java:1239) ~[?:?]
    at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1766) ~[?:?]
    at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1761) ~[?:?]
    at java.util.zip.ZipFile$Source.<init>(ZipFile.java:1541) ~[?:?]
    at java.util.zip.ZipFile$Source.get(ZipFile.java:1504) ~[?:?]
    at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:251) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:180) ~[?:?]
    at java.util.zip.ZipFile.<init>(ZipFile.java:194) ~[?:?]
    at ajk.c(SourceFile:44) ~[minecraft-1.20.1-client.jar:?]
    at ajk.a(SourceFile:72) ~[minecraft-1.20.1-client.jar:?]
    at ajk.a(SourceFile:62) ~[minecraft-1.20.1-client.jar:?]
    at ajh.a(SourceFile:30) ~[minecraft-1.20.1-client.jar:?]
    at akg.a(SourceFile:71) ~[minecraft-1.20.1-client.jar:?]
    at fvn.a(SourceFile:216) ~[minecraft-1.20.1-client.jar:?]
    at fvn.a(SourceFile:114) ~[minecraft-1.20.1-client.jar:?]
    at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
    at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1570) ~[?:?]
[18:48:19] [Downloader 0/WARN]: Missing metadata in pack server
[18:48:19] [IO-Worker-12/WARN]: Pack application failed: java.lang.IllegalArgumentException: Invalid pack metadata at C:\Program Files (x86)\MultiMC\instances\1.20.1\.minecraft\server-resource-packs\c61ba9417f15b6c6b920677edc4322e25ce7548d, deleting file C:\Program Files (x86)\MultiMC\instances\1.20.1\.minecraft\server-resource-packs\c61ba9417f15b6c6b920677edc4322e25ce7548d

After that, compression with PackSquash has been disabled on the server and the resourcepack will load normally. Then I rolled back the JAVA version to 20 and tried again: everything works fine. I also checked on JAVA 21 - also everything works fine.

Reproduction steps

  1. Install JAVA 22 on client PC
  2. Run Minecraft with installed JAVA 22
  3. Copy resourcepack to resourcepacks folder
  4. Open Options - Resource Packs...
  5. You will not see your resourcepack in the list and will receive an error message in the game logs

OR

  1. Install JAVA 22 on client PC
  2. Run Minecraft with installed JAVA 22
  3. Connect to server with PackSquash compressed resourcepack
  4. You will see error message on screen and will receive an error message in the game logs image

Expected behavior

As on earlier versions of JAVA, everything should work fine

Attached files

Resourcepack: gpt_dev.zip compress.toml:

pack_directory='{INPUT_FOLDER}'
output_file_path='{OUTPUT_ZIP}'

allow_mods = ['OptiFine']

recompress_compressed_files = true
zip_compression_iterations = 30
zip_spec_conformance_level = 'disregard'

['**/*?.png']
image_data_compression_iterations = 15

Additional context

No response

AlexTMjugador commented 5 months ago

Thank you for the detailed bug report! I'm already aware of this issue and will address it as soon as I can allocate some time and mental energy to it. Unfortunately, I can't provide an ETA for the fix at the moment.

SergioK29 commented 1 month ago

Same issue here