@@ -96,13 +96,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
|
||||
* When a creature spawns because of a lightning strike
|
||||
*/
|
||||
LIGHTNING,
|
||||
/**
|
||||
* When a creature is spawned by a player that is sleeping
|
||||
*
|
||||
* @deprecated No longer used
|
||||
*/
|
||||
@Deprecated
|
||||
BED,
|
||||
/**
|
||||
* When a snowman is spawned by being built
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.bukkit.event.entity;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
@@ -17,19 +16,6 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
||||
private final Material to;
|
||||
private final byte data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param what the LivingEntity causing the change
|
||||
* @param block the block (before the change)
|
||||
* @param to the future material being changed to
|
||||
* @deprecated Provided as a backward compatibility before the data byte
|
||||
* was provided, and type increased to all entities
|
||||
*/
|
||||
@Deprecated
|
||||
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
|
||||
this (what, block, to, (byte) 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param what the Entity causing the change
|
||||
|
||||
@@ -12,11 +12,6 @@ import org.bukkit.entity.Entity;
|
||||
public class EntityDamageByBlockEvent extends EntityDamageEvent {
|
||||
private final Block damager;
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final int damage) {
|
||||
this(damager, damagee, cause, (double) damage);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final double damage) {
|
||||
super(damagee, cause, damage);
|
||||
|
||||
@@ -11,11 +11,6 @@ import org.bukkit.entity.Entity;
|
||||
public class EntityDamageByEntityEvent extends EntityDamageEvent {
|
||||
private final Entity damager;
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final int damage) {
|
||||
this(damager, damagee, cause, (double) damage);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final double damage) {
|
||||
super(damagee, cause, damage);
|
||||
|
||||
@@ -28,11 +28,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private final DamageCause cause;
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageEvent(final Entity damagee, final DamageCause cause, final int damage) {
|
||||
this(damagee, cause, (double) damage);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public EntityDamageEvent(final Entity damagee, final DamageCause cause, final double damage) {
|
||||
this(damagee, cause, new EnumMap<DamageModifier, Double>(ImmutableMap.of(DamageModifier.BASE, damage)), new EnumMap<DamageModifier, Function<? super Double, Double>>(ImmutableMap.of(DamageModifier.BASE, ZERO)));
|
||||
@@ -431,6 +426,13 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
* <p>
|
||||
* Damage: 1
|
||||
*/
|
||||
HOT_FLOOR
|
||||
HOT_FLOOR,
|
||||
/**
|
||||
* Damage caused when an entity is colliding with too many entities due
|
||||
* to the maxEntityCramming game rule.
|
||||
* <p>
|
||||
* Damage: 6
|
||||
*/
|
||||
CRAMMING
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,6 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||
private double amount;
|
||||
private final RegainReason regainReason;
|
||||
|
||||
@Deprecated
|
||||
public EntityRegainHealthEvent(final Entity entity, final int amount, final RegainReason regainReason) {
|
||||
this(entity, (double) amount, regainReason);
|
||||
}
|
||||
|
||||
public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) {
|
||||
super(entity);
|
||||
this.amount = amount;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when an entity dies and may have the opportunity to be resurrected.
|
||||
* Will be called in a cancelled state if the entity does not have a totem
|
||||
* equipped.
|
||||
*/
|
||||
public class EntityResurrectEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
//
|
||||
private boolean cancelled;
|
||||
|
||||
public EntityResurrectEvent(LivingEntity what) {
|
||||
super(what);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity) entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.entity.AbstractHorse;
|
||||
|
||||
/**
|
||||
* Called when a horse jumps.
|
||||
@@ -12,7 +12,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private float power;
|
||||
|
||||
public HorseJumpEvent(final Horse horse, final float power) {
|
||||
public HorseJumpEvent(final AbstractHorse horse, final float power) {
|
||||
super(horse);
|
||||
this.power = power;
|
||||
}
|
||||
@@ -30,8 +30,8 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Horse getEntity() {
|
||||
return (Horse) entity;
|
||||
public AbstractHorse getEntity() {
|
||||
return (AbstractHorse) entity;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
|
||||
* Power does not affect how high the horse is capable of jumping, only
|
||||
* how much of its jumping capability will be used in this jump. To set
|
||||
* the horse's overall jump strength, see {@link
|
||||
* Horse#setJumpStrength(double)}.
|
||||
* AbstractHorse#setJumpStrength(double)}.
|
||||
*
|
||||
* @return jump strength
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user