Skip to content

Commit 1ac6903

Browse files
committed
Merge 1.16 into 1.18
2 parents fc908bb + 19c6687 commit 1ac6903

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
@@ -105,21 +105,21 @@ public static void gatherModelMaterials(ResourceManager manager, Predicate<PackR
105105
}
106106
}
107107
allPackResources.removeIf(pack -> {
108-
if(isTrustedPack.test(pack)) {
109-
for(String namespace : pack.getNamespaces(PackType.CLIENT_RESOURCES)) {
110-
Collection<ResourceLocation> allBlockstates = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "blockstates", Integer.MAX_VALUE, p -> p.endsWith(".json"));
111-
for(ResourceLocation blockstate : allBlockstates) {
112-
allAvailableStates.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("blockstates/", "").replace(".json", "")));
113-
}
114-
Collection<ResourceLocation> allModels = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "models", Integer.MAX_VALUE, p -> p.endsWith(".json"));
115-
for(ResourceLocation blockstate : allModels) {
116-
allAvailableModels.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("models/", "").replace(".json", "")));
117-
}
108+
for(String namespace : pack.getNamespaces(PackType.CLIENT_RESOURCES)) {
109+
Collection<ResourceLocation> allBlockstates = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "blockstates", Integer.MAX_VALUE, p -> p.endsWith(".json"));
110+
for(ResourceLocation blockstate : allBlockstates) {
111+
allAvailableStates.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("blockstates/", "").replace(".json", "")));
118112
}
119-
return true;
113+
Collection<ResourceLocation> allModels = pack.getResources(PackType.CLIENT_RESOURCES, namespace, "models", Integer.MAX_VALUE, p -> p.endsWith(".json"));
114+
for(ResourceLocation blockstate : allModels) {
115+
allAvailableModels.add(new ResourceLocation(blockstate.getNamespace(), blockstate.getPath().replace("models/", "").replace(".json", "")));
116+
}
117+
}
118+
if(!isTrustedPack.test(pack)) {
119+
ModernFix.LOGGER.debug("Pack with class {} needs manual scan", pack.getClass().getName());
120+
return false;
120121
}
121-
ModernFix.LOGGER.debug("Pack with class {} needs manual scan", pack.getClass().getName());
122-
return false;
122+
return true;
123123
});
124124

125125
gatherAdditionalViaManualScan(allPackResources, allAvailableStates, blockStateFiles, "blockstates/");
@@ -215,6 +215,7 @@ public static void gatherModelMaterials(ResourceManager manager, Predicate<PackR
215215
blockStateData = null;
216216
blockStateLoadedFiles.clear();
217217

218+
modelFiles.addAll(allAvailableModels);
218219
/* figure out which models we should actually load */
219220
gatherAdditionalViaManualScan(allPackResources, allAvailableModels, modelFiles, "models/");
220221
modelFiles.retainAll(allAvailableModels);

0 commit comments

Comments
 (0)