Solved Setting Light Level?

Discussion in 'Plugin Development' started by Jakeob22, Jan 5, 2013.

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

    Jakeob22

    Is it possible to set the light level of a block? I see you can get the light level and I was just curious. ;)
     
  2. Offline

    zachoooo

    As far as I know, lighting is now handled client side. The only torch plugins I've seen working are ones that create artificial block changes by "placing" glow stone under the player
     
  3. Offline

    Jakeob22

  4. Offline

    HappyPikachu

    Jakeob22 I continued that plugin here until 1.2.3, when light calculation become client-side. Setting glowstone or something under the player seems to be the way to go nowadays.
     
    zachoooo likes this.
  5. Offline

    Jakeob22

    Aw, alright, thanks for the help. :p
     
  6. Offline

    HappyPikachu

    Jakeob22 Np. Please mark as solved. (Thread Tools > Edit Thread > Prefix)
     
  7. Offline

    Icyene

    This thread is filled with partial information which has turned misleading. Lighting levels are still possible to manipulate server-side. First example that comes to mind is desht 's ChessCraft plugin. You can find a method to force this lighting here. All credit to desht for the code.
     
  8. Offline

    HappyPikachu

    Icyene Yes, it certainly is possible to manipulate the levels server-side. However, since lighting is handled by the client, the affected chunks must be re-sent whenever an update occurs in view of the player (i.e. ChessCraft). Great for lighting up standard blocks, not so great for a moving object.
     
  9. Offline

    desht

    Yep, as far as I can tell, the only way to get lighting re-sent is with chunk updates. A quick peruse of the protocol (http://www.wiki.vg/Protocol) suggests the block change packets (52 & 53) only allow the sending of the block ID and block data, not the lighting information. While it's possible to force the lighting server-side with the NMS World b(EnumSkyBlock, int, int, int, int) method (at least for Minecraft 1.2 -> 1.4.6), the only way of getting that updated lighting information to the client appears to be with chunk update packets (51 & 56).

    (And if you're sending more than a trivial number of chunks, it's probably better to use a queued approach like this rather than explicitly sending a load of chunk data. Easier on server load and simpler to use too - the only downside is the client will take a little longer to see the updates).
     
  10. Offline

    Icyene

    You are correct, yet he did not state anything about how this would be used, but only if it is possible.
     
  11. Offline

    Jakeob22

    It was going to be used for a moving object. It you update the chunks fast enough, it seems possible. ;)
     
  12. Offline

    HappyPikachu

    Icyene Yes, he did. See third comment from top. <.<

    Jakeob22 I imagine that would be difficult. I had problems doing this back when the player could only walk. Now that players can run at various speeds, it'll take some resourceful thinking to get it all looking smooth. Good luck, though, and if we managed to answer your question, please mark as 'Solved'.
     
  13. Offline

    AVOCARDO

    Is anyone able to produce a LightAPI plugin simular to TagAPI for colored names above players heads?

    Regards

    AVO
     
Thread Status:
Not open for further replies.

Share This Page