Merge 1.20 into 1.20.2
This commit is contained in:
commit
7f80f38862
|
|
@ -37,11 +37,11 @@ public abstract class SoundBufferLibraryMixin {
|
|||
if(notification.getCause() == RemovalCause.REPLACED && notification.getValue() == cache.get(notification.getKey()))
|
||||
return;
|
||||
notification.getValue().thenAccept(SoundBuffer::discardAlBuffer);
|
||||
if(debugDynamicSoundLoading) {
|
||||
K k = notification.getKey();
|
||||
if(k == null)
|
||||
return;
|
||||
ModernFix.LOGGER.warn("Evicted sound {}", k);
|
||||
}
|
||||
if(!debugDynamicSoundLoading)
|
||||
return;
|
||||
K k = notification.getKey();
|
||||
if(k == null)
|
||||
return;
|
||||
ModernFix.LOGGER.warn("Evicted sound {}", k);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ public class ModernFixEarlyConfig {
|
|||
|
||||
private static final ImmutableMap<String, Boolean> DEFAULT_SETTING_OVERRIDES = new DefaultSettingMapBuilder()
|
||||
.put("mixin.perf.dynamic_resources", false)
|
||||
.putConditionally(() -> !isFabric, "mixin.perf.async_jei", false)
|
||||
.put("mixin.perf.dynamic_sounds", false)
|
||||
.put("mixin.perf.dynamic_block_codecs", false)
|
||||
.put("mixin.feature.direct_stack_trace", false)
|
||||
|
|
@ -207,7 +208,6 @@ public class ModernFixEarlyConfig {
|
|||
/* Mod compat */
|
||||
disableIfModPresent("mixin.perf.thread_priorities", "smoothboot", "threadtweak");
|
||||
disableIfModPresent("mixin.perf.boost_worker_count", "smoothboot", "threadtweak");
|
||||
disableIfModPresent("mixin.perf.async_jei", "modernui");
|
||||
disableIfModPresent("mixin.perf.compress_biome_container", "chocolate", "betterendforge" ,"skyblockbuilder", "modern_beta");
|
||||
disableIfModPresent("mixin.bugfix.mc218112", "performant");
|
||||
disableIfModPresent("mixin.bugfix.remove_block_chunkloading", "performant");
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ 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;
|
||||
|
|
@ -24,6 +23,7 @@ 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 = Collections.synchronizedMap(new Object2ObjectOpenHashMap<>());
|
||||
this.permanentOverrides = new ConcurrentHashMap<>();
|
||||
if(currentInstance == null)
|
||||
currentInstance = this;
|
||||
}
|
||||
|
|
@ -112,12 +112,12 @@ public class DynamicBakedModelProvider implements Map<ResourceLocation, BakedMod
|
|||
|
||||
@Override
|
||||
public boolean containsKey(Object o) {
|
||||
return permanentOverrides.getOrDefault(o, SENTINEL) != null;
|
||||
return o != null && permanentOverrides.getOrDefault(o, SENTINEL) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsValue(Object o) {
|
||||
return permanentOverrides.containsValue(o) || bakedCache.containsValue(o);
|
||||
return o != null && (permanentOverrides.containsValue(o) || bakedCache.containsValue(o));
|
||||
}
|
||||
|
||||
private static boolean isVanillaTopLevelModel(ResourceLocation location) {
|
||||
|
|
@ -167,6 +167,9 @@ 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;
|
||||
|
|
@ -176,6 +179,9 @@ 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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package org.embeddedt.modernfix.forge.mixin.bugfix.file_dialog_title;
|
||||
|
||||
import net.minecraft.client.gui.screens.worldselection.WorldGenSettingsComponent;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
@Mixin(WorldGenSettingsComponent.class)
|
||||
public class WorldGenSettingsComponentMixin {
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Do not provide resource pack-controlled string to TinyFD
|
||||
*/
|
||||
@ModifyArg(method = "*", at = @At(value = "INVOKE", target = "Lorg/lwjgl/util/tinyfd/TinyFileDialogs;tinyfd_openFileDialog(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Lorg/lwjgl/PointerBuffer;Ljava/lang/CharSequence;Z)Ljava/lang/String;", remap = false), index = 0)
|
||||
private CharSequence sanitizeTitleString(CharSequence original) {
|
||||
return "Select settings file (.json)";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user