Some more backwards incompatible changes (minor though), also a ton of small cleanup.

onPluginEnable(PluginEvent event)   -> onPluginEnable(PluginEnableEvent event)
onPluginDisable(PluginEvent event)  -> onPluginDisable(PluginDisableEvent event)
onVehicleUpdate(VehicleEvent event) -> onVehicleUpdate(VehicleUpdateEvent event)
onWorldSave(WorldEvent event)       -> onWorldSave(WorldSaveEvent event)
onWorldLoad(WorldEvent event)       -> onWorldLoad(WorldLoadEvent event)
This commit is contained in:
Erik Broes
2011-03-26 22:21:20 +01:00
parent 7788522d65
commit 158906c132
60 changed files with 312 additions and 376 deletions

View File

@@ -4,7 +4,6 @@ import org.bukkit.entity.CreatureType;
import org.bukkit.entity.Entity;
import org.bukkit.Location;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
/**
* Stores data for damage events
@@ -16,13 +15,7 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
private CreatureType creatureType;
public CreatureSpawnEvent(Entity spawnee, CreatureType mobtype, Location loc) {
super(Event.Type.CREATURE_SPAWN, spawnee);
this.creatureType = mobtype;
this.location = loc;
}
protected CreatureSpawnEvent(Event.Type type, Entity spawnee, CreatureType mobtype, Location loc) {
super(type, spawnee);
super(Type.CREATURE_SPAWN, spawnee);
this.creatureType = mobtype;
this.location = loc;
}

View File

@@ -10,8 +10,8 @@ import org.bukkit.event.Cancellable;
public class EntityCombustEvent extends EntityEvent implements Cancellable {
private boolean cancel;
public EntityCombustEvent(Type type, Entity what) {
super(type, what);
public EntityCombustEvent(Entity what) {
super(Type.ENTITY_COMBUST, what);
this.cancel = false;
}

View File

@@ -3,7 +3,6 @@ package org.bukkit.event.entity;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
/**
* Stores details for damage events where the damager is a block
@@ -12,9 +11,8 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent implements Cance
private Block damager;
public EntityDamageByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage)
{
super(Event.Type.ENTITY_DAMAGE, damagee, cause, damage);
public EntityDamageByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage) {
super(Type.ENTITY_DAMAGE, damagee, cause, damage);
this.damager = damager;
}

View File

@@ -2,7 +2,6 @@ package org.bukkit.event.entity;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
/**
* Stores details for damage events where the damager is a block
@@ -11,15 +10,8 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent implements Canc
private Entity damager;
public EntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage)
{
super(Event.Type.ENTITY_DAMAGE, damagee, cause, damage);
this.damager = damager;
}
protected EntityDamageByEntityEvent(Type damageType, Entity damager, Entity damagee, DamageCause cause, int damage)
{
super(damageType, damagee, cause, damage);
public EntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage) {
super(Type.ENTITY_DAMAGE, damagee, cause, damage);
this.damager = damager;
}

View File

@@ -3,7 +3,6 @@ package org.bukkit.event.entity;
import java.util.Random;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
@@ -11,7 +10,7 @@ public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
private boolean bounce;
public EntityDamageByProjectileEvent(Entity damager, Entity damagee, Entity projectile, DamageCause cause, int damage) {
super(Event.Type.ENTITY_DAMAGE, damager, damagee, cause, damage);
super(damager, damagee, cause, damage);
this.projectile = projectile;
Random random = new Random();
this.bounce = random.nextBoolean();

View File

@@ -11,8 +11,8 @@ import org.bukkit.inventory.ItemStack;
public class EntityDeathEvent extends EntityEvent {
private List<ItemStack> drops;
public EntityDeathEvent(final Type type, final Entity what, final List<ItemStack> drops) {
super(type, what);
public EntityDeathEvent(final Entity what, final List<ItemStack> drops) {
super(Type.ENTITY_DEATH, what);
this.drops = drops;
}

View File

@@ -14,11 +14,11 @@ import org.bukkit.event.Cancellable;
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private Location location;
private List blocks;
private List<Block> blocks;
private float yield = 0.3F;
public EntityExplodeEvent (Type type, Entity what, Location location, List<Block> blocks) {
super(type.ENTITY_EXPLODE, what);
public EntityExplodeEvent (Entity what, Location location, List<Block> blocks) {
super(Type.ENTITY_EXPLODE, what);
this.location = location;
this.cancel = false;
this.blocks = blocks;

View File

@@ -8,8 +8,8 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
private float radius;
private boolean fire;
public ExplosionPrimeEvent(Type type, Entity what, float radius, boolean fire) {
super(type.EXPLOSION_PRIME, what);
public ExplosionPrimeEvent(Entity what, float radius, boolean fire) {
super(Type.EXPLOSION_PRIME, what);
this.cancel = false;
this.radius = radius;
this.fire = fire;