Hey,
today I recognized, that there is something wrong (an update) in the API. The TaskBuilder was moved to:
org.spongepowered.api.service.scheduler.Task;
So I changed my code to:
SchedulerService scheduler = game.getScheduler(); Task.Builder taskBuilder = scheduler.createTaskBuilder(); taskBuilder.execute(new Runnable() {
So why I am posting my code? I am not sure, if there is something wrong with it, or the implementation is not upt to date yet. My Spongeforge server runns with sponge-1.8-1521-2.1DEV-726.jar
and throws following error:
[20:23:48] [Server thread/ERROR] [Sponge]: [Plugin Class: me.Hitzk0pf.CaveCore.Main][Handler: onServerStart]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at org.spongepowered.mod.plugin.SpongeModPluginContainer.handleModStateEvent(SpongeModPluginContainer.java:127) [SpongeModPluginContainer.class:1.8-1521-2.1DEV-726+spongeproject-ci-b726.git-bd07085cf983e5024b395e249c647f6465c1295c]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [minecraft_server.1.8.jar:?]
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) [LoadController.class:?]
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) [LoadController.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [minecraft_server.1.8.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [minecraft_server.1.8.jar:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.serverStarted(Loader.java:794) [Loader.class:?]
at net.minecraftforge.fml.common.FMLCommonHandler.handleServerStarted(FMLCommonHandler.java:324) [FMLCommonHandler.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:440) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
Caused by: java.lang.NoSuchMethodError: org.spongepowered.api.service.scheduler.SchedulerService.createTaskBuilder()Lorg/spongepowered/api/service/scheduler/Task$Builder;
at me.Hitzk0pf.CaveCore.Main.onServerStart(Main.java:159) ~[Main.class:?]
... 30 more
So when I am right, the implementation lacks an update …
Can you guys say me, when the update will be done, or if I did something wrong in my code?
Greets