Updating Light Blocks after setType() ?

Discussion in 'Plugin Development' started by Master_Queef, May 26, 2015.

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

    Master_Queef

    As the title says, I'm having some troubles updating light blocks after I set its type to be glowstone for example.
    If a player is not present in the block's chunk then the light is not updated. Is there any workarounds for this?

    - Tried loading the chunk before the update but that failed.
    - Tried making a virtual player place the block, failed
    - Block.getState().update() failed

    Any help or source code would be greatly appreciated. Thanks in advanced
     
    Last edited: May 27, 2015
  2. Offline

    nverdier

  3. Offline

    Master_Queef

    Also did not work.
     
  4. Offline

    nverdier

    Why do you want the block to update if a player isn't there, just asking?
     
  5. Offline

    Master_Queef

    My server has guns that have block destruction where you can shoot out lights and windows. I want the server to restore these blocks on restart when players are not present.
     
  6. Offline

    Master_Queef

    Shameless self bump
     
  7. Offline

    fromgate

    I think @BeYkeRYkt could tell you something helpful :)
     
  8. Offline

    Master_Queef

    Another bump for justice
     
  9. Offline

    Master_Queef

    I'm not going to mark the thread as 'Solved', but I made a working solution.

    I sort all the blocks to recover by chunk, teleport myself to each chunk, delay about 2 seconds for the area to load, then restore all lights within that chunk. It's not exactly what I wanted, but it works and does not use NMS methods/variables.
     
Thread Status:
Not open for further replies.

Share This Page