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


Java EntityCombustEvent.setCancelled方法代码示例

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


在下文中一共展示了EntityCombustEvent.setCancelled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
public void onEntityCombust(EntityCombustEvent e) {
	if (e.getEntity() instanceof Player) {
		if (this.playerManager.isFrozen(e.getEntity().getUniqueId())) {
			if (!this.plugin.getConfig().getBoolean("fire-damage")) {
				e.setCancelled(true);
			}
		}
	}
}
 
开发者ID:7rory768,项目名称:SimpleFreeze,代码行数:11,代码来源:EntityCombustListener.java

示例5: 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

示例6: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST)
public void onEntityCombust(EntityCombustEvent event) {
	if ((event.getEntity() instanceof Zombie))
		// Only apply if the zombie is in an arena world
		if (this.am.isInGame((Zombie) event.getEntity())) {
			event.setCancelled(true);
	}
}
 
开发者ID:odarriba,项目名称:defend-the-village,代码行数:9,代码来源:Main.java

示例7: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void onEntityCombust(EntityCombustEvent event) {
	if (event.getEntity() instanceof LivingEntity) {
		if (MobLib.isMobLibEntity((LivingEntity) event.getEntity())) {
			event.setCancelled(true);
		}
	}
}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:9,代码来源:MobLibListener.java

示例8: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombust(EntityCombustEvent event) {
    event.getEntity().setFireTicks(0);
    event.setCancelled(true);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:6,代码来源:EnvironmentManager.java

示例9: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombust(EntityCombustEvent event) {
	event.setCancelled(true);
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:5,代码来源:Events.java

示例10: onEntityCombustEvent

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombustEvent(EntityCombustEvent event) {
   if (event.getDuration() == 8 && !(event.getEntity() instanceof Player)) {
      event.setCancelled(true);
   }
}
 
开发者ID:PaulBGD,项目名称:MiniMiniGames,代码行数:7,代码来源:WorldListener.java

示例11: onEntityCombust

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombust(EntityCombustEvent event){
    if(event.getEntity() instanceof Zombie){
        event.setCancelled(true);
    }
}
 
开发者ID:GaryQian,项目名称:League,代码行数:7,代码来源:GeneralListeners.java


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