Skip to content

Commit a34ac84

Browse files
committed
Merge 1.18 into 1.19.2
2 parents 637f844 + e248e29 commit a34ac84

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
406406
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
407407
// the model immediately
408408
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
409+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
410+
result.getMaterials(this::getModel, new HashSet<>());
409411
// We are done with loading, so clear this cache to allow GC of any unneeded models
410412
if(mfix$nestedLoads == 0)
411413
smallLoadingCache.clear();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
294294
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
295295
// the model immediately
296296
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
297+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
298+
result.getMaterials(this::getModel, new HashSet<>());
297299
// We are done with loading, so clear this cache to allow GC of any unneeded models
298300
if(mfix$nestedLoads == 0)
299301
smallLoadingCache.clear();

scripts/autorelease.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ do_release() {
3737
git tag -a $tag_name -m "$tag_name"
3838
git push --tags
3939
gh release create $tag_name --target $1 --title "$tag_name" --notes ""
40+
# now delete local tag to prevent messing up the detected tag for the next version
41+
git tag -d $tag_name &>/dev/null
4042
}
4143

4244
for version in "${all_versions[@]}"; do

0 commit comments

Comments
 (0)