• 0

[Resolvido] Bukkit scheduler


Critical_XxX
 Share

Question

bem to criando um plugin para melhorar o libshungergames

e nisso eu criei um evento com scheduler

mas o desgra sado do scheduler fica dando erro sendo que nao tem erro no codigo '-'

 

o evento que foi criado e para spawnar fogos em volta do player(tive ajuda nisso (meu abiguinho ajudou))

nao sei o pq dele dar erro

 

e sempre da erro no scheduler nao e em nenhuma outra parte so no scheduler '-'

 

codigo

 

 

Por favor, registre-se ou entre para visualizar isso.

 

 

 

erro

 

 

>start
[13:29:50 INFO]: O jogo iniciou!
[13:29:50 INFO]: A ivencibilidade ira acabar em 2 minutos!
[13:29:50 ERROR]: Could not pass event PlayerWinEvent to kHardcore v1.0
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:294) ~[spigot.jar:git-Spigot-1380]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62) ~[spigot.jar:git-Spigot-1380]
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredLi
stener.java:30) ~[spigot.jar:git-Spigot-1380]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:502) [spigot.jar:git-Spigot-1380]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:487) [spigot.jar:git-Spigot-1380]
        at me.libraryaddict.Hungergames.Hungergames.checkWinner(Hungergames.java
:88) [LibsHungergames.jar:?]
        at me.libraryaddict.Hungergames.Hungergames.startGame(Hungergames.java:5
01) [LibsHungergames.jar:?]
        at me.libraryaddict.Hungergames.Commands.ForceStart.onCommand(ForceStart
.java:33) [LibsHungergames.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spig
ot.jar:git-Spigot-1380]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
0) [spigot.jar:git-Spigot-1380]
        at org.bukkit.craftbukkit.v1_7_R2.CraftServer.dispatchCommand(CraftServe
r.java:719) [spigot.jar:git-Spigot-1380]
        at org.bukkit.craftbukkit.v1_7_R2.CraftServer.dispatchServerCommand(Craf
tServer.java:706) [spigot.jar:git-Spigot-1380]
        at net.minecraft.server.v1_7_R2.DedicatedServer.ax(DedicatedServer.java:
309) [spigot.jar:git-Spigot-1380]
        at net.minecraft.server.v1_7_R2.DedicatedServer.v(DedicatedServer.java:2
74) [spigot.jar:git-Spigot-1380]
        at net.minecraft.server.v1_7_R2.MinecraftServer.u(MinecraftServer.java:5
68) [spigot.jar:git-Spigot-1380]
        at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java
:474) [spigot.jar:git-Spigot-1380]
        at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:6
18) [spigot.jar:git-Spigot-1380]
Caused by: java.lang.NoClassDefFoundError: me/kHardcore/Eventos/Eventos$1
        at me.kHardcore.Eventos.Eventos.Fogos(Eventos.java:262) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
_71]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
_71]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.7.0_71]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:292) ~[spigot.jar:git-Spigot-1380]
        ... 16 more
Caused by: java.lang.ClassNotFoundException: me.kHardcore.Eventos.Eventos$1
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_71]
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_71]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_
71]
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_71]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:77) ~[spigot.jar:git-Spigot-1380]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
java:62) ~[spigot.jar:git-Spigot-1380]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_71]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_71]
        at me.kHardcore.Eventos.Eventos.Fogos(Eventos.java:262) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
_71]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
_71]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.7.0_71]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:292) ~[spigot.jar:git-Spigot-1380]
        ... 16 more
[13:29:50 INFO]: Critical_XxX ganhou o Torneio!
>

 

 

se alguem puder ajudar agradeço

obs: plugin sera free e o evento como acho que alguns perceberam e para soltar fogos na win do hg em volta do player

(sim tipo o like hg so que nao é um circulo grandao '-'(preguiça de fazer grandao '-'))

Edited by Critical_XxX

Share this post


Link to post
Share on other sites

20 answers to this question

Recommended Posts

  • pq e o main.plugin que da o erro sendo que a linha do erro e no scheduler '-'

    Então, eu estava me referindo a esse código:

     

    Por favor, registre-se ou entre para visualizar isso.

    Tente colocar isso na classe principal e troque "Main.plugin" para "this"

    Share this post


    Link to post
    Share on other sites

  • Bukkit.getScheduler().scheduleSyncRepeatingTask(Bukkit.getServer().getPluginManager().getPlugin("kHardcore"), new Runnable 

     

    Tente isso

    Ou, coloca assim no Main

     

    private static Plugin plugin;

     

    @Override

    public void onEnable(){

    plugin = this;

    }

     

    public static Plugin getPlugin(){

    return plugin;

    }

     

    Nesse caso você tem que usar assim

     

    Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getPlugin(), new Runnable 

    Share this post


    Link to post
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.