Skip to content

Commit ecf8a69

Browse files
committed
Remove another mappings reference
1 parent 915747d commit ecf8a69

3 files changed

Lines changed: 0 additions & 28 deletions

File tree

src/main/java/io/papermc/codebook/CodeBook.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import dev.denwav.hypo.core.HypoContext;
3333
import io.papermc.codebook.config.CodeBookContext;
3434
import io.papermc.codebook.config.CodeBookJarInput;
35-
import io.papermc.codebook.config.CodeBookResource;
3635
import io.papermc.codebook.exceptions.UnexpectedException;
3736
import io.papermc.codebook.exceptions.UserErrorException;
3837
import io.papermc.codebook.pages.CodeBookPage;
@@ -104,11 +103,6 @@ private static Injector injector(final Module module) {
104103
}
105104

106105
private Module createInitialModule(final Path tempDir) {
107-
final @Nullable CodeBookResource mappings = this.ctx.input().resolveMappings(this.ctx, tempDir);
108-
if (mappings == null) {
109-
throw new IllegalStateException("No mappings file could be determined for the given configuration");
110-
}
111-
112106
final Path inputJar = this.ctx.input().resolveInputFile(tempDir);
113107
final @Nullable List<Path> classpathJars;
114108
if (this.ctx.input() instanceof final CodeBookJarInput input) {

src/main/java/io/papermc/codebook/config/CodeBookInput.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
package io.papermc.codebook.config;
2424

2525
import java.nio.file.Path;
26-
import org.checkerframework.checker.nullness.qual.Nullable;
2726

2827
public sealed interface CodeBookInput permits CodeBookVersionInput, CodeBookJarInput {
2928

@@ -36,9 +35,4 @@ static CodeBookJarInputBuilder ofJar() {
3635
}
3736

3837
Path resolveInputFile(final Path tempDir);
39-
40-
// It's a bit odd for mappings to be here, but the MC version input can specify its own mappings
41-
default @Nullable CodeBookResource resolveMappings(final CodeBookContext ctx, final Path tempDir) {
42-
return null;
43-
}
4438
}

src/main/java/io/papermc/codebook/config/CodeBookVersionInput.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323
package io.papermc.codebook.config;
2424

2525
import io.papermc.codebook.mojangapi.MinecraftManifest;
26-
import io.papermc.codebook.mojangapi.MinecraftVersionDownload;
2726
import io.papermc.codebook.mojangapi.MinecraftVersionManifest;
2827
import io.papermc.codebook.util.Downloader;
2928
import java.nio.file.Path;
30-
import org.checkerframework.checker.nullness.qual.Nullable;
3129

3230
public record CodeBookVersionInput(String mcVersion) implements CodeBookInput {
3331

@@ -44,18 +42,4 @@ public Path resolveInputFile(final Path tempDir) {
4442
Downloader.downloadFile(versionManifest.serverDownload(), targetJar);
4543
return targetJar;
4644
}
47-
48-
@Override
49-
public CodeBookResource resolveMappings(final CodeBookContext ctx, final Path tempDir) {
50-
final @Nullable CodeBookResource mappings = CodeBookInput.super.resolveMappings(ctx, tempDir);
51-
if (mappings != null) {
52-
return mappings;
53-
}
54-
55-
final var manifest = MinecraftManifest.getManifest();
56-
final var versionManifest = MinecraftVersionManifest.getManifestForVersion(manifest, this.mcVersion);
57-
58-
final MinecraftVersionDownload mappingsDownload = versionManifest.serverMappingsDownload();
59-
return new CodeBookUriResource("server_mappings.txt", mappingsDownload.uri(), mappingsDownload.sha1());
60-
}
6145
}

0 commit comments

Comments
 (0)