Server crashes with plugin at Random integer....

Discussion in 'Plugin Development' started by paxi, Jul 25, 2014.

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

    paxi

    Hello,

    i have a small problem with my plugin! Sometimes when i use an method my server crashed and the most of the time not!

    The error of console is:
    Code:
    Ich hatte nur das oberste ;)
     
    [CODE] ------------------------------
    Server thread dump (Look for plugins here before reporting to Spigot!):
    ------------------------------
    Current Thread: Server thread
          PID: 13 | Suspended: false | Native: false | State: RUNNABLE
          Stack:
                  java.util.Random.next(Random.java:189)
                  java.util.Random.nextDouble(Random.java:444)
                  java.lang.Math.random(Math.java:716)
                  XX.getAttribut(ItemCalculator.java:731)
                  XX.getAttribut(ItemCalculator.java:738)
                  XX.getAttribut(ItemCalculator.java:738)
                  XX.getAttribut(ItemCalculator.java:738)
                  XX.getAttribute(ItemCalculator.java:724)
                  XX.giveItemAttributes(ItemCalculator.java:196)
                  XX.giveDrop(ItemCalculator.java:743)
                  XX.RPGListener.onKillEntity(RPGListener.java:165)
                  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  java.lang.reflect.Method.invoke(Method.java:601)
                  org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292)
                  org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
                  org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30)
                  org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
                  org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
                  org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory.callEntityDeathEvent(CraftEventFactory.java:349)
                  net.minecraft.server.v1_7_R2.EntityChicken.dropDeathLoot(EntityChicken.java:106)
                  net.minecraft.server.v1_7_R2.EntityLiving.die(EntityLiving.java:791)
                  net.minecraft.server.v1_7_R2.EntityLiving.damageEntity(EntityLiving.java:739)
                  net.minecraft.server.v1_7_R2.EntityAnimal.damageEntity(SourceFile:145)
                  org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity.damage(CraftLivingEntity.java:203)
                  org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity.damage(CraftLivingEntity.java:188)
                  com.faldoria.rpg.skills.skills.AssassineBlade.use(AssassineBlade.java:27)
                  com.faldoria.rpg.skills.types.ActiveEntitySkill.use(ActiveEntitySkill.java:28)
    ------------------------------
    Current Thread: Signal Dispatcher
          PID: 4 | Suspended: false | Native: false | State: RUNNABLE
          Stack:
    ------------------------------
    Current Thread: Finalizer
          PID: 3 | Suspended: false | Native: false | State: WAITING
          Stack:
                  java.lang.Object.wait(Native Method)
    [/CODE]

    The code at the lines is:
    Code:java
    1. private int getAttribut(boolean isArmor) { //line 730 is here
    2. int attribut = (int) (Math.random() * 13 + 1);
    3. if(!isArmor && attribut != 3 && attribut < 9 ){
    4. return attribut;
    5. }
    6. if(isArmor && (attribut > 8 || attribut == 3)){
    7. return attribut;
    8. }
    9. return getAttribut(isArmor);
    10. }


    It's only something for a random int under special conditions...

    Has somebody an idea why my server crashes?

    Thanks a lot :)!
     
  2. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Seek support where you acquired your server mod.
     
Thread Status:
Not open for further replies.

Share This Page