File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
common/src/main/java/org/embeddedt/modernfix/common/mixin/safety Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .embeddedt .modernfix .common .mixin .safety ;
2+
3+ import net .minecraft .client .renderer .item .ItemProperties ;
4+ import net .minecraft .client .renderer .item .ItemPropertyFunction ;
5+ import net .minecraft .resources .ResourceLocation ;
6+ import net .minecraft .world .item .Item ;
7+ import org .embeddedt .modernfix .annotation .ClientOnlyMixin ;
8+ import org .spongepowered .asm .mixin .Final ;
9+ import org .spongepowered .asm .mixin .Mixin ;
10+ import org .spongepowered .asm .mixin .Mutable ;
11+ import org .spongepowered .asm .mixin .Shadow ;
12+ import org .spongepowered .asm .mixin .injection .At ;
13+ import org .spongepowered .asm .mixin .injection .Inject ;
14+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
15+
16+ import java .util .Map ;
17+ import java .util .concurrent .ConcurrentHashMap ;
18+
19+ @ Mixin (value = ItemProperties .class , priority = 700 )
20+ @ ClientOnlyMixin
21+ public class ItemPropertiesMixin {
22+ @ Shadow @ Final @ Mutable private static Map <ResourceLocation , ItemPropertyFunction > GENERIC_PROPERTIES ;
23+ @ Shadow @ Final @ Mutable private static Map <Item , Map <ResourceLocation , ItemPropertyFunction >> PROPERTIES ;
24+
25+ @ Inject (method = "<clinit>" , at = @ At ("RETURN" ))
26+ private static void useConcurrentMaps (CallbackInfo ci ) {
27+ GENERIC_PROPERTIES = new ConcurrentHashMap <>(GENERIC_PROPERTIES );
28+ PROPERTIES = new ConcurrentHashMap <>(PROPERTIES );
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments