Skip to content

Commit ab7c982

Browse files
committed
Merge 1.18 into 1.19.2
2 parents 594c47f + 92643a2 commit ab7c982

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
@@ -447,7 +447,7 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
447447

448448
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
449449
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
450-
if(this.inTextureGatheringPass)
450+
if(this.inTextureGatheringPass || !(location instanceof ModelResourceLocation))
451451
return stateDefinition.getPossibleStates();
452452
else
453453
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
@@ -312,7 +312,9 @@ private <T extends Comparable<T>, V extends T> BlockState setPropertyGeneric(Blo
312312
}
313313
@Redirect(method = "loadModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/StateDefinition;getPossibleStates()Lcom/google/common/collect/ImmutableList;"))
314314
private ImmutableList<BlockState> loadOnlyRelevantBlockState(StateDefinition<Block, BlockState> stateDefinition, ResourceLocation location) {
315-
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
315+
if(!(location instanceof ModelResourceLocation))
316+
return stateDefinition.getPossibleStates();
317+
return ModelBakeryHelpers.getBlockStatesForMRL(stateDefinition, (ModelResourceLocation)location);
316318
}
317319

318320
@Override

0 commit comments

Comments
 (0)