Solved Cannot schedule bukkittask

Discussion in 'Plugin Development' started by LegoPal92, Aug 7, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    LegoPal92

    I am trying to schedule a BukkitTask to run, and it is not working. The error is:
    PHP:
    java.lang.NoSuchMethodErrororg.bukkit.scheduler.BukkitScheduler.runTask(Lorg/bukkit/plugin/Plugin;Lorg/bukkit/scheduler/BukkitRunnable;)Lorg/bukkit/scheduler/BukkitTask;
        
    at info.civiliancraft.ChromaSurvivalIsland.Utils.SQLUtil.createMainIslandTable(SQLUtil.java:67) ~[?:?]
        
    at info.civiliancraft.ChromaSurvivalIsland.Main.onEnable(Main.java:100) ~[?:?]
        
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316)
        
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:324)
        
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405)
        
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugin(CraftServer.java:465)
        
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.enablePlugins(CraftServer.java:383)
        
    at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:136)
        
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:457)
        
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628)
    Line 67 is:
    PHP:
            Main.main.getServer().getScheduler().runTask(Main.main, new SQL_Update(island_table));
    island_table is a String variable, just creating the sql table, trust me, it works.

    SQL_Update is a private class here it is:
    PHP:
    private static class SQL_Update extends BukkitRunnable {
           
            private 
    String query;
            public 
    SQL_Update(String query){
                
    this.query query;
            }
           
            public 
    void run(){
                
    Main.mysql.updateSQL(query);
            }
           
        }
    Any help you guys can provide would be greatly appreciated. It was working perfectly yesterday, and now, it is not. Compiled against bukkit version: bukkit-1.7.10-R0.1-20140708.193657-1.
    Yes, I know that runTask is deprecated in that version, what is the replacement that I should use instead? Yes, this is run on spigot, but, I highly doubt that makes a difference, if you think it will, I will use the corresponding version of craftbukkit to test and prove my point, but I have tried, and it made no difference.
     
    DiamondXF likes this.
  2. Offline

    FabeGabeMC

    LegoPal92
    You need to run the task asynchronously if you are using MySql.
     
  3. Offline

    LegoPal92

    @FabeGabeMC
    That is not actually true, this only happens once. It is only a suggestion to do that. It isn't necessary.
     
  4. Offline

    Gater12

    LegoPal92
    Why not invoke runTask(Plugin p); of BukkitRunnable?
     
  5. Offline

    LegoPal92

    Gater12
    Do you think that would solve the problem?

    I solved it, for anyone curious, by changing my runnable to implement Runnable instead of extend BukkitRunnable.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
Thread Status:
Not open for further replies.

Share This Page