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


Java属性org.bukkit.entity.EntityType.WITHER代码示例

以下是Java属性org.bukkit.entity.EntityType.WITHER的代码示例。如果您正苦于以下问题:Java EntityType.WITHER属性的具体用法?Java EntityType.WITHER怎么用?Java EntityType.WITHER使用的例子?那么恭喜您, 这里整理的属性代码示例例程将为您提供帮助。您也可以进一步了解该方法所在org.bukkit.entity.EntityType的用法示例。

本文一共展示了EntityType.WITHER的4个开源代码实例,这些例子默认根据受欢迎程度排序。您可以为喜欢的代码打CALL点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: WitherChangeBlocks

/**
 * Withers change blocks to air after they are hit (don't know why)
 * This prevents this when the wither has been spawned by a visitor
 * @param e
 */
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void WitherChangeBlocks(EntityChangeBlockEvent e) {
    if (DEBUG) {
        plugin.getLogger().info(e.getEventName());
    }
    // Only cover withers in the island world
    if (e.getEntityType() != EntityType.WITHER || !Util.inWorld(e.getEntity()) ) {
        return;
    }
    if (mobSpawnInfo.containsKey(e.getEntity())) {
        // We know about this wither
        if (DEBUG) {
            plugin.getLogger().info("DEBUG: We know about this wither");
        }
        if (!mobSpawnInfo.get(e.getEntity()).inIslandSpace(e.getEntity().getLocation())) {
            // Cancel the block changes
            if (DEBUG) {
                plugin.getLogger().info("DEBUG: cancelled wither block change");
            }
            e.setCancelled(true);
        }
    }
}
 
开发者ID:tastybento,项目:bskyblock,完整代码来源:FlyingMobEvents.java


示例2: onCreatureSpawn

@EventHandler
public void onCreatureSpawn(CreatureSpawnEvent e)
{
    if (e.getEntityType() != EntityType.PLAYER && e.getEntityType() != EntityType.WITHER)
    {
        if (MWAPI.getConfig().stopEntitySpawn())
        {
            e.setCancelled(true);
        }
    }
}
 
开发者ID:WoutDev,项目:Mega-Walls,完整代码来源:CreatureSpawnListener.java


示例3: getType

public EntityType getType() {
    return EntityType.WITHER;
}
 
开发者ID:UraniumMC,项目:Uranium,完整代码来源:CraftWither.java


示例4: WitherExplode

/**
 * Deal with pre-explosions
 */
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void WitherExplode(ExplosionPrimeEvent e) {
    if (DEBUG) {
        plugin.getLogger().info(e.getEventName());
    }
    // Only cover withers in the island world
    if (!Util.inWorld(e.getEntity()) || e.getEntity() == null) {
        return;
    }
    // The wither or wither skulls can both blow up
    if (e.getEntityType() == EntityType.WITHER) {
        //plugin.getLogger().info("DEBUG: Wither");
        // Check the location
        if (mobSpawnInfo.containsKey(e.getEntity())) {
            // We know about this wither
            if (DEBUG) {
                plugin.getLogger().info("DEBUG: We know about this wither");
            }
            if (!mobSpawnInfo.get(e.getEntity()).inIslandSpace(e.getEntity().getLocation())) {
                // Cancel the explosion
                if (DEBUG) {
                    plugin.getLogger().info("DEBUG: cancelling wither pre-explosion");
                }
                e.setCancelled(true);
            }
        }
        // Testing only e.setCancelled(true);
    }
    if (e.getEntityType() == EntityType.WITHER_SKULL) {
        //plugin.getLogger().info("DEBUG: Wither skull");
        // Get shooter
        Projectile projectile = (Projectile)e.getEntity();
        if (projectile.getShooter() instanceof Wither) {
            //plugin.getLogger().info("DEBUG: shooter is wither");
            Wither wither = (Wither)projectile.getShooter();
            // Check the location
            if (mobSpawnInfo.containsKey(wither)) {
                // We know about this wither
                if (DEBUG) {
                    plugin.getLogger().info("DEBUG: We know about this wither");
                }
                if (!mobSpawnInfo.get(wither).inIslandSpace(e.getEntity().getLocation())) {
                    // Cancel the explosion
                    if (DEBUG) {
                        plugin.getLogger().info("DEBUG: cancel wither skull explosion");
                    }
                    e.setCancelled(true);
                }
            }
        }
    }
}
 
开发者ID:tastybento,项目:bskyblock,完整代码来源:FlyingMobEvents.java



注:本文示例均筛选自Github平台上各路大神开发的开源项目,代码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。