use of cn.nukkit.event.entity.EntityInteractEvent in project Nukkit by Nukkit.
the class BlockPressurePlateBase method onEntityCollide.
@Override
public void onEntityCollide(Entity entity) {
int power = getRedstonePower();
if (power == 0) {
Event ev;
if (entity instanceof Player) {
ev = new PlayerInteractEvent((Player) entity, null, this, null, Action.PHYSICAL);
} else {
ev = new EntityInteractEvent(entity, this);
}
this.level.getServer().getPluginManager().callEvent(ev);
if (!ev.isCancelled()) {
updateState(power);
}
}
}
Aggregations