onChunkUnload - Removing torches does not reset light levels

Discussion in 'Plugin Development' started by broonie, Feb 9, 2013.

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

    broonie

    Hi,

    I have developed a plugin which checks for certain blocks on a chunk unload (torches, glowstone, etc.)

    It then changes the block to dirt, however light still emits from that block.

    Any suggestions?
     
  2. broonie
    Maybe you need to refresh the chunk, send a lighting update? We need to see your code.
     
  3. Offline

    broonie

    How do you refresh a chunk/send a lighting update?
     
  4. broonie
    Code:
    World w;
    w.refreshChunk(x,z);
    Show us your code so we can help you troubleshoot, otherwise we're just guessing.
     
  5. Offline

    broonie

    Code:
    if(e.getChunk().getBlock(x, y, z).getType() == Material.TORCH) {
       e.getChunk().getBlock(x, y, z).setType(Material.SNOW_BLOCK);
       e.getWorld().refreshChunk(e.getChunk().getX(), e.getChunk().getZ());
       }
    
    Does not work, though torch is replaced by snow block.

    Any suggestions?

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

    keensta

    Isn't lighting handle by the client and not the server. Maybe I never done it before but send a packet to show lighting update not sure what its called or if its possible its just a guess. It's kind like when your in the nether and someone puts out a fire but the light from it remains.
     
Thread Status:
Not open for further replies.

Share This Page