Solved StackTrace Help!

Discussion in 'Plugin Development' started by xAstraah, Apr 5, 2014.

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

    xAstraah

    Need help on what the error in my StackTrace is. Can't seem to find the error and its spamming console alot. Like 1,000 of the same error. But now its only happening when i run the Runnable, Every 0, 20L

    StackTrace:
    Code:
    [03:50:38] [Server thread/WARN]: [NoEnviromentChanges] Task #97 for NoEnviromentChanges v0.1 generated an exception
    java.lang.NullPointerException
        at io.github.xAstraah.NoEnviromentChanges$1.run(NoEnviromentChanges.java:47) ~[?:?]
        at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:53) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:587) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
     
  2. Offline

    Monkey_Swag

    Can we see your 'NoEnvironmentChanges' class' line 47 please?
     
    xAstraah likes this.
  3. Offline

    xAstraah

  4. Offline

    Monkey_Swag

    xAstraah
    Why are you doing it in an event? And why do you have a command you're not using there? I think you should toggle the weather on and off, not run that thing when a Player joins...
     
    xAstraah likes this.
  5. Offline

    xAstraah

    Monkey_Swag, I want the plugin so that on the @EventHandler (When the player joins) it will start the loop of the parameters in my Runnable() method. But its just giving me the error above like 100 times. So please help me fix it.
     
  6. Offline

    Monkey_Swag

    xAstraah ok so for some reason, it's saying that 'world.setStorm(false);' is causing the exception. Just to see if this will solve it, delete that line, and start up the plugin again. If it doesn't work I have a few other things in mind. And if it does work, we will add the setstorm false later. :)
     
    xAstraah likes this.
  7. Offline

    xAstraah

    Monkey_Swag, Problem is still persisting.

    Monkey_Swag, So the Runnable() Method does work (http://prntscr.com/37enez) its just the world.something Functions?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  8. Offline

    Monkey_Swag

    xAstraah
    Alright, this might not make too much sense, but it's better than doing nothing. I say that maybe you should add a cast to player
    Player p = e.getPlayer();
    Then instead of doing that long world casting, do p.getWorld().setStorm(false); and everything else. I know this sounds really weird and that it does the same function, but I've been in similar situations with events like these and doing something similar to what I just told you has helped me fix it.

    xAstraah what is the new stacktrace? Can you post it please? And btw nice huzini client lol

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
    xAstraah likes this.
  9. Offline

    xAstraah

    Monkey_Swag, Problem 100% Resolved after just doing the same methods using player.setStorm(false); etc

    Thanks!, Also 'Huzuni' and hacked clients are not always used for griefing. Personally i use it for the fly mod.
     
  10. Offline

    Monkey_Swag

    xAstraah likes this.
Thread Status:
Not open for further replies.

Share This Page