Merge 1.18 into 1.19.2
This commit is contained in:
commit
6d4071f42c
|
|
@ -162,6 +162,7 @@ public class ModernFixEarlyConfig {
|
|||
.put("mixin.perf.faster_item_rendering", false)
|
||||
.put("mixin.feature.spam_thread_dump", false)
|
||||
.put("mixin.feature.snapshot_easter_egg", true)
|
||||
.put("mixin.feature.warn_missing_perf_mods", true)
|
||||
.put("mixin.feature.spark_profile_launch", false)
|
||||
.put("mixin.devenv", isDevEnv)
|
||||
.put("mixin.perf.remove_spawn_chunks", isDevEnv)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
"key.modernfix.config": "Open config screen",
|
||||
"modernfix.jei_load": "Loading JEI, this may take a while",
|
||||
"modernfix.no_lazydfu": "LazyDFU is not installed. If Minecraft needs to update game data from an older version, there may be noticeable lag.",
|
||||
"modernfix.no_ferritecore": "FerriteCore is not installed. Memory usage will be very high.",
|
||||
"modernfix.perf_mod_warning": "It is recommended to install the mods, but the warning(s) can be disabled in the ModernFix config.",
|
||||
"modernfix.config": "ModernFix mixin config",
|
||||
"modernfix.config.done_restart": "Done (restart required)",
|
||||
"modernfix.option.on": "on",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.embeddedt.modernfix.forge.init;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
|
@ -21,6 +22,7 @@ import net.minecraftforge.registries.ForgeRegistries;
|
|||
import net.minecraftforge.registries.RegisterEvent;
|
||||
import net.minecraftforge.server.ServerLifecycleHooks;
|
||||
import org.embeddedt.modernfix.ModernFix;
|
||||
import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
|
||||
import org.embeddedt.modernfix.forge.classloading.ClassLoadHack;
|
||||
import org.embeddedt.modernfix.forge.classloading.ModFileScanDataDeduplicator;
|
||||
import org.embeddedt.modernfix.forge.ModernFixConfig;
|
||||
|
|
@ -29,6 +31,8 @@ import org.embeddedt.modernfix.forge.config.ConfigFixer;
|
|||
import org.embeddedt.modernfix.forge.packet.PacketHandler;
|
||||
import org.embeddedt.modernfix.forge.registry.ObjectHolderClearer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mod(ModernFix.MODID)
|
||||
public class ModernFixForge {
|
||||
private static ModernFix commonMod;
|
||||
|
|
@ -68,21 +72,25 @@ public class ModernFixForge {
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean dfuModPresent() {
|
||||
if(FMLConfig.isOptimizedDFUDisabled())
|
||||
return true;
|
||||
for(String modId : new String[] { "lazydfu", "datafixerslayer" }) {
|
||||
if(ModList.get().isLoaded(modId))
|
||||
return true;
|
||||
}
|
||||
return !FMLLoader.isProduction();
|
||||
}
|
||||
private static final List<Pair<List<String>, String>> MOD_WARNINGS = ImmutableList.of(
|
||||
Pair.of(ImmutableList.of("lazydfu", "datafixerslayer"), "modernfix.no_lazydfu"),
|
||||
Pair.of(ImmutableList.of("ferritecore"), "modernfix.no_ferritecore")
|
||||
);
|
||||
|
||||
@SubscribeEvent
|
||||
public void commonSetup(FMLCommonSetupEvent event) {
|
||||
if(!dfuModPresent()) {
|
||||
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.warn_missing_perf_mods.Warnings")) {
|
||||
event.enqueueWork(() -> {
|
||||
ModLoader.get().addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), ModLoadingStage.COMMON_SETUP, "modernfix.no_lazydfu"));
|
||||
boolean atLeastOneWarning = false;
|
||||
for(Pair<List<String>, String> warning : MOD_WARNINGS) {
|
||||
boolean isPresent = !FMLLoader.isProduction() || warning.getLeft().stream().anyMatch(name -> ModList.get().isLoaded(name));
|
||||
if(!isPresent) {
|
||||
atLeastOneWarning = true;
|
||||
ModLoader.get().addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), ModLoadingStage.COMMON_SETUP, warning.getRight()));
|
||||
}
|
||||
}
|
||||
if(atLeastOneWarning)
|
||||
ModLoader.get().addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), ModLoadingStage.COMMON_SETUP, "modernfix.perf_mod_warning"));
|
||||
});
|
||||
}
|
||||
ObjectHolderClearer.clearThrowables();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user