__plugin_name__ = "InformerWhatisthat"
__plugin_version__ = "0.01-dev"
__plugin_mainclass__ = "Informer"

import os,math,re
from java.io import File
import org.bukkit as bukkit
server = bukkit.Bukkit.getServer()
log = server.getLogger()
import org.bukkit.event.player.PlayerInteractEvent as event
from java.io import FileInputStream,File
from java.lang import String
import org.bukkit as bukkit
from java.util.logging import Level
server = bukkit.Bukkit.getServer()
from org.bukkit.Material import STICK

from org.bukkit.util import Vector
from org.bukkit.configuration.file import YamlConfiguration
from org.bukkit.event import player
clickedblock = event.getClickedBlock
CHAT_PREFIX = "[INFORMER] "

class Informer(PythonPlugin):
       def onEnable(self):
           print "Whatisthat? by Brix is enabled" 
 
       def onDisable(self):
           print "Whatisthat? by Brix is disabled"
           
       @hook.event("player.PlayerInteractEvent","normal")
       def onPlayerInteractEvent(event):
           block = event.getClickedBlock()
           if (event.getPlayer().hasPermission("informer.whatisthat")):
               if (event.getAction() == event.action.RIGHT_CLICK_BLOCK):
                   if (event.getPlayer().getItemInHand().getType() == bukkit.Material.STICK): 
	                   event.getPlayer().sendMessage("[Whatisthat]Informations about right-clicked block: %s"%block)