Get light level not dependent on time of day

Discussion in 'Plugin Development' started by xpansive, Nov 21, 2011.

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

    xpansive

    I'm writing a mushroom populator, and using block.getRelative(BlockFace.UP).getLightLevel() to get the light level. This would work fine if the entire world was generated in the day, however that's not the case if the user explores at night, and mushrooms get placed everywhere. What I'm looking for is a way to get the light level as if it were always day. I'll look into the net.minecraft.server code tomorrow, but I'm wondering if anyone already knows this before I start.

    Thanks
     
  2. Offline

    xpansive

    Anyone? (shameless bump)
     
  3. Offline

    bleachisback

    you should just check if the highestBlockY at all of the blocks around it are not the y of the block that the mushroom is on.
     
  4. Offline

    xpansive

    That was my last resort option :) I guess it'll work, but ill have to test what block types are overhead, make sure they aren't transparent and find out how many I need to check to get the right light level.
     
  5. Offline

    bleachisback

    Daylight is light level 15 and mushrooms need 12, so 3
     
Thread Status:
Not open for further replies.

Share This Page