Search in sources :

Example 1 with ConfigurationHelper

use of org.blockartistry.Presets.api.ConfigurationHelper in project DynamicSurroundings by OreCruncher.

the class PresetHandler method presetLoad.

@Optional.Method(modid = "presets")
@SubscribeEvent
public static void presetLoad(@Nonnull final PresetEvent.Load event) {
    final PresetData data = event.getModData(DSurround.MOD_ID);
    if (data != null) {
        final ConfigurationHelper helper = new ConfigurationHelper(data);
        helper.load(DSurround.config(), FILTER);
        DSurround.config().save();
        ConfigProcessor.process(DSurround.config(), ModOptions.class);
        MinecraftForge.EVENT_BUS.post(new ReloadEvent.Configuration());
    }
}
Also used : ReloadEvent(org.blockartistry.DynSurround.event.ReloadEvent) PresetData(org.blockartistry.Presets.api.PresetData) ConfigurationHelper(org.blockartistry.Presets.api.ConfigurationHelper) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with ConfigurationHelper

use of org.blockartistry.Presets.api.ConfigurationHelper in project DynamicSurroundings by OreCruncher.

the class PresetHandler method presetSave.

@Optional.Method(modid = "presets")
@SubscribeEvent
public static void presetSave(@Nonnull final PresetEvent.Save event) {
    final PresetData data = event.getModData(DSurround.MOD_ID);
    final ConfigurationHelper helper = new ConfigurationHelper(data);
    helper.save(DSurround.config(), FILTER);
}
Also used : PresetData(org.blockartistry.Presets.api.PresetData) ConfigurationHelper(org.blockartistry.Presets.api.ConfigurationHelper) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 ConfigurationHelper (org.blockartistry.Presets.api.ConfigurationHelper)2 PresetData (org.blockartistry.Presets.api.PresetData)2 ReloadEvent (org.blockartistry.DynSurround.event.ReloadEvent)1