Skip to content

Commit

Permalink
Fix: don't reference Vanilla classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gegy committed Jul 16, 2023
1 parent 1c2c00b commit 0300ea5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cpw.mods.forge.serverpacklocator.client;

import com.google.common.hash.HashCode;
import com.mojang.serialization.DataResult;
import cpw.mods.forge.serverpacklocator.FileChecksumValidator;
import cpw.mods.forge.serverpacklocator.LaunchEnvironmentHandler;
import cpw.mods.forge.serverpacklocator.ServerManifest;
import cpw.mods.modlauncher.api.LamdbaExceptionUtils;
import net.minecraft.Util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -66,7 +66,8 @@ protected void downloadManifest(final String serverHost) throws IOException
var connection = url.openConnection();

try (BufferedInputStream in = new BufferedInputStream(connection.getInputStream())) {
this.serverManifest = Util.getOrThrow(ServerManifest.loadFromStream(in), error -> new IllegalStateException("Manifest was malformed: " + error));
DataResult<ServerManifest> result = ServerManifest.loadFromStream(in);
this.serverManifest = result.result().orElseThrow(() -> new IllegalStateException("Manifest was malformed: " + result.error().orElseThrow()));
} catch (IOException e) {
throw new IllegalStateException("Failed to download manifest", e);
}
Expand Down

0 comments on commit 0300ea5

Please sign in to comment.