Api

The OreBroadcast API

OreBroadcastEvent

You can listen to the OreBroadcastEvent the same way you listen to other bukkit events:

package example.handler;

import be.bendem.bukkit.orebroadcast.OreBroadcastEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class OBHandler implements Listener {
    
    @EventHandler
    public void onOBMessage(OreBroadcastEvent event) {
        // Handle the event in here
    }

}

From this event, you can

  • get and set the message format (using the tags specified in the jds)
  • get the player who triggered the event
  • get the block mined by the player
  • get the recipients of the message
  • get the entire vein concerned by the message

Here is an example of what you could do with it (logging findings to a file).

OreBroadcast

The OreBroadcast class let you customize which blocks are broadcasted and which aren't.

The methods availables are:

  • void blackList(Block): If the block passed is mined, it will not triggered a broadcast anymore.
  • void blackList(Collection<Block>): If a block of the collection passed is mined, it will not triggered a broadcast anymore.
  • void unBlackList(Block): If the block is mined, it will be broadcasted.
  • int clearBlackList(): Remove every block from the blacklist and return the number of blocks cleared.
  • boolean isBlackListed(Block): Checks wether a block will trigger a broadcast or not when broken.
  • boolean isWhitelisted(Material): Checks wether or not the specified material should trigger a broadcast.
  • boolean isWorldWhitelisted(String): Checks wether or not OreBroadcast is active in the specified world.

To use these methods, you'll first need to get an instance of the plugin. Here is how to do it:

OreBroadcast oreBroadcast = (OreBroadcast) Bukkit.getPluginManager().getPlugin("OreBroadcast");