Skip to content

Commit 92643a2

Browse files
committed
Merge 1.16 into 1.18
2 parents 94d5121 + c3e3dff commit 92643a2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/resources/CachedResourcePath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class CachedResourcePath {
1414

1515
public static final Interner<String> PATH_COMPONENT_INTERNER = Interners.newStrongInterner();
1616
private static final Splitter SLASH_SPLITTER = Splitter.on('/');
17-
private static final String[] NO_PREFIX = new String[0];
17+
public static final String[] NO_PREFIX = new String[0];
1818

1919
public CachedResourcePath(String[] prefix, Path path) {
2020
this(prefix, path, path.getNameCount(), true);

fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
449449

450450
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
451451
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
452-
if(this.inTextureGatheringPass)
452+
if(this.inTextureGatheringPass || !(location instanceof ModelResourceLocation))
453453
return stateDefinition.getPossibleStates();
454454
else
455455
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);

forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ private <T extends Comparable<T>, V extends T> BlockState setPropertyGeneric(Blo
304304
}
305305
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
306306
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
307-
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
307+
if(!(location instanceof ModelResourceLocation))
308+
return stateDefinition.getPossibleStates();
309+
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
308310
}
309311

310312
@Override

0 commit comments

Comments
 (0)