本文整理汇总了Java中org.bukkit.event.block.BlockIgniteEvent.IgniteCause.LAVA属性的典型用法代码示例。如果您正苦于以下问题:Java IgniteCause.LAVA属性的具体用法?Java IgniteCause.LAVA怎么用?Java IgniteCause.LAVA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.event.block.BlockIgniteEvent.IgniteCause
的用法示例。
在下文中一共展示了IgniteCause.LAVA属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: callBlockIgniteEvent
public static BlockIgniteEvent callBlockIgniteEvent(net.minecraft.world.World world, int x, int y, int z, int igniterX, int igniterY, int igniterZ) {
org.bukkit.World bukkitWorld = world.getWorld();
Block igniter = bukkitWorld.getBlockAt(igniterX, igniterY, igniterZ);
IgniteCause cause;
switch (igniter.getType()) {
case LAVA:
case STATIONARY_LAVA:
cause = IgniteCause.LAVA;
break;
case DISPENSER:
cause = IgniteCause.FLINT_AND_STEEL;
break;
case FIRE: // Fire or any other unknown block counts as SPREAD.
default:
cause = IgniteCause.SPREAD;
}
BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, igniter);
world.getServer().getPluginManager().callEvent(event);
return event;
}
示例2: callBlockIgniteEvent
public static BlockIgniteEvent callBlockIgniteEvent(World world, int x, int y, int z, int igniterX, int igniterY, int igniterZ) {
org.bukkit.World bukkitWorld = world.getWorld();
Block igniter = bukkitWorld.getBlockAt(igniterX, igniterY, igniterZ);
IgniteCause cause;
switch (igniter.getType()) {
case LAVA:
case STATIONARY_LAVA:
cause = IgniteCause.LAVA;
break;
case DISPENSER:
cause = IgniteCause.FLINT_AND_STEEL;
break;
case FIRE: // Fire or any other unknown block counts as SPREAD.
default:
cause = IgniteCause.SPREAD;
}
BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, igniter);
world.getServer().getPluginManager().callEvent(event);
return event;
}
示例3: onBlockIgnite
@EventHandler(ignoreCancelled = false)
public void onBlockIgnite(cn.nukkit.event.block.BlockIgniteEvent event) {
if (canIgnore(BlockIgniteEvent.getHandlerList())) {
return;
}
cn.nukkit.block.Block ignited = event.getBlock();
IgniteCause cause = IgniteCause.FLINT_AND_STEEL;
switch (event.getCause()) {
case EXPLOSION:
cause = IgniteCause.EXPLOSION;
break;
case FIREBALL:
cause = IgniteCause.FIREBALL;
break;
case FLINT_AND_STEEL:
cause = IgniteCause.FLINT_AND_STEEL;
break;
case LAVA:
cause = IgniteCause.LAVA;
break;
case LIGHTNING:
cause = IgniteCause.LIGHTNING;
break;
case SPREAD:
cause = IgniteCause.SPREAD;
break;
default:
cause = IgniteCause.FLINT_AND_STEEL; // Default to Flint and Steel
break;
}
BlockIgniteEvent bukkitEvent = new BlockIgniteEvent(PokkitBlock.toBukkit(ignited), cause, PokkitEntity.toBukkit(event.getEntity()));
callCancellable(event, bukkitEvent);
}
示例4: onBlockIgnite
/**
* On block ignite.
*
* @param event the event
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockIgnite(BlockIgniteEvent event) {
IDummyLand land = Factoid.getThisPlugin().iLands().getLandOrOutsideArea(event.getBlock().getLocation());
if (((event.getCause() == IgniteCause.SPREAD || event.getCause() == IgniteCause.LAVA)
&& land.getFlagAndInherit(FlagList.FIRESPREAD.getFlagType()).getValueBoolean() == false)
|| land.getFlagAndInherit(FlagList.FIRE.getFlagType()).getValueBoolean() == false) {
event.setCancelled(true);
}
}