Merge 1.20 into 1.20.2

This commit is contained in:
embeddedt 2023-10-25 17:18:46 -04:00
commit fbacc85f86
2 changed files with 4 additions and 11 deletions

View File

@ -157,7 +157,6 @@ public class ModernFixEarlyConfig {
private static final ImmutableMap<String, Boolean> DEFAULT_SETTING_OVERRIDES = new DefaultSettingMapBuilder()
.put("mixin.perf.dynamic_resources", false)
.put("mixin.perf.dynamic_sounds", false)
.put("mixin.perf.dynamic_block_codecs", false)
.put("mixin.feature.direct_stack_trace", false)
.putConditionally(ModernFixPlatformHooks.INSTANCE::isDevEnv, "mixin.perf.rewrite_registry", false)

View File

@ -2,6 +2,7 @@ package org.embeddedt.modernfix.dynamicresources;
import com.google.common.collect.ImmutableSet;
import com.mojang.math.Transformation;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemOverrides;
import net.minecraft.client.renderer.block.model.ItemTransforms;
@ -23,7 +24,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
@ -87,7 +87,7 @@ public class DynamicBakedModelProvider implements Map<ResourceLocation, BakedMod
public DynamicBakedModelProvider(ModelBakery bakery, Map<ModelBakery.BakedCacheKey, BakedModel> cache) {
this.bakery = bakery;
this.bakedCache = cache;
this.permanentOverrides = new ConcurrentHashMap<>();
this.permanentOverrides = Collections.synchronizedMap(new Object2ObjectOpenHashMap<>());
if(currentInstance == null)
currentInstance = this;
}
@ -112,12 +112,12 @@ public class DynamicBakedModelProvider implements Map<ResourceLocation, BakedMod
@Override
public boolean containsKey(Object o) {
return o != null && permanentOverrides.getOrDefault(o, SENTINEL) != null;
return permanentOverrides.getOrDefault(o, SENTINEL) != null;
}
@Override
public boolean containsValue(Object o) {
return o != null && (permanentOverrides.containsValue(o) || bakedCache.containsValue(o));
return permanentOverrides.containsValue(o) || bakedCache.containsValue(o);
}
private static boolean isVanillaTopLevelModel(ResourceLocation location) {
@ -167,9 +167,6 @@ public class DynamicBakedModelProvider implements Map<ResourceLocation, BakedMod
@Override
public BakedModel put(ResourceLocation resourceLocation, BakedModel bakedModel) {
if(resourceLocation == null)
return null;
BakedModel m = permanentOverrides.put(resourceLocation, bakedModel);
if(m != null)
return m;
@ -179,9 +176,6 @@ public class DynamicBakedModelProvider implements Map<ResourceLocation, BakedMod
@Override
public BakedModel remove(Object o) {
if(o == null)
return null;
BakedModel m = permanentOverrides.remove(o);
if(m != null)
return m;