本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}