Merge 1.20 into 1.20.2
This commit is contained in:
commit
d8263c55f8
|
|
@ -0,0 +1,68 @@
|
|||
package org.embeddedt.modernfix.util;
|
||||
|
||||
import com.google.common.collect.ForwardingMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
public abstract class ForwardingInclDefaultsMap<K, V> extends ForwardingMap<K, V> {
|
||||
@Override
|
||||
public V getOrDefault(Object key, V defaultValue) {
|
||||
return delegate().getOrDefault(key, defaultValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEach(BiConsumer<? super K, ? super V> action) {
|
||||
delegate().forEach(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) {
|
||||
delegate().replaceAll(function);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public V putIfAbsent(K key, V value) {
|
||||
return delegate().putIfAbsent(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object key, Object value) {
|
||||
return delegate().remove(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replace(K key, V oldValue, V newValue) {
|
||||
return delegate().replace(key, oldValue, newValue);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public V replace(K key, V value) {
|
||||
return delegate().replace(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V computeIfAbsent(K key, @NotNull Function<? super K, ? extends V> mappingFunction) {
|
||||
return delegate().computeIfAbsent(key, mappingFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V computeIfPresent(K key, @NotNull BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
|
||||
return delegate().computeIfPresent(key, remappingFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V compute(K key, @NotNull BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
|
||||
return delegate().compute(key, remappingFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V merge(K key, @NotNull V value, @NotNull BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
|
||||
return delegate().merge(key, value, remappingFunction);
|
||||
}
|
||||
}
|
||||
|
|
@ -120,5 +120,6 @@
|
|||
"modernfix.option.mixin.perf.compact_mojang_registries": "(Fabric)实验性选项,可将注册表的内存占用减少约 50%。在大多数整合包中没什么用,除非它们包含数百万个方块和物品。",
|
||||
"modernfix.option.mixin.perf.dynamic_block_codecs": "不再给每个方块(状态)都存储一个编解码器,只在需要时动态生成、缓存它。通常不值得启用,除非你有一百万个方块/物品。",
|
||||
"modernfix.option.mixin.perf.faster_command_suggestions": "在输入命令时,若有数十万个建议,可以缓解卡顿。",
|
||||
"modernfix.option.mixin.perf.mojang_registry_size": "修复了一个问题,它会导致方块/物品的注册速度减慢,减慢的程度与已注册的数量成正比。这缩短了启动时间。"
|
||||
"modernfix.option.mixin.perf.mojang_registry_size": "修复了一个问题,它会导致方块/物品的注册速度减慢,减慢的程度与已注册的数量成正比。这缩短了启动时间。",
|
||||
"modernfix.option.mixin.perf.cache_profile_texture_url": "避免毫无意义地创建一个URL对象,加速头颅方块的渲染。"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import net.minecraftforge.forgespi.language.IModInfo;
|
|||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import org.embeddedt.modernfix.ModernFix;
|
||||
import org.embeddedt.modernfix.dynamicresources.ModelLocationCache;
|
||||
import org.embeddedt.modernfix.util.ForwardingInclDefaultsMap;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -69,7 +70,7 @@ public class ModelBakeEventHelper {
|
|||
* @return a wrapper around the model registry
|
||||
*/
|
||||
private Map<ResourceLocation, BakedModel> createWarningRegistry(String modId) {
|
||||
return new ForwardingMap<ResourceLocation, BakedModel>() {
|
||||
return new ForwardingInclDefaultsMap<ResourceLocation, BakedModel>() {
|
||||
@Override
|
||||
protected Map<ResourceLocation, BakedModel> delegate() {
|
||||
return modelRegistry;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user