Skip to content

Commit f4f6dbb

Browse files
Merge remote-tracking branch 'origin/1.16.5-forge' into 1.17.1-forge
2 parents df01e75 + 206d9a3 commit f4f6dbb

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
@@ -22,6 +22,8 @@
2222
import java.io.File;
2323
import java.io.IOException;
2424
import java.io.InputStream;
25+
import java.io.*;
26+
import java.nio.charset.StandardCharsets;
2527
import java.util.*;
2628
import java.util.function.Function;
2729
import java.util.function.Predicate;
@@ -256,7 +258,7 @@ && handleRedirect(ident, entry.getKey(), entry.getValue()).canLoad()) {
256258
}
257259

258260
@Override
259-
public Collection<ResourceLocation> getResources(PackType type, String pathIn, String namespace, int maxDepth, Predicate<String> filter) {
261+
public Collection<ResourceLocation> getResources(PackType type, String namespace, String pathIn, int maxDepth, Predicate<String> filter) {
260262
//TODO list all redirect/conditional resources, may need new parameters in API?
261263
List<ResourceLocation> result = new ArrayList<>();
262264
final String folder = pathIn + "/"; // Ensure folders
@@ -359,7 +361,12 @@ public InternalDataPack() {
359361
@Override
360362
public InputStream getResource(String resourcePath) throws IOException {
361363
if("pack.mcmeta".equals(resourcePath)) {
362-
return new ByteArrayInputStream("{}".getBytes());
364+
return new ByteArrayInputStream(("{\n" +
365+
" \"pack\": {\n" +
366+
" \"description\": \"UMC Generated Data\",\n" +
367+
" \"pack_format\": 7\n" +
368+
" }\n" +
369+
"}").getBytes(StandardCharsets.UTF_8));
363370
}
364371

365372
return new ByteArrayInputStream(data.get(nameToLocation(resourcePath).internal));
@@ -371,7 +378,7 @@ public boolean hasResource(String resourcePath) {
371378
}
372379

373380
@Override
374-
public Collection<ResourceLocation> getResources(PackType type, String pathIn, String namespace, int maxDepth, Predicate<String> filter) {
381+
public Collection<ResourceLocation> getResources(PackType type, String namespace, String pathIn, int maxDepth, Predicate<String> filter) {
375382
List<ResourceLocation> result = new ArrayList<>();
376383
final String folder = pathIn + "/"; // Ensure folders
377384
data.keySet().forEach((k) -> {

0 commit comments

Comments
 (0)