Narrowed down the return type of most EntityEvent subclasses for convenience. Addresses BUKKIT-809
This commit is contained in:
@@ -2,7 +2,7 @@ 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,13 +17,18 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
private final Material to;
|
||||
|
||||
public EntityChangeBlockEvent(final Entity what, final Block block, final Material to) {
|
||||
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
|
||||
super(what);
|
||||
this.block = block;
|
||||
this.cancel = false;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LivingEntity getEntity() {
|
||||
return (LivingEntity) entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the block the entity is changing
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user