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

@@ -38,8 +38,7 @@ public abstract class Event {
* @return Name of this event
*/
public final String getEventName() {
if(type!=Type.CUSTOM_EVENT) return type.toString();
else return name;
return ( type != Type.CUSTOM_EVENT) ? type.toString() : name;
}
/**
@@ -275,6 +274,13 @@ public abstract class Event {
*/
BLOCK_INTERACT (Category.BLOCK),
/**
* Called when a block is destroyed from being burnt by fire
*
* @see org.bukkit.event.block.BlockBurnEvent
*/
BLOCK_BURN (Category.BLOCK),
/**
* Called when leaves are decaying naturally
*
@@ -356,6 +362,13 @@ public abstract class Event {
*/
PLUGIN_DISABLE (Category.SERVER),
/**
* Called when a plugin is disabled
*
* @see org.bukkit.event.server.PluginEvent
*/
SERVER_COMMAND (Category.SERVER),
/**
* WORLD EVENTS
*/
@@ -417,7 +430,7 @@ public abstract class Event {
* @see org.bukkit.event.entity.EntityDamageByEntityEvent
*/
ENTITY_DAMAGEDBY_ENTITY (Category.LIVING_ENTITY),
/**
* Called when a LivingEntity is damaged by a projectile Entity
*
@@ -445,7 +458,7 @@ public abstract class Event {
* @todo: add javadoc see comment
*/
ENTITY_COMBUST (Category.LIVING_ENTITY),
/**
* Called when an entity explodes, either TNT, Creeper, or Ghast Fireball
*
@@ -453,6 +466,13 @@ public abstract class Event {
*/
ENTITY_EXPLODE (Category.LIVING_ENTITY),
/**
* Called when an entity targets another entity
*
* @see org.bukkit.event.entity.EntityTargetEvent
*/
ENTITY_TARGET (Category.LIVING_ENTITY),
/**
* VEHICLE EVENTS
*/