"Unexpected Exception" while setting lots of block

Discussion in 'Plugin Development' started by DiddiZ, Mar 25, 2011.

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

    DiddiZ

    I need some help with LogBlock.
    I'm at my wit's end. During larger rollback occasionally occurres this exception:
    Code:
    2011-03-25 23:11:28 [SEVERE] java.lang.NullPointerException
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.World.a(World.java:1366)
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.World.a(World.java:1339)
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.World.a(World.java:492)
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.MetadataChunkBlock.a(SourceFile:105)
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.World.e(World.java:1327)
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:350)
    2011-03-25 23:11:28 [SEVERE] [LogBlock Rollback] java.lang.NullPointerException
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    2011-03-25 23:11:28 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-03-25 23:11:28 [SEVERE] Unexpected exception
    java.lang.NullPointerException
        at net.minecraft.server.World.a(World.java:1366)
        at net.minecraft.server.World.a(World.java:1339)
        at net.minecraft.server.World.a(World.java:492)
        at net.minecraft.server.MetadataChunkBlock.a(SourceFile:105)
        at net.minecraft.server.World.e(World.java:1327)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:350)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    (Source Code)
    The interessting point is, that not LogBlock but the server throws a nullpointer exception while (or in conjunction to) setting a blocks type and data.
    My first thought was, that I'm just overcharging the server, but I added large delays (only 100 blocks per second) and even waiting after each block didn't lead to no error. Before the setTypeAndData, I used setType and setData seperately with the same outcome.
    Am I still overcharging the server, or is the problem a different one?

    Does anyone know something about this?
     
  2. Offline

    Edward Hand

    Just a stab in the dark, but are you doing all this on a separate thread or using asynchronous schedulers?
    Or is it possible the chunks aren't loaded?
     
  3. Offline

    DiddiZ

    Seperate thread and chucks are loaded.
     
  4. Offline

    Edward Hand

    Separate thread = bad.
    It can lead to corruption of the server data as well as the errors you are seeing.
    Consider using the synchronised scheduler functions if you need to spread something out over time.
     
  5. Offline

    DiddiZ

    Ah, did't thought about that. will try this.

    You are my hero!
    (and I'm feeling kind of dumb, right now :D)

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

    DiddiZ

    After the initial enthusiasm (I got 1.2 mio blocks rollbacked without any problem), it now looks like nothing changed. The server still crashs with the same error.
    I use scheduleSyncDelayedTask().
     
  7. Offline

    Edward Hand

    Are you trying to do it all in one execution? Have you tried doing it in small chunks with a delay in between? (using scheduleSyncRepeatingTask())
     
  8. Offline

    DiddiZ

    That's exactly the way BB it does. I'll give it a try.
     
Thread Status:
Not open for further replies.

Share This Page