当前位置: 首页>>代码示例>>Java>>正文


Java VehicleEntityCollisionEvent类代码示例

本文整理汇总了Java中org.bukkit.event.vehicle.VehicleEntityCollisionEvent的典型用法代码示例。如果您正苦于以下问题:Java VehicleEntityCollisionEvent类的具体用法?Java VehicleEntityCollisionEvent怎么用?Java VehicleEntityCollisionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VehicleEntityCollisionEvent类属于org.bukkit.event.vehicle包,在下文中一共展示了VehicleEntityCollisionEvent类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyEntityCollision

import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; //导入依赖的package包/类
@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);
    }
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:19,代码来源:EntityBoat.java

示例2: onVehicleEntityCollision

import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; //导入依赖的package包/类
@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();
	}
}
 
开发者ID:catageek,项目名称:BCProtect,代码行数:17,代码来源:MobListener.java

示例3: collide

import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:14,代码来源:EntityBoat.java

示例4: onVehiclePush

import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onVehiclePush(final VehicleEntityCollisionEvent event) {
    cancelUnlessInteracting(event, event.getEntity());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:EventFilterMatchModule.java

示例5: onVehicleEntityCollision

import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
    if (this.isObserving(event.getEntity())) {
        event.setCancelled(true);
    }
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:7,代码来源:ObserverListeners.java


注:本文中的org.bukkit.event.vehicle.VehicleEntityCollisionEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。