下面列出了org.bukkit.event.block.BlockIgniteEvent.IgniteCause#LAVA 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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;
}
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;
}