Skip to content

Commit fa2a08e

Browse files
Merge remote-tracking branch 'origin/1.18.2-forge' into 1.19.4-forge
2 parents ec2acfa + 698ccc1 commit fa2a08e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/main/java/cam72cam/mod/resource/BuiltinPack.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import java.io.InputStream;
2828
import java.nio.file.Files;
2929
import java.nio.file.Path;
30+
import java.io.*;
31+
import java.nio.charset.StandardCharsets;
3032
import java.util.*;
3133
import java.util.function.Function;
3234
import java.util.stream.Collectors;
@@ -274,7 +276,7 @@ && handleRedirect(ident, entry.getKey(), entry.getValue()).canLoad()) {
274276
}
275277

276278
@Override
277-
public void listResources(PackType type, String pathIn, String namespace, PackResources.ResourceOutput output) {
279+
public void listResources(PackType type, String namespace, String pathIn, PackResources.ResourceOutput output) {
278280
//TODO list all redirect/conditional resources, may need new parameters in API?
279281
final String folder = pathIn + "/"; // Ensure folders
280282
DIRECT_RESOURCES.forEach((k, v) -> {
@@ -375,7 +377,12 @@ public IoSupplier<InputStream> getResource(PackType type, ResourceLocation loc)
375377

376378
private InputStream getResource(String resourcePath) throws IOException {
377379
if("pack.mcmeta".equals(resourcePath)) {
378-
return new ByteArrayInputStream("{}".getBytes());
380+
return new ByteArrayInputStream(("{\n" +
381+
" \"pack\": {\n" +
382+
" \"description\": \"UMC Generated Data\",\n" +
383+
" \"pack_format\": 12\n" +
384+
" }\n" +
385+
"}").getBytes(StandardCharsets.UTF_8));
379386
}
380387

381388
return new ByteArrayInputStream(data.get(nameToLocation(resourcePath).internal));
@@ -386,7 +393,7 @@ private boolean hasResource(String resourcePath) {
386393
}
387394

388395
@Override
389-
public void listResources(PackType type, String pathIn, String namespace, PackResources.ResourceOutput output) {
396+
public void listResources(PackType type, String namespace, String pathIn, PackResources.ResourceOutput output) {
390397
List<ResourceLocation> result = new ArrayList<>();
391398
final String folder = pathIn + "/"; // Ensure folders
392399
data.keySet().forEach((k) -> {

0 commit comments

Comments
 (0)