Java 类org.bukkit.event.vehicle.VehicleEntityCollisionEvent 实例源码

项目:Cauldron    文件:EntityBoat.java   
@Override

    /**
     * Applies a velocity to each of the entities pushing them away from each other. Args: entity
     */
    public void applyEntityCollision(Entity entity)
    {
        org.bukkit.entity.Entity hitEntity = (entity == null) ? null : entity.getBukkitEntity();
        VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), hitEntity);
        this.worldObj.getServer().getPluginManager().callEvent(event);

        if (event.isCancelled())
        {
            return;
        }

        super.applyEntityCollision(entity);
    }
项目:BCProtect    文件:MobListener.java   
@EventHandler (ignoreCancelled = true)
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
    Location loc = event.getVehicle().getLocation(BCProtect.location);
    EntityType type = event.getEntity().getType();
    if (! type.equals(EntityType.PLAYER)
            && ! type.equals(EntityType.MINECART)
            && ! type.equals(EntityType.MINECART_CHEST)
            && ! type.equals(EntityType.MINECART_FURNACE)
            && ! type.equals(EntityType.MINECART_HOPPER)
            && ! type.equals(EntityType.MINECART_MOB_SPAWNER)
            && ! type.equals(EntityType.MINECART_TNT)
            && Util.getQuadtree(loc).contains(loc)) {
        event.setCancelled(true);
        event.getEntity().remove();
    }
}
项目:CraftBukkit    文件:EntityBoat.java   
@Override
public void collide(Entity entity) {
    org.bukkit.entity.Entity hitEntity = (entity == null) ? null : entity.getBukkitEntity();

    VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), hitEntity);
    this.world.getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
        return;
    }

    super.collide(entity);
}
项目:Almura-Server    文件:EntityBoat.java   
@Override
public void collide(Entity entity) {
    org.bukkit.entity.Entity hitEntity = (entity == null) ? null : entity.getBukkitEntity();

    VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), hitEntity);
    this.world.getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
        return;
    }

    super.collide(entity);
}
项目:Tweakkit-Server    文件:EntityBoat.java   
@Override
public void collide(Entity entity) {
    org.bukkit.entity.Entity hitEntity = (entity == null) ? null : entity.getBukkitEntity();

    VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), hitEntity);
    this.world.getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
        return;
    }

    super.collide(entity);
}
项目:Craft-city    文件:EntityBoat.java   
@Override
public void collide(Entity entity) {
    org.bukkit.entity.Entity hitEntity = (entity == null) ? null : entity.getBukkitEntity();

    VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), hitEntity);
    this.world.getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
        return;
    }

    super.collide(entity);
}
项目:ProjectAres    文件:EventFilterMatchModule.java   
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onVehiclePush(final VehicleEntityCollisionEvent event) {
    cancelUnlessInteracting(event, event.getEntity());
}
项目:Arcade2    文件:ObserverListeners.java   
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
    if (this.isObserving(event.getEntity())) {
        event.setCancelled(true);
    }
}