Refactored event calling so its front loading avoiding the lookup for each event call.

This now uses an annoymous class implementing IExecutor that facilitates direct event method handler calling

Changed commands from being executed exclusively by a player to by a CommandSender to facilitate external command callers such as rcon

Fixed CustomEventListener

Merged in additional events

Added getFullName to PluginDescriptionFile which returns the combination of Name and Version

There's also a few bits of reformatting as it seems someones been editing with either tabs or dos eol :(

By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
Bukkit/Spigot
2011-01-29 16:23:56 +00:00
parent 9755073204
commit df05c36540
18 changed files with 534 additions and 361 deletions

View File

@@ -1,97 +1,104 @@
package org.bukkit.event.block;
import org.bukkit.event.Listener;
/**
* Handles all events thrown in relation to Blocks
*
* @author durron597
*/
public class BlockListener implements Listener {
/**
* Default Constructor
*/
public BlockListener() {
}
/**
* Called when a block is damaged (or broken)
*
* @param event Relevant event details
*/
public void onBlockDamage(BlockDamageEvent event) {
}
/**
* Called when we try to place a block, to see if we can build it
*/
public void onBlockCanBuild(BlockCanBuildEvent event) {
}
/**
* Called when a block flows (water/lava)
*
* @param event Relevant event details
*/
public void onBlockFlow(BlockFromToEvent event) {
}
/**
* Called when a block gets ignited
*
* @param event Relevant event details
*/
public void onBlockIgnite(BlockIgniteEvent event) {
}
/**
* Called when block physics occurs
*
* @param event Relevant event details
*/
public void onBlockPhysics(BlockPhysicsEvent event) {
}
/**
* Called when a player places a block
*
* @param event Relevant event details
*/
public void onBlockPlace(BlockPlaceEvent event) {
}
/**
* Called when a block is interacted with
*
* @param event Relevant event details
*/
public void onBlockInteract(BlockInteractEvent event) {
}
/**
* Called when a player right clicks a block
*
* @param event Relevant event details
*/
public void onBlockRightClick(BlockRightClickEvent event) {
}
/**
* Called when redstone changes
* From: the source of the redstone change
* To: The redstone dust that changed
*
* @param event Relevant event details
*/
public void onBlockRedstoneChange(BlockFromToEvent event) {
}
/**
* Called when leaves are decaying naturally
*
* @param event Relevant event details
*/
public void onLeavesDecay(LeavesDecayEvent event) {
}
}
package org.bukkit.event.block;
import org.bukkit.event.Listener;
/**
* Handles all events thrown in relation to Blocks
*
* @author durron597
*/
public class BlockListener implements Listener {
/**
* Default Constructor
*/
public BlockListener() {
}
/**
* Called when a block is damaged (or broken)
*
* @param event Relevant event details
*/
public void onBlockDamage(BlockDamageEvent event) {
}
/**
* Called when we try to place a block, to see if we can build it
*/
public void onBlockCanBuild(BlockCanBuildEvent event) {
}
/**
* Called when a block flows (water/lava)
*
* @param event Relevant event details
*/
public void onBlockFlow(BlockFromToEvent event) {
}
/**
* Called when a block gets ignited
*
* @param event Relevant event details
*/
public void onBlockIgnite(BlockIgniteEvent event) {
}
/**
* Called when block physics occurs
*
* @param event Relevant event details
*/
public void onBlockPhysics(BlockPhysicsEvent event) {
}
/**
* Called when a player places a block
*
* @param event Relevant event details
*/
public void onBlockPlace(BlockPlaceEvent event) {
}
/**
* Called when a block is interacted with
*
* @param event Relevant event details
*/
public void onBlockInteract(BlockInteractEvent event) {
}
/**
* Called when a player right clicks a block
*
* @param event Relevant event details
*/
public void onBlockRightClick(BlockRightClickEvent event) {
}
/**
* Called when redstone changes
* From: the source of the redstone change
* To: The redstone dust that changed
*
* @param event Relevant event details
*/
public void onBlockRedstoneChange(BlockFromToEvent event) {
}
/**
* Called when leaves are decaying naturally
*
* @param event Relevant event details
*/
public void onLeavesDecay(LeavesDecayEvent event) {
}
/**
* Called when a block is destroyed from burning
*
* @param event Relevant event details
*/
public void onBlockBurn(BlockBurnEvent event) {
}
}