Skip to content

Commit

Permalink
Refresh Notfine options on world load (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-OOG-ah authored Dec 1, 2024
1 parent b69eca6 commit e293f12
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/java/jss/notfine/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package jss.notfine.proxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import jss.notfine.config.NotFineConfig;
import jss.notfine.core.Settings;
import jss.notfine.core.SettingsManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.WorldEvent;

public class ClientProxy extends CommonProxy {

@Override
public void preInit(FMLPreInitializationEvent event) {
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);

if(!NotFineConfig.allowAdvancedOpenGL) {
Minecraft.getMinecraft().gameSettings.advancedOpengl = false;
}
Expand All @@ -29,12 +33,13 @@ public void preInit(FMLPreInitializationEvent event) {
}
}

@Override
public void init(FMLInitializationEvent event) { }

@Override
public void postInit(FMLPostInitializationEvent event) {
SettingsManager.settingsFile.loadSettings();
}

@SubscribeEvent
public void worldLoad(WorldEvent.Load event) {
SettingsManager.graphicsUpdated();
}
}

0 comments on commit e293f12

Please sign in to comment.