Skip to content

Commit 5bd745a

Browse files
committed
Merge 1.18 into 1.19.2
2 parents 4037124 + 1ac6903 commit 5bd745a

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

.github/workflows/gradle.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33

44
name: Build mod
55

6-
on: [push, pull_request]
6+
on:
7+
push:
8+
branches:
9+
- '**'
10+
tags-ignore:
11+
- '**'
12+
pull_request:
713

814
jobs:
915
build:

common/src/main/java/org/embeddedt/modernfix/dynamicresources/ModelBakeryHelpers.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,21 @@ public static void gatherModelMaterials(ResourceManager manager, Predicate<PackR
104104
}
105105
}
106106
allPackResources.removeIf(pack -> {
107-
if(isTrustedPack.test(pack)) {
108-
for(String namespace : pack.getNamespaces(PackType.CLIENT_RESOURCES)) {
109-
Collection<ResourceLocation> allBlockstates = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "blockstates", p -> p.getPath().endsWith(".json"));
110-
for(ResourceLocation blockstate : allBlockstates) {
111-
allAvailableStates.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("blockstates/", "").replace(".json", "")));
112-
}
113-
Collection<ResourceLocation> allModels = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "models", p -> p.getPath().endsWith(".json"));
114-
for(ResourceLocation blockstate : allModels) {
115-
allAvailableModels.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("models/", "").replace(".json", "")));
116-
}
107+
for(String namespace : pack.getNamespaces(PackType.CLIENT_RESOURCES)) {
108+
Collection<ResourceLocation> allBlockstates = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "blockstates", p -> p.getPath().endsWith(".json"));
109+
for(ResourceLocation blockstate : allBlockstates) {
110+
allAvailableStates.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("blockstates/", "").replace(".json", "")));
117111
}
118-
return true;
112+
Collection<ResourceLocation> allModels = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "models", p -> p.getPath().endsWith(".json"));
113+
for(ResourceLocation blockstate : allModels) {
114+
allAvailableModels.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("models/", "").replace(".json", "")));
115+
}
116+
}
117+
if(!isTrustedPack.test(pack)) {
118+
ModernFix.LOGGER.debug("Pack with class {} needs manual scan", pack.getClass().getName());
119+
return false;
119120
}
120-
ModernFix.LOGGER.debug("Pack with class {} needs manual scan", pack.getClass().getName());
121-
return false;
121+
return true;
122122
});
123123

124124
gatherAdditionalViaManualScan(allPackResources, allAvailableStates, blockStateFiles, "blockstates/");
@@ -206,6 +206,7 @@ public static void gatherModelMaterials(ResourceManager manager, Predicate<PackR
206206
blockStateData = null;
207207
blockStateLoadedFiles.clear();
208208

209+
modelFiles.addAll(allAvailableModels);
209210
/* figure out which models we should actually load */
210211
gatherAdditionalViaManualScan(allPackResources, allAvailableModels, modelFiles, "models/");
211212
modelFiles.retainAll(allAvailableModels);

0 commit comments

Comments
 (0)