getLightLevel() Problems

Discussion in 'Plugin Development' started by ursa_arcadius, Feb 1, 2011.

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

    ursa_arcadius

    Does anyone know of problems with block.getLightLevel()
    I have written just a simple plugin (important part below) and am getting some strange results. It seems that broad daylight is 0 and then as I move into more and more shade it goes down, 13...12...11, but then just jumps to 0 and stays there. Anyone know whats up? This is my first plugin so I am inclined to believe I am doing something wrong.

    Code:
     public void onBlockRightClick(BlockRightClickEvent event) {
             //Get the player doing the placing
                Player player = event.getPlayer();
                //Get the block that was rightclicked
                Block block = event.getBlock();
                //If the player has the command enabled. Do this.
                if(tooDark2PlayerListener.plugin.enabled(player)){
                    //Tells the player the light level of block right clicked
                    player.sendMessage("The light level is " + block.getLightLevel());
                }
            }
    --- merged: Feb 3, 2011 5:21 AM ---
    Well I am not sure what happened but in my reshuffling of things to use onCommand() it seems to have been fixed.
    Problem Solved! (sort of)
     
Thread Status:
Not open for further replies.

Share This Page