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


Java SlimeSplitEvent.isCancelled方法代码示例

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


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

示例1: die

import org.bukkit.event.entity.SlimeSplitEvent; //导入方法依赖的package包/类
public void die() {
    int i = this.getSize();

    if (!this.world.isStatic && i > 1 && this.getHealth() <= 0.0F) {
        int j = 2 + this.random.nextInt(3);

        // CraftBukkit start
        SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
        this.world.getServer().getPluginManager().callEvent(event);

        if (!event.isCancelled() && event.getCount() > 0) {
            j = event.getCount();
        } else {
            super.die();
            return;
        }
        // CraftBukkit end

        for (int k = 0; k < j; ++k) {
            float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
            float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
            EntitySlime entityslime = this.bQ();

            entityslime.setSize(i / 2);
            entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
            this.world.addEntity(entityslime, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
        }
    }

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

示例2: die

import org.bukkit.event.entity.SlimeSplitEvent; //导入方法依赖的package包/类
public void die() {
    int i = this.getSize();

    if (!this.world.isStatic && i > 1 && this.getHealth() <= 0.0F) {
        int j = 2 + this.random.nextInt(3);

        // CraftBukkit start
        SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
        this.world.getServer().getPluginManager().callEvent(event);

        if (!event.isCancelled() && event.getCount() > 0) {
            j = event.getCount();
        } else {
            super.die();
            return;
        }
        // CraftBukkit end

        for (int k = 0; k < j; ++k) {
            float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
            float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
            EntitySlime entityslime = this.bK();

            entityslime.setSize(i / 2);
            entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
            this.world.addEntity(entityslime, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
        }
    }

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

示例3: setDead

import org.bukkit.event.entity.SlimeSplitEvent; //导入方法依赖的package包/类
public void setDead()
{
    int i = this.getSlimeSize();

    if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0.0F)
    {
        int j = 2 + this.rand.nextInt(3);
        // CraftBukkit start
        SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
        this.worldObj.getServer().getPluginManager().callEvent(event);

        if (!event.isCancelled() && event.getCount() > 0)
        {
            j = event.getCount();
        }
        else
        {
            super.setDead();
            return;
        }

        // CraftBukkit end

        for (int k = 0; k < j; ++k)
        {
            float f = ((float)(k % 2) - 0.5F) * (float)i / 4.0F;
            float f1 = ((float)(k / 2) - 0.5F) * (float)i / 4.0F;
            EntitySlime entityslime = this.createInstance();
            entityslime.setSlimeSize(i / 2);
            entityslime.setLocationAndAngles(this.posX + (double)f, this.posY + 0.5D, this.posZ + (double)f1, this.rand.nextFloat() * 360.0F, 0.0F);
            this.worldObj.addEntity(entityslime, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
        }
    }

    super.setDead();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:37,代码来源:EntitySlime.java

示例4: die

import org.bukkit.event.entity.SlimeSplitEvent; //导入方法依赖的package包/类
public void die() {
    int i = this.getSize();

    if (!this.world.isClientSide && i > 1 && this.getHealth() <= 0.0F) {
        int j = 2 + this.random.nextInt(3);

        // CraftBukkit start
        SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
        this.world.getServer().getPluginManager().callEvent(event);

        if (!event.isCancelled() && event.getCount() > 0) {
            j = event.getCount();
        } else {
            super.die();
            return;
        }
        // CraftBukkit end

        for (int k = 0; k < j; ++k) {
            float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
            float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
            EntitySlime entityslime = this.cU();

            if (this.hasCustomName()) {
                entityslime.setCustomName(this.getCustomName());
            }

            if (this.isPersistent()) {
                entityslime.cM();
            }

            entityslime.setSize(i / 2);
            entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
            this.world.addEntity(entityslime, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
        }
    }

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

示例5: die

import org.bukkit.event.entity.SlimeSplitEvent; //导入方法依赖的package包/类
public void die() {
    int i = this.getSize();

    if (!this.world.isStatic && i > 1 && this.getHealth() <= 0) {
        int j = 2 + this.random.nextInt(3);

        // CraftBukkit start
        SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
        this.world.getServer().getPluginManager().callEvent(event);

        if (!event.isCancelled() && event.getCount() > 0) {
            j = event.getCount();
        } else {
            super.die();
            return;
        }
        // CraftBukkit end

        for (int k = 0; k < j; ++k) {
            float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
            float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
            EntitySlime entityslime = this.i();

            entityslime.setSize(i / 2);
            entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
            this.world.addEntity(entityslime, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
        }
    }

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


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