Charset Storage - Barrels

Charset Storage - Barrels

429k Downloads

[1.9.4] Attempting to get saves root directory too early

gabizou opened this issue ยท 0 comments

commented

From the following:

[22:27:35] [Server thread/ERROR] [FML]: Caught exception from CharsetAudio
java.util.NoSuchElementException: No value present
    at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_77]
    at net.minecraftforge.common.DimensionManager.getCurrentSaveRootDirectory(DimensionManager.java:277) ~[DimensionManager.class:?]
    at pl.asie.charset.audio.storage.DataStorageManager.<init>(DataStorageManager.java:32) ~[DataStorageManager.class:?]
    at pl.asie.charset.audio.ModCharsetAudio.serverStart(ModCharsetAudio.java:172) ~[ModCharsetAudio.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:566) ~[forge-1.9.4-12.17.0.1954-universal.jar:?]
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.9.4.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206) ~[LoadController.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.9.4.jar:?]
    at net.minecraftforge.fml.common.LoadController.onPost(LoadController.java:53) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) [LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.serverAboutToStart(Loader.java:888) [Loader.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.handleServerAboutToStart(FMLCommonHandler.java:279) [FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:261) [lb.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
[22:27:35] [Server thread/ERROR] [FML]: A fatal exception occurred during the server about to start event
java.util.NoSuchElementException: No value present
    at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_77]
    at net.minecraftforge.common.DimensionManager.getCurrentSaveRootDirectory(DimensionManager.java:277) ~[DimensionManager.class:?]
    at pl.asie.charset.audio.storage.DataStorageManager.<init>(DataStorageManager.java:32) ~[DataStorageManager.class:?]
    at pl.asie.charset.audio.ModCharsetAudio.serverStart(ModCharsetAudio.java:172) ~[ModCharsetAudio.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:566) ~[forge-1.9.4-12.17.0.1954-universal.jar:?]
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.9.4.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:228) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:206) ~[LoadController.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.9.4.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.9.4.jar:?]
    at net.minecraftforge.fml.common.LoadController.onPost(LoadController.java:53) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.serverAboutToStart(Loader.java:888) [Loader.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.handleServerAboutToStart(FMLCommonHandler.java:279) [FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:261) [lb.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]

Granted, Sponge is doing something slightly different, but, Forge as well is returning a null at this point in time, so, checking for whatever it is during server about to start is just a bad idea. We're patching SpongeForge to return null as it seems that the mod already checks for nulls (and doesn't throw an NPE), but it's noticeable that this is likely a hidden silent bug.