Created
March 29, 2016 02:56
-
-
Save kinggoesgaming/40e997fd35268b468758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class ConfigurationUtil { | |
private ConfigurationUtil() {} | |
private static ConfigurationService configurationService = Sponge.getServiceManager().provide(ConfigurationService.class).get(); | |
private static List<Configuration> configurationList = new ArrayList<>(); | |
public static void registerConfigs() { | |
registerConfig("global", new GlobalConfig()); | |
} | |
private static void registerConfig(String id, Configuration config) { | |
configurationService.register(getId(), id, config); | |
configurationList.add(config); | |
} | |
public static void loadAll() { | |
configurationList.forEach((config) -> { | |
try { | |
config.load(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Listener | |
public void onPreInit(GamePreInitializationEvent e) { | |
registerConfigs(); | |
loadAll(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[19:51:00] [Server thread/ERROR] [Sponge]: Could not pass FMLPreInitializationEvent to org.spongepowered.mod.plugin.SpongeModPluginContainer@2574cd42 | |
java.lang.ExceptionInInitializerError | |
at com.kinggoesgaming.foundations.core.FoundationsCore.onPreInitialization(FoundationsCore.java:112) ~[FoundationsCore.class:?] | |
at org.spongepowered.common.event.listener.GamePreInitializationEventListener_FoundationsCore_onPreInitialization4.handle(Unknown Source) ~[?:?] | |
at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:86) ~[RegisteredListener.class:1.8.9-1808-4.1.0-BETA-1227] | |
at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:239) [SpongeModEventManager.class:1.8.9-1808-4.1.0-BETA-1227] | |
at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:283) [SpongeModEventManager.class:1.8.9-1808-4.1.0-BETA-1227] | |
at org.spongepowered.mod.SpongeMod.onStateEvent(SpongeMod.java:183) [SpongeMod.class:1.8.9-1808-4.1.0-BETA-1227] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_74] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_74] | |
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_74] | |
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [minecraft_server.1.8.9.jar:?] | |
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211) [LoadController.class:?] | |
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189) [LoadController.class:?] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_74] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_74] | |
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_74] | |
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [minecraft_server.1.8.9.jar:?] | |
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [minecraft_server.1.8.9.jar:?] | |
at net.minecraftforge.fml.common.LoadController.redirect$onPost$0(LoadController.java:53) [LoadController.class:?] | |
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] | |
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556) [Loader.class:?] | |
at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) [FMLServerHandler.class:?] | |
at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:320) [FMLCommonHandler.class:?] | |
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:112) [ko.class:?] | |
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:441) [MinecraftServer.class:?] | |
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_74] | |
Caused by: java.util.NoSuchElementException: No value present | |
at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_74] | |
at com.kinggoesgaming.foundations.core.util.ConfigurationUtil.<clinit>(ConfigurationUtil.java:21) ~[ConfigurationUtil.class:?] | |
... 34 more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment