Setting the Light Level of a Block

Discussion in 'Plugin Development' started by dv90, May 1, 2011.

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


    I've noticed that there's a Block.getLightLevel() function, but no setLightLevel(). I did some looking around and found that there used to be a way to set the light level with CraftBukkit like so:

    ((CraftWorld)block.getWorld()).getHandle().b(EnumSkyBlock.BLOCK, x, y, z, lightLevel);
    However, this doesn't seem to work anymore. Has anybody found another way to accomplish this and are there any plans for implementing such a function in the Bukkit API?
  2. Offline


    Shameless self bump. :I
  3. Offline



    Check my thread here (it deals with : How to make player seeing better at night).
    If you get sample code, please share ;)
  4. Offline


    Hm. Ideally I would like to stay away from having to send additional packets however if I can't find another way, I might have to resort to something related to what that thread is dealing with. If I have any luck, I'll gladly post it here.
  5. Offline


    How you had do it?
    Do you finished it?
  6. Offline


    Lighting is calculated by the client, thus there's no way to change it from the server.
  7. Offline


    ...Some Plugins before this done it from Server with this:
    ((CraftWorld)world).getHandle().a(EnumSkyBlock.BLOCK, x, y, z, lightLevel);

    And you want to tell me "Lighting is calculated by the client, thus there's no way to change it from the server."?

    But I had found something interesting... Its not working in the first try... But if I rejoin there is the lighting... Why?
  8. Offline


    Did you call the update method? not sure if this with what you need but worth a try
  9. Offline


    Because lighting is calculated by the client ;)

    I have used this in the past, but it broke with 1.8.1. There is no nice way to do it without a client mod.
  10. Offline


    Naaahhh... That ****...
    So I close a Project...
    But thx for help guys...
Thread Status:
Not open for further replies.

Share This Page