本文整理汇总了Java中org.bukkit.entity.EntityType.WITHER_SKULL属性的典型用法代码示例。如果您正苦于以下问题:Java EntityType.WITHER_SKULL属性的具体用法?Java EntityType.WITHER_SKULL怎么用?Java EntityType.WITHER_SKULL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.entity.EntityType
的用法示例。
在下文中一共展示了EntityType.WITHER_SKULL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getType
public EntityType getType() {
return EntityType.WITHER_SKULL;
}
示例2: 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);
}
}
}
}
}