本文整理汇总了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);
}
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
}
示例8: onEntityCombust
import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombust(EntityCombustEvent event) {
event.getEntity().setFireTicks(0);
event.setCancelled(true);
}
示例9: onEntityCombust
import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombust(EntityCombustEvent event) {
event.setCancelled(true);
}
示例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);
}
}
示例11: onEntityCombust
import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityCombust(EntityCombustEvent event){
if(event.getEntity() instanceof Zombie){
event.setCancelled(true);
}
}