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


Java EntityCombustEvent.getEntityType方法代码示例

本文整理汇总了Java中org.bukkit.event.entity.EntityCombustEvent.getEntityType方法的典型用法代码示例。如果您正苦于以下问题:Java EntityCombustEvent.getEntityType方法的具体用法?Java EntityCombustEvent.getEntityType怎么用?Java EntityCombustEvent.getEntityType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.event.entity.EntityCombustEvent的用法示例。


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

示例1: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onEntityCombust(EntityCombustEvent event)
{
	if (stopSunlightCombustion)
	{
		EntityType type = event.getEntityType();
		if (type == EntityType.SKELETON || type == EntityType.ZOMBIE)
		{
			World world = event.getEntity().getWorld();
			if (world.getTime() <= 13500L)
			{
				event.setCancelled(true);
			}
		}
	}
}
 
开发者ID:MineSworn,项目名称:SwornCritters,代码行数:17,代码来源:EntityListener.java

示例2: onCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
/**
 * Triggers when something combusts in the world.
 * 
 * @param event
 *            The event being fired.
 * @author HomieDion
 * @since 1.1.0
 */
@EventHandler(ignoreCancelled = true)
public void onCombust(final EntityCombustEvent event) {
	// Ignore if this is caused by an event lower down the chain.
	if (event instanceof EntityCombustByEntityEvent || event instanceof EntityCombustByBlockEvent) {
		return;
	}

	// Variables
	final EntityType type = event.getEntityType();
	final World world = event.getEntity().getWorld();

	// Ignore world's without sunlight
	if (world.getEnvironment() != Environment.NORMAL) {
		return;
	}

	// Ignore disabled worlds
	if (settings.isDisabledWorld(world)) {
		return;
	}

	// Ignore someone without sunscreen
	if (!settings.hasSunscreen(type)) {
		return;
	}

	// Prevent the target from burning.
	event.setCancelled(true);
}
 
开发者ID:homiedion,项目名称:Sunscreen,代码行数:38,代码来源:CombustionListener.java

示例3: onBurn

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onBurn(EntityCombustEvent e) {
	if (e.getEntityType() == EntityType.ZOMBIE) {
		long time = e.getEntity().getWorld().getTime();
		if (e.getEntity().getLocation().getBlock().getLightFromSky() == 15 && time > 0 && time < 12000) {
			e.getEntity().setFireTicks(0);
			e.setDuration(0);
			e.setCancelled(true);
		}
	}
}
 
开发者ID:kadeska,项目名称:MT_Core,代码行数:12,代码来源:MobListener.java

示例4: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onEntityCombust(EntityCombustEvent event) {
    World world = event.getEntity().getWorld();
    EntityType type = event.getEntityType();

    if (type == EntityType.ZOMBIE || type == EntityType.SKELETON) {
        if (plugin.isActive(world) && plugin.isFeatureEnabled(world, Feature.DAYLIGHT_PROOF_MOBS)) {
            event.setCancelled(true);
        }
    }

}
 
开发者ID:Samistine,项目名称:BloodMoon,代码行数:13,代码来源:DaylightProofMobsListener.java


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