Hey everyone,
I am trying to access my core plugin within another plugin using the following code:
PluginManager pluginManager = getGame().getPluginManager();
Optional<PluginContainer> corePlugin = pluginManager.getPlugin("CludchCore");
if(corePlugin.isPresent()) {
coreInstance = (Core) corePlugin.get().getInstance();
} else {
getLogger().error("Could not load the core");
}
But the line coreInstance = ..
says "cannot cast java.lang.util.Optional<java.lang.Object> to me.cludch.core.main.Core
Hopefully you can help me.
Thanks in advance.