Skip to content

Commit a1d56e2

Browse files
committed
Merge 1.19.2 into 1.19.4
2 parents aa493c4 + a34ac84 commit a1d56e2

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
@@ -253,6 +253,8 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
253253
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
254254
// the model immediately
255255
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
256+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
257+
result.getMaterials(this::getModel, new HashSet<>());
256258
// We are done with loading, so clear this cache to allow GC of any unneeded models
257259
if(mfix$nestedLoads == 0)
258260
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
@@ -234,6 +234,8 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
234234
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
235235
// the model immediately
236236
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
237+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
238+
result.getMaterials(this::getModel, new HashSet<>());
237239
// We are done with loading, so clear this cache to allow GC of any unneeded models
238240
if(mfix$nestedLoads == 0)
239241
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)