Skip to content

Commit 7ab2dac

Browse files
committed
Merge remote-tracking branch 'origin/1.19.4' into 1.20
2 parents 7bbc10a + 702fe0b commit 7ab2dac

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
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
@@ -183,4 +183,4 @@ tasks.register('checkCleanTag') {
183183
throw new GradleException('Not a clean tree.')
184184
}
185185
}
186-
}
186+
}
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)