WorldEdit API Plugin

Discussion in 'Plugin Development' started by Techtony96, Dec 30, 2012.

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

    Techtony96

    So I get an error when this code is run:

    Code:
    http://pastie.org/5674519

    Error:
    Code:
    [WARNING] [Apoclyptic] Task #3 for Apoclyptic v0.1 generated an exception
    java.lang.NullPointerException
    at me.Techtony96.Apocalyptic.doReplace(Apocalyptic.java:270)
    at me.Techtony96.Apocalyptic$2.run(Apocalyptic.java:247)
    at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftTask.run(CraftTask.java:53)
    at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
    at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:530)
    at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224)
    at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:494)
    at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:427)
    at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
    
     
  2. Offline

    Techtony96

  3. Offline

    fireblast709

    Techtony96 what is line 270? (somehow I end up on Collections.shuffle(blocks). You haven't declared a variable Collections, do you?)
     
  4. Offline

    Techtony96

    Let me rerun this error and paste my entire class.

    Code: http://pastie.org/5679955 (line numbers match up)
    Error: http://pastie.org/5679961

    fireblast709

    No i do not have a variable named Collections and i updated my post above :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  5. Offline

    fireblast709

    Techtony96 world is null. Reason: calling it before the world as put inside the List<World>. Where you initialize Location Start, use Bukkit.getWorld("world")
     
  6. Offline

    Techtony96

    ah, thanks. that fixed it.

    fireblast709 Scizzr

    Im getting an error on Scizzr's code, and i looked through everything really quick and it should work...

    Error:
    Code:
    [WARNING] [Apoclyptic] Task #6 for Apoclyptic v0.2 generated an exception
    java.lang.NullPointerException
    at me.Techtony96.Apocalyptic.doReplace(Apocalyptic.java:326)
    at me.Techtony96.Apocalyptic$2.run(Apocalyptic.java:312)
    at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftTask.run(CraftTask.java:53)
    at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
    at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:517)
    at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224)
    at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:481)
    at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:416)
    at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
    
    Code: http://pastie.org/5682595
    Line numbers match up with my code

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

    fireblast709

    First of all, you can use getBlockAt(x,y,z). Secondly, try setting Location min and max final
     
  8. Offline

    Techtony96

    Could you show me what you mean with getBlockAt(x,y,z) in my code? I tried changing the variables to final and it didn't fix the problem.
     
  9. Offline

    fireblast709

    world.getBlockAt(x,y,z). Also, your problem is that you initialize your Locations in the class body (in which case, Bukkit.getWorld("world") returns null as the worldlist is not done yet).

    [fixed code] http://pastie.org/5735806
     
  10. Offline

    Techtony96

    Thanks, that fixed it.
     
Thread Status:
Not open for further replies.

Share This Page