Skip to content

Commit 755bc35

Browse files
committed
Merge remote-tracking branch 'origin/1.18' into 1.19.2
2 parents 690e1b7 + a7e93ad commit 755bc35

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Some fixes are based on prior work in various Forge PRs (check commit history an
66
is directly derived from Sodium and used under the terms of the LGPL-3.0 license.
77

88
## Development builds (generally stable, but may occasionally have bugs)
9-
- 1.16.5, both modloaders: https://nightly.link/embeddedt/ModernFix/workflows/gradle/main/Package.zip
9+
- 1.16.5, both modloaders: https://nightly.link/embeddedt/ModernFix/workflows/gradle/1.16/Package.zip
1010
- 1.18.2, both modloaders: https://nightly.link/embeddedt/ModernFix/workflows/gradle/1.18/Package.zip
1111
- 1.19.2, both modloaders: https://nightly.link/embeddedt/ModernFix/workflows/gradle/1.19.2/Package.zip
1212
- 1.19.4, both modloaders: https://nightly.link/embeddedt/ModernFix/workflows/gradle/1.19.4/Package.zip

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@ tasks.register('checkCleanTag') {
175175
throw new GradleException('Not a clean tree.')
176176
}
177177
}
178-
}
178+
}

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/faster_texture_loading/TextureAtlasMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void clearLoadedImages(CallbackInfoReturnable<TextureAtlas.Preparations>
106106
}
107107

108108
@Inject(method = "load(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite$Info;IIIII)Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;",
109-
at = @At("HEAD"), cancellable = true)
109+
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/TextureAtlas;getResourceLocation(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/resources/ResourceLocation;"), cancellable = true)
110110
private void loadFromExisting(ResourceManager resourceManager, TextureAtlasSprite.Info spriteInfo, int storageX, int storageY, int mipLevel, int x, int y, CallbackInfoReturnable<TextureAtlasSprite> cir) {
111111
if(!usingFasterLoad)
112112
return;

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
@@ -303,7 +303,7 @@ public UnbakedModel put(ResourceLocation key, UnbakedModel value) {
303303
};
304304
// bake indigo models
305305
Stopwatch watch = Stopwatch.createStarted();
306-
this.topLevelModels.forEach((key, value) -> {
306+
new ArrayList<>(this.topLevelModels.keySet()).forEach(key -> {
307307
try {
308308
this.bake(key, BlockModelRotation.X0_Y0);
309309
} catch(RuntimeException e) {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package org.embeddedt.modernfix.forge.mixin.bugfix.ctm_resourceutil_cme;
2+
3+
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
4+
import org.embeddedt.modernfix.annotation.RequiresMod;
5+
import org.spongepowered.asm.mixin.Final;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.Mutable;
8+
import org.spongepowered.asm.mixin.Shadow;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12+
import team.chisel.ctm.client.util.ResourceUtil;
13+
14+
import java.util.Collections;
15+
import java.util.Map;
16+
import java.util.concurrent.ConcurrentMap;
17+
18+
@Mixin(ResourceUtil.class)
19+
@RequiresMod("ctm")
20+
@ClientOnlyMixin
21+
@SuppressWarnings({"rawtypes", "unchecked"})
22+
public class ResourceUtilMixin {
23+
@Shadow @Final @Mutable
24+
private static Map metadataCache;
25+
26+
/**
27+
* @author embeddedt
28+
* @reason quick fix to prevent rare CMEs
29+
*/
30+
@Inject(method = "<clinit>", at = @At("RETURN"))
31+
private static void synchronizeMetadataCache(CallbackInfo ci) {
32+
if(!(metadataCache instanceof ConcurrentMap))
33+
metadataCache = Collections.synchronizedMap(metadataCache);
34+
}
35+
}

0 commit comments

Comments
 (0)