當前位置: 首頁>>代碼示例>>Java>>正文


Java BlockBurnEvent.isCancelled方法代碼示例

本文整理匯總了Java中org.bukkit.event.block.BlockBurnEvent.isCancelled方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockBurnEvent.isCancelled方法的具體用法?Java BlockBurnEvent.isCancelled怎麽用?Java BlockBurnEvent.isCancelled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.event.block.BlockBurnEvent的用法示例。


在下文中一共展示了BlockBurnEvent.isCancelled方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler
  public void onBlockBurn(BlockBurnEvent e){
  	RedProtect.get().logger.debug("RPBlockListener - Is BlockBurnEvent event");
  	if (e.isCancelled()){
  		return;
  	}
  	
  	Block b = e.getBlock();

  	Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
  	if (r != null && !r.canFire()){
	e.setCancelled(true);
  		return;
}
  	
  	if (!cont.canWorldBreak(b)){
  		e.setCancelled(true);
}
  }
 
開發者ID:FabioZumbi12,項目名稱:RedProtect,代碼行數:20,代碼來源:RPBlockListener.java

示例2: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGH)
public void onBlockBurn(final BlockBurnEvent event) {
	if (event.isCancelled())
		return;

	final Block block = event.getBlock();

	// Ok so a frame block is burning
	// Find the nearest gate!
	final WorldCoord blockCoord = new WorldCoord(block);
	final Gate nearestGate = Gates.gateFromFrameAndSurround(blockCoord);

	if (nearestGate != null) {
		event.setCancelled(true);
	}
}
 
開發者ID:NoChanceSD,項目名稱:AncientGates,代碼行數:17,代碼來源:PluginBlockListener.java

示例3: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler
  public void onBlockBurn(BlockBurnEvent e){
  	if (e.isCancelled()){
  		return;
  	}
  	Block b = e.getBlock();
  	Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
  	if (r != null){
  		return;
  	}
  	
if (!RPConfig.getGlobalFlagBool(b.getWorld().getName()+".fire-block-damage")){
	e.setCancelled(true);
}
  }
 
開發者ID:FabioZumbi12,項目名稱:RedProtect,代碼行數:16,代碼來源:RPGlobalListener.java

示例4: a

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
private void a(World world, int i, int j, int k, int l, Random random, int i1) {
    int j1 = this.b[Block.getId(world.getType(i, j, k))];

    if (random.nextInt(l) < j1) {
        boolean flag = world.getType(i, j, k) == Blocks.TNT;

        // CraftBukkit start
        org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k);

        BlockBurnEvent event = new BlockBurnEvent(theBlock);
        world.getServer().getPluginManager().callEvent(event);

        if (event.isCancelled()) {
            return;
        }
        // CraftBukkit end

        if (random.nextInt(i1 + 10) < 5 && !world.isRainingAt(i, j, k)) {
            int k1 = i1 + random.nextInt(5) / 4;

            if (k1 > 15) {
                k1 = 15;
            }

            world.setTypeAndData(i, j, k, this, k1, 3);
        } else {
            world.setAir(i, j, k);
        }

        if (flag) {
            Blocks.TNT.postBreak(world, i, j, k, 1);
        }
    }
}
 
開發者ID:OvercastNetwork,項目名稱:CraftBukkit,代碼行數:35,代碼來源:BlockFire.java

示例5: a

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
private void a(World world, int i, int j, int k, int l, Random random, int i1) {
    int j1 = this.b[world.getTypeId(i, j, k)];

    if (random.nextInt(l) < j1) {
        boolean flag = world.getTypeId(i, j, k) == Block.TNT.id;

        // CraftBukkit start
        org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k);

        BlockBurnEvent event = new BlockBurnEvent(theBlock);
        world.getServer().getPluginManager().callEvent(event);

        if (event.isCancelled()) {
            return;
        }
        // CraftBukkit end

        if (random.nextInt(i1 + 10) < 5 && !world.isRainingAt(i, j, k)) {
            int k1 = i1 + random.nextInt(5) / 4;

            if (k1 > 15) {
                k1 = 15;
            }

            world.setTypeIdAndData(i, j, k, this.id, k1, 3);
        } else {
            world.setAir(i, j, k);
        }

        if (flag) {
            Block.TNT.postBreak(world, i, j, k, 1);
        }
    }
}
 
開發者ID:AlmuraDev,項目名稱:Almura-Server,代碼行數:35,代碼來源:BlockFire.java

示例6: a

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
private void a(World world, BlockPosition blockposition, int i, Random random, int j) {
    int k = this.c(world.getType(blockposition).getBlock());

    if (random.nextInt(i) < k) {
        IBlockData iblockdata = world.getType(blockposition);

        // CraftBukkit start
        org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());

        BlockBurnEvent event = new BlockBurnEvent(theBlock);
        world.getServer().getPluginManager().callEvent(event);

        if (event.isCancelled()) {
            return;
        }
        // CraftBukkit end

        if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
            int l = j + random.nextInt(5) / 4;

            if (l > 15) {
                l = 15;
            }

            world.setTypeAndData(blockposition, this.getBlockData().set(BlockFire.AGE, Integer.valueOf(l)), 3);
        } else {
            fireExtinguished(world, blockposition); // CraftBukkit
        }

        if (iblockdata.getBlock() == Blocks.TNT) {
            Blocks.TNT.postBreak(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true)));
        }
    }

}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:36,代碼來源:BlockFire.java

示例7: a

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
private void a(World world, int i, int j, int k, int l, Random random, int i1) {
    int j1 = this.b[world.getTypeId(i, j, k)];

    if (random.nextInt(l) < j1) {
        boolean flag = world.getTypeId(i, j, k) == Block.TNT.id;

        // CraftBukkit start
        org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(i, j, k);

        BlockBurnEvent event = new BlockBurnEvent(theBlock);
        world.getServer().getPluginManager().callEvent(event);

        if (event.isCancelled()) {
            return;
        }
        // CraftBukkit end

        if (random.nextInt(i1 + 10) < 5 && !world.F(i, j, k)) {
            int k1 = i1 + random.nextInt(5) / 4;

            if (k1 > 15) {
                k1 = 15;
            }

            world.setTypeIdAndData(i, j, k, this.id, k1, 3);
        } else {
            world.setAir(i, j, k);
        }

        if (flag) {
            Block.TNT.postBreak(world, i, j, k, 1);
        }
    }
}
 
開發者ID:didoupimpon,項目名稱:Craft-city,代碼行數:35,代碼來源:BlockFire.java

示例8: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockBurn(BlockBurnEvent event) {
	if(!event.isCancelled()) {
		logChunk(event.getBlock().getLocation());
	}
}
 
開發者ID:maker56,項目名稱:UltimateSurvivalGames,代碼行數:7,代碼來源:ResetListener.java

示例9: tryCatchFire

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face)
{
    int j1 = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face);

    if (p_149841_6_.nextInt(p_149841_5_) < j1)
    {
        boolean flag = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt;
        // CraftBukkit start
        org.bukkit.block.Block theBlock = p_149841_1_.getWorld().getBlockAt(p_149841_2_, p_149841_3_, p_149841_4_);
        BlockBurnEvent event = new BlockBurnEvent(theBlock);
        p_149841_1_.getServer().getPluginManager().callEvent(event);

        if (event.isCancelled())
        {
            return;
        }

        // CraftBukkit end

        if (p_149841_6_.nextInt(p_149841_7_ + 10) < 5 && !p_149841_1_.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_))
        {
            int k1 = p_149841_7_ + p_149841_6_.nextInt(5) / 4;

            if (k1 > 15)
            {
                k1 = 15;
            }

            p_149841_1_.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, k1, 3);
        }
        else
        {
            p_149841_1_.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_);
        }

        if (flag)
        {
            Blocks.tnt.onBlockDestroyedByPlayer(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, 1);
        }
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:42,代碼來源:BlockFire.java


注:本文中的org.bukkit.event.block.BlockBurnEvent.isCancelled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。