Modificating Blocks - Error I can't understand

Discussion in 'Plugin Development' started by mxE333xm, Jun 5, 2011.

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

    mxE333xm

    I just get an exception while doing that simple task.

    is the code.
    It's guaranteed, that:
    • pCurrentLoc != null
    • pCurrentLoc.getBlock() != null
    • ThisMaterial.isBlock == true
    • ThisMaterial != null
    • The type of pCurrentLoc.getBlock() is Material.Air before the code above is executed.

    It results in this error:
    Anyone an idea where that error comes from?
     
  2. You need to get the world as well. Look at the source code of my TameGrass plugin, it's up on github and you can see an example in there.
     
  3. Offline

    DreadKyller

    @Adamki11s doesn't a location hold the world it's in, cause when you make a new location it's new Location(world, x, y, z), so why would he need to get the world to get the block at the location? all that location.getBlock() does is returns world.getBlockAt(this)
     
  4. Offline

    mxE333xm

    Doesn't help. Other ideas?
     
  5. Offline

    Acrobot

    If you are using Async thread, you can't do that, you have to do that in Synch thread.
     
    mxE333xm likes this.
  6. Offline

    DreadKyller

    can you supply some of your code so we might be able to see any error, cause it might not be that's not working, it might be that it's never getting to that point.
     
  7. Offline

    mxE333xm

    Ok, tried to use that in a async thread, and so it will not work. Thanks for your answer :)

    Also thanks DradKyller and adamki11 for your efforts :)
     
Thread Status:
Not open for further replies.

Share This Page