More JavaDoc improvements.
This commit is contained in:
@@ -4,8 +4,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* The event when a skeleton or zombie catch on fire due to the sun.
|
||||
* If the event is cancelled, the fire is stopped.
|
||||
* Called when an entity combusts due to the sun
|
||||
*/
|
||||
public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
@@ -15,10 +14,22 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||
this.cancel = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.util.Random;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Projectile;
|
||||
|
||||
/**
|
||||
* Called when an entity is damaged by a projectile
|
||||
*/
|
||||
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
|
||||
|
||||
private Projectile projectile;
|
||||
|
||||
@@ -7,8 +7,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author SpeaKeasY
|
||||
* Called when an entity explodes
|
||||
*/
|
||||
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
@@ -23,10 +22,22 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
@@ -50,6 +61,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Returns the percentage of blocks to drop from this explosion
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public float getYield() {
|
||||
|
||||
@@ -5,8 +5,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author durron597
|
||||
* Called when an entity interacts with an object
|
||||
*
|
||||
*/
|
||||
public class EntityInteractEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
@@ -10,37 +10,122 @@ import org.bukkit.event.painting.PaintingBreakEvent;
|
||||
public class EntityListener implements Listener {
|
||||
public EntityListener() {}
|
||||
|
||||
/**
|
||||
* Called when a creature is spawned into a world
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onCreatureSpawn(CreatureSpawnEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an item is spawned into a world
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onItemSpawn(ItemSpawnEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity combusts due to the sun
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityCombust(EntityCombustEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity is damaged
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityDamage(EntityDamageEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity explodes
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityExplode(EntityExplodeEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity's fuse is lit
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onExplosionPrime(ExplosionPrimeEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity dies
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityDeath(EntityDeathEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a creature targets another entity
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityTarget(EntityTargetEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity interacts with an object
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityInteract(EntityInteractEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity enters a portal
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityPortalEnter(EntityPortalEnterEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a painting is placed
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPaintingPlace(PaintingPlaceEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a painting is broken
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPaintingBreak(PaintingBreakEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a Pig is struck by lightning
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPigZap(PigZapEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a Creeper is struck by lightning
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onCreeperPower(CreeperPowerEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity is tamed (currently only applies to Wolves)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityTame(EntityTameEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity regains health (currently only applies to Players)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onEntityRegainHealth(EntityRegainHealthEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a project hits an object
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onProjectileHit(ProjectileHitEvent event) {}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
|
||||
/**
|
||||
* Stores data for entities standing inside a portal block
|
||||
*/
|
||||
@@ -18,8 +17,9 @@ public class EntityPortalEnterEvent extends EntityEvent {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Gets the portal block the entity is touching
|
||||
*
|
||||
* @return The portal block the entity is touching
|
||||
*/
|
||||
public Location getLocation() {
|
||||
|
||||
@@ -12,14 +12,12 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||
private boolean cancelled;
|
||||
private int amount;
|
||||
|
||||
public EntityRegainHealthEvent(Entity entity, int amount)
|
||||
{
|
||||
public EntityRegainHealthEvent(Entity entity, int amount) {
|
||||
super(Event.Type.ENTITY_REGAIN_HEALTH, entity);
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
protected EntityRegainHealthEvent(Event.Type type, Entity entity, int amount)
|
||||
{
|
||||
protected EntityRegainHealthEvent(Event.Type type, Entity entity, int amount) {
|
||||
super(type, entity);
|
||||
this.amount = amount;
|
||||
}
|
||||
@@ -28,13 +26,14 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||
* Gets the amount of regained health
|
||||
* @return The amount of health regained
|
||||
*/
|
||||
public int getAmount()
|
||||
{
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the amount of regained health
|
||||
*
|
||||
* @param amount the amount of health the entity will regain
|
||||
*/
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
|
||||
@@ -4,8 +4,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* This event is fired when a mob (or any creature) targets another entity
|
||||
* @author tkelly
|
||||
* Called when a creature targets another entity
|
||||
*/
|
||||
public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
@@ -19,14 +18,21 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the change in target. The entity will remain with their original
|
||||
* target, whether that is nothing or another entity.
|
||||
* @param cancel
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
|
||||
@@ -4,6 +4,9 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Explosive;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when an entity has made a decision to explode.
|
||||
*/
|
||||
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
private float radius;
|
||||
@@ -20,26 +23,58 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||
this(explosive, explosive.getYield(), explosive.isIncendiary());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the radius of the explosion
|
||||
*
|
||||
* @return returns the radius of the explosion
|
||||
*/
|
||||
public float getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the radius of the explosion
|
||||
*
|
||||
* @param radius the radius of the explosion
|
||||
*/
|
||||
public void setRadius(float radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this explosion will create fire or not
|
||||
*
|
||||
* @return true if this explosion will create fire
|
||||
*/
|
||||
public boolean getFire() {
|
||||
return fire;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this explosion will create fire or not
|
||||
*
|
||||
* @param fire true if you want this explosion to create fire
|
||||
*/
|
||||
public void setFire(boolean fire) {
|
||||
this.fire = fire;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Projectile;
|
||||
|
||||
/**
|
||||
* Called when a projectile hits an object
|
||||
*/
|
||||
public class ProjectileHitEvent extends EntityEvent {
|
||||
|
||||
public ProjectileHitEvent(Projectile projectile) {
|
||||
|
||||
Reference in New Issue
Block a user