Merge 1.19.2 into 1.19.4

This commit is contained in:
embeddedt 2023-06-26 21:26:27 -04:00
commit 84b08ef64a
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
4 changed files with 3 additions and 11 deletions

View File

@ -76,10 +76,6 @@ public class ModernFix {
ClassInfoManager.clear();
}
public void onLoadComplete() {
ClassInfoManager.clear();
}
public void onServerDead(MinecraftServer server) {
/* Clear as much data from the integrated server as possible, in case a mod holds on to it */
try {

View File

@ -19,6 +19,7 @@ import org.embeddedt.modernfix.platform.ModernFixPlatformHooks;
import org.embeddedt.modernfix.searchtree.JEIBackedSearchTree;
import org.embeddedt.modernfix.searchtree.REIBackedSearchTree;
import org.embeddedt.modernfix.searchtree.SearchTreeProviderRegistry;
import org.embeddedt.modernfix.util.ClassInfoManager;
import org.embeddedt.modernfix.world.IntegratedWatchdog;
import java.lang.management.ManagementFactory;
@ -72,6 +73,7 @@ public class ModernFixClient {
gameStartTimeSeconds = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start");
ModernFixPlatformHooks.onLaunchComplete();
ClassInfoManager.clear();
}
}

View File

@ -7,7 +7,7 @@ import net.minecraft.server.MinecraftServer;
import java.lang.ref.WeakReference;
public class ModernFixFabric implements ModInitializer {
private ModernFix commonMod;
public static ModernFix commonMod;
public static WeakReference<MinecraftServer> theServer = new WeakReference<>(null);
@Override
public void onInitialize() {

View File

@ -13,7 +13,6 @@ import net.minecraftforge.fml.*;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLConfig;
import net.minecraftforge.fml.loading.FMLLoader;
@ -39,7 +38,6 @@ public class ModernFixForge {
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onLoadComplete);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::registerItems);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> MinecraftForge.EVENT_BUS.register(new ModernFixClientForge()));
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (a, b) -> true));
@ -94,10 +92,6 @@ public class ModernFixForge {
commonMod.onServerDead(event.getServer());
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onLoadComplete(FMLLoadCompleteEvent event) {
commonMod.onLoadComplete();
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onServerStarted(ServerStartedEvent event) {
commonMod.onServerStarted();
}