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


Java EntityCombustEvent.isCancelled方法代码示例

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


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

示例1: a

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void a(EntityLiving entityliving, float f) {
//        EntityArrow entityarrow = new EntityArrow(this.world, this, entityliving, 1.6F, (float)(14 - this.world.getDifficulty().a() * 4));
        EntityArrow entityarrow = new EntityArrow(this.world, this, entityliving, 1.6F, 0);
        int i = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, this.bz());
        int j = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, this.bz());
        entityarrow.b((double)(f * 2.0F) + this.random.nextGaussian() * 0.25D + (double)((float)this.world.getDifficulty().a() * 0.11F));
        if(i > 0) {
            entityarrow.b(entityarrow.j() + (double)i * 0.5D + 0.5D);
        }

        if(j > 0) {
            entityarrow.setKnockbackStrength(j);
        }

        if(EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.bz()) > 0 || this.getSkeletonType() == 1) {
            EntityCombustEvent event = new EntityCombustEvent(entityarrow.getBukkitEntity(), 100);
            this.world.getServer().getPluginManager().callEvent(event);
            if(!event.isCancelled()) {
                entityarrow.setOnFire(event.getDuration());
            }
        }

        EntityShootBowEvent event1 = CraftEventFactory.callEntityShootBowEvent(this, this.bz(), entityarrow, 0.8F);
        if(event1.isCancelled()) {
            event1.getProjectile().remove();
        } else {
            if(event1.getProjectile() == entityarrow.getBukkitEntity()) {
                this.world.addEntity(entityarrow);
            }

            this.makeSound("random.bow", 1.0F, 1.0F / (this.bb().nextFloat() * 0.4F + 0.8F));
        }
    }
 
开发者ID:Eluinhost,项目名称:UberHardcore,代码行数:34,代码来源:CustomSkeleton.java

示例2: a

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void a(EntityLiving entityliving, float f) {
//        EntityArrow entityarrow = new EntityArrow(this.world, this, entityliving, 1.6F, (float)(14 - this.world.getDifficulty().a() * 4));
        EntityArrow entityarrow = new EntityArrow(this.world, this, entityliving, 1.6F, 0);
        int i = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_DAMAGE.id, this.bA());
        int j = EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK.id, this.bA());
        entityarrow.b((double)(f * 2.0F) + this.random.nextGaussian() * 0.25D + (double)((float)this.world.getDifficulty().a() * 0.11F));
        if(i > 0) {
            entityarrow.b(entityarrow.j() + (double)i * 0.5D + 0.5D);
        }

        if(j > 0) {
            entityarrow.setKnockbackStrength(j);
        }

        if(EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.bA()) > 0 || this.getSkeletonType() == 1) {
            EntityCombustEvent event = new EntityCombustEvent(entityarrow.getBukkitEntity(), 100);
            this.world.getServer().getPluginManager().callEvent(event);
            if(!event.isCancelled()) {
                entityarrow.setOnFire(event.getDuration());
            }
        }

        EntityShootBowEvent event1 = CraftEventFactory.callEntityShootBowEvent(this, this.bA(), entityarrow, 0.8F);
        if(event1.isCancelled()) {
            event1.getProjectile().remove();
        } else {
            if(event1.getProjectile() == entityarrow.getBukkitEntity()) {
                this.world.addEntity(entityarrow);
            }

            this.makeSound("random.bow", 1.0F, 1.0F / (this.bc().nextFloat() * 0.4F + 0.8F));
        }
    }
 
开发者ID:Eluinhost,项目名称:UberHardcore,代码行数:34,代码来源:CustomSkeleton.java

示例3: e

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void e() {
    if (this.world.w() && !this.world.isStatic) {
        float f = this.d(1.0F);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.i(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(4);

            if (itemstack != null) {
                if (itemstack.g()) {
                    itemstack.setData(itemstack.j() + this.random.nextInt(2));
                    if (itemstack.j() >= itemstack.l()) {
                        this.a(itemstack);
                        this.setEquipment(4, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    if (this.world.isStatic && this.getSkeletonType() == 1) {
        this.a(0.72F, 2.34F);
    }

    super.e();
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:40,代码来源:EntitySkeleton.java

示例4: E

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
protected void E() {
    if (!this.fireProof) {
        this.damageEntity(DamageSource.LAVA, 4);

        // CraftBukkit start - Fallen in lava TODO: this event spams!
        if (this instanceof EntityLiving) {
            if (this.fireTicks <= 0) {
                // not on fire yet
                // TODO: shouldn't be sending null for the block.
                org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
                org.bukkit.entity.Entity damagee = this.getBukkitEntity();
                EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15);
                this.world.getServer().getPluginManager().callEvent(combustEvent);

                if (!combustEvent.isCancelled()) {
                    this.setOnFire(combustEvent.getDuration());
                }
            } else {
                // This will be called every single tick the entity is in lava, so don't throw an event
                this.setOnFire(15);
            }
            return;
        }
        // CraftBukkit end - we also don't throw an event unless the object in lava is living, to save on some event calls

        this.setOnFire(15);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:29,代码来源:Entity.java

示例5: e

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void e() {
    if (this.world.w() && !this.world.isStatic && !this.isBaby()) {
        float f = this.d(1.0F);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.i(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(4);

            if (itemstack != null) {
                if (itemstack.g()) {
                    itemstack.setData(itemstack.j() + this.random.nextInt(2));
                    if (itemstack.j() >= itemstack.l()) {
                        this.a(itemstack);
                        this.setEquipment(4, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    if (this.am() && this.getGoalTarget() != null && this.vehicle instanceof EntityChicken) {
        ((EntityInsentient) this.vehicle).getNavigation().a(this.getNavigation().e(), 1.5D);
    }

    super.e();
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:40,代码来源:EntityZombie.java

示例6: c

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void c() {
    if (this.world.v() && !this.world.isStatic) {
        float f = this.d(1.0F);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.l(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(4);

            if (itemstack != null) {
                if (itemstack.g()) {
                    itemstack.setData(itemstack.j() + this.random.nextInt(2));
                    if (itemstack.j() >= itemstack.l()) {
                        this.a(itemstack);
                        this.setEquipment(4, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    if (this.world.isStatic && this.getSkeletonType() == 1) {
        this.a(0.72F, 2.34F);
    }

    super.c();
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:40,代码来源:EntitySkeleton.java

示例7: A

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
protected void A() {
    if (!this.fireProof) {
        // CraftBukkit start - Fallen in lava TODO: this event spams!
        if (this instanceof EntityLiving) {
            Server server = this.world.getServer();

            // TODO: shouldn't be sending null for the block.
            org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
            org.bukkit.entity.Entity damagee = this.getBukkitEntity();

            EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.LAVA, 4D);
            server.getPluginManager().callEvent(event);

            if (!event.isCancelled()) {
                damagee.setLastDamageCause(event);
                this.damageEntity(DamageSource.LAVA, (float) event.getDamage());
            }

            if (this.fireTicks <= 0) {
                // not on fire yet
                EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15);
                server.getPluginManager().callEvent(combustEvent);

                if (!combustEvent.isCancelled()) {
                    this.setOnFire(combustEvent.getDuration());
                }
            } else {
                // This will be called every single tick the entity is in lava, so don't throw an event
                this.setOnFire(15);
            }
            return;
        }
        // CraftBukkit end - we also don't throw an event unless the object in lava is living, to save on some event calls

        this.damageEntity(DamageSource.LAVA, 4);
        this.setOnFire(15);
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:39,代码来源:Entity.java

示例8: c

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void c() {
    if (this.world.v() && !this.world.isStatic && !this.isBaby()) {
        float f = this.d(1.0F);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.l(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(4);

            if (itemstack != null) {
                if (itemstack.g()) {
                    itemstack.setData(itemstack.j() + this.random.nextInt(2));
                    if (itemstack.j() >= itemstack.l()) {
                        this.a(itemstack);
                        this.setEquipment(4, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    super.c();
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:36,代码来源:EntityZombie.java

示例9: setOnFireFromLava

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
protected void setOnFireFromLava()
{
    if (!this.isImmuneToFire)
    {
        // CraftBukkit start - Fallen in lava TODO: this event spams!
        this.attackEntityFrom(DamageSource.lava, 4);

        if (this instanceof EntityLivingBase)
        {
            if (this.fire <= 0)
            {
                // not on fire yet
                // TODO: shouldn't be sending null for the block.
                org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
                org.bukkit.entity.Entity damagee = this.getBukkitEntity();
                EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15);
                this.worldObj.getServer().getPluginManager().callEvent(combustEvent);

                if (!combustEvent.isCancelled())
                {
                    this.setFire(combustEvent.getDuration());
                }
            }
            else
            {
                // This will be called every single tick the entity is in lava, so don't throw an event
                this.setFire(15);
            }

            return;
        }

        // CraftBukkit end - we also don't throw an event unless the object in lava is living, to save on some event calls
        this.setFire(15);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:37,代码来源:Entity.java

示例10: n

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void n() {
    if (this.world.B() && !this.world.isClientSide) {
        float f = this.e(1.0F);
        BlockPosition blockposition = this.bz() instanceof EntityBoat ? (new BlockPosition(this.locX, (double) Math.round(this.locY), this.locZ)).up() : new BlockPosition(this.locX, (double) Math.round(this.locY), this.locZ);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.h(blockposition)) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);

            if (itemstack != null) {
                if (itemstack.e()) {
                    itemstack.setData(itemstack.h() + this.random.nextInt(2));
                    if (itemstack.h() >= itemstack.j()) {
                        this.b(itemstack);
                        this.setSlot(EnumItemSlot.HEAD, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    if (this.world.isClientSide) {
        this.b(this.getSkeletonType());
    }

    super.n();
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:41,代码来源:EntitySkeleton.java

示例11: burnFromLava

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
protected void burnFromLava() {
    if (!this.fireProof) {
        this.damageEntity(DamageSource.LAVA, 4.0F);

        // CraftBukkit start - Fallen in lava TODO: this event spams!
        if (this instanceof EntityLiving) {
            if (fireTicks <= 0) {
                // not on fire yet
                // TODO: shouldn't be sending null for the block
                org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
                org.bukkit.entity.Entity damagee = this.getBukkitEntity();
                EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15);
                this.world.getServer().getPluginManager().callEvent(combustEvent);

                if (!combustEvent.isCancelled()) {
                    this.setOnFire(combustEvent.getDuration());
                }
            } else {
                // This will be called every single tick the entity is in lava, so don't throw an event
                this.setOnFire(15);
            }
            return;
        }
        // CraftBukkit end - we also don't throw an event unless the object in lava is living, to save on some event calls
        this.setOnFire(15);
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:28,代码来源:Entity.java

示例12: n

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void n() {
    if (this.world.B() && !this.world.isClientSide && !this.isBaby()) {
        float f = this.e(1.0F);
        BlockPosition blockposition = this.bz() instanceof EntityBoat ? (new BlockPosition(this.locX, (double) Math.round(this.locY), this.locZ)).up() : new BlockPosition(this.locX, (double) Math.round(this.locY), this.locZ);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.h(blockposition)) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);

            if (itemstack != null) {
                if (itemstack.e()) {
                    itemstack.setData(itemstack.h() + this.random.nextInt(2));
                    if (itemstack.h() >= itemstack.j()) {
                        this.b(itemstack);
                        this.setSlot(EnumItemSlot.HEAD, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    super.n();
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:37,代码来源:EntityZombie.java

示例13: c

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void c() {
    if (this.world.u() && !this.world.isStatic) {
        float f = this.c(1.0F);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.l(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(4);

            if (itemstack != null) {
                if (itemstack.g()) {
                    itemstack.setData(itemstack.j() + this.random.nextInt(2));
                    if (itemstack.j() >= itemstack.l()) {
                        this.a(itemstack);
                        this.setEquipment(4, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
            EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
            this.world.getServer().getPluginManager().callEvent(event);

            if (!event.isCancelled()) {
                this.setOnFire(event.getDuration());
            }
            // CraftBukkit end
            }
        }
    }

    if (this.world.isStatic && this.getSkeletonType() == 1) {
        this.a(0.72F, 2.34F);
    }

    super.c();
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:40,代码来源:EntitySkeleton.java

示例14: z

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
protected void z() {
    if (!this.fireProof) {
        // CraftBukkit start - Fallen in lava TODO: this event spams!
        if (this instanceof EntityLiving) {
            Server server = this.world.getServer();

            // TODO: shouldn't be sending null for the block.
            org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
            org.bukkit.entity.Entity damagee = this.getBukkitEntity();

            EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.LAVA, 4);
            server.getPluginManager().callEvent(event);

            if (!event.isCancelled()) {
                damagee.setLastDamageCause(event);
                this.damageEntity(DamageSource.LAVA, event.getDamage());
            }

            if (this.fireTicks <= 0) {
                // not on fire yet
                EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15);
                server.getPluginManager().callEvent(combustEvent);

                if (!combustEvent.isCancelled()) {
                    this.setOnFire(combustEvent.getDuration());
                }
            } else {
                // This will be called every single tick the entity is in lava, so don't throw an event
                this.setOnFire(15);
            }
            return;
        }
        // CraftBukkit end - we also don't throw an event unless the object in lava is living, to save on some event calls

        this.damageEntity(DamageSource.LAVA, 4);
        this.setOnFire(15);
    }
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:39,代码来源:Entity.java

示例15: c

import org.bukkit.event.entity.EntityCombustEvent; //导入方法依赖的package包/类
public void c() {
    if (this.world.u() && !this.world.isStatic && !this.isBaby()) {
        float f = this.c(1.0F);

        if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.l(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ))) {
            boolean flag = true;
            ItemStack itemstack = this.getEquipment(4);

            if (itemstack != null) {
                if (itemstack.g()) {
                    itemstack.setData(itemstack.j() + this.random.nextInt(2));
                    if (itemstack.j() >= itemstack.l()) {
                        this.a(itemstack);
                        this.setEquipment(4, (ItemStack) null);
                    }
                }

                flag = false;
            }

            if (flag) {
                // CraftBukkit start
                EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
                this.world.getServer().getPluginManager().callEvent(event);

                if (!event.isCancelled()) {
                    this.setOnFire(event.getDuration());
                }
                // CraftBukkit end
            }
        }
    }

    super.c();
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:36,代码来源:EntityZombie.java


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