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


Java BlockBurnEvent.setCancelled方法代碼示例

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


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

示例1: onBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGH)
public void onBurn(BlockBurnEvent bbe) {
  Block block = bbe.getBlock();
  if (block == null) {
    return;
  }

  Game game = BedwarsRel.getInstance().getGameManager().getGameByLocation(block.getLocation());
  if (game == null) {
    return;
  }

  if (game.getState() == GameState.STOPPED) {
    return;
  }

  bbe.setCancelled(true);
}
 
開發者ID:BedwarsRel,項目名稱:BedwarsRel,代碼行數:19,代碼來源:BlockListener.java

示例2: 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

示例3: 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

示例4: onBlockBurnEvent

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOW)
public void onBlockBurnEvent(BlockBurnEvent event) {
	bcoord.setFromLocation(event.getBlock().getLocation());

	StructureBlock sb = CivGlobal.getStructureBlock(bcoord);
	if (sb != null) {
		event.setCancelled(true);
		return;
	}

	RoadBlock rb = CivGlobal.getRoadBlock(bcoord);
	if (rb != null) {
		event.setCancelled(true);
		return;
	}

	CampBlock cb = CivGlobal.getCampBlock(bcoord);
	if (cb != null) {
		event.setCancelled(true);
		return;
	}
}
 
開發者ID:netizen539,項目名稱:civcraft,代碼行數:23,代碼來源:BlockListener.java

示例5: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockBurn(BlockBurnEvent event) {
    Block b = event.getBlock();
    Location location = BukkitUtil.getLocation(b.getLocation());

    PlotArea area = location.getPlotArea();
    if (area == null) {
        return;
    }

    Plot plot = location.getOwnedPlot();
    if (plot == null || !plot.getFlag(Flags.BLOCK_BURN, false)) {
        event.setCancelled(true);
        return;
    }

}
 
開發者ID:IntellectualSites,項目名稱:PlotSquared,代碼行數:18,代碼來源:PlayerEvents.java

示例6: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockBurn(final BlockBurnEvent event) {
    final Location location = event.getBlock().getLocation();

    if (!reinforcementManager.isWorldActive(location.getWorld().getName())) {
        return;
    }

    // If the block is not reinforced, it is allowed to burn normally.
    if (!reinforcementManager.isReinforced(location)) {
        return;
    }

    // If the block is reinforced, the burn event is cancelled for the block.
    event.setCancelled(true);

    // The block reinforcement is then damaged.
    reinforcementManager.damageBlock(location, null, BlockSaverDamageCause.FIRE);
}
 
開發者ID:MinerAp,項目名稱:block-saver,代碼行數:20,代碼來源:GeneralListener.java

示例7: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockBurn(BlockBurnEvent event) {
    if (region.contains(event.getBlock().getLocation())) {
        if (materials == null || materials.contains(event.getBlock().getType())) {
            event.setCancelled(true);
        }
    }
}
 
開發者ID:WarzoneMC,項目名稱:Warzone,代碼行數:9,代碼來源:Monument.java

示例8: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
/**
 * Prevents fire spread
 * @param e
 */
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockBurn(BlockBurnEvent e) {
    if (DEBUG) {
        plugin.getLogger().info(e.getEventName());
    }
    if (!Util.inWorld(e.getBlock())) {
        //plugin.getLogger().info("DEBUG: Not in world");
        return;
    }
    if (actionAllowed(e.getBlock().getLocation(), SettingsFlag.FIRE_SPREAD)) {
        return;
    }
    e.setCancelled(true);
}
 
開發者ID:tastybento,項目名稱:bskyblock,代碼行數:19,代碼來源:IslandGuard.java

示例9: BlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler
public void BlockBurn(BlockBurnEvent e) {
	if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Burn-block.Enable")) {
		if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Burn-block.World.All_World")) {
			if (WorldUtils.getWBB().contains(e.getBlock().getWorld().getName())) {
				e.setCancelled(true);
			}
		} else {
			e.setCancelled(true);
		}
    }
}
 
開發者ID:DianoxDragon,項目名稱:UltimateSpawn,代碼行數:13,代碼來源:BasicFeatures.java

示例10: 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

示例11: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockBurn(BlockBurnEvent e) {
	boolean cancelled = false;
	String w = e.getBlock().getWorld().getName();
	for (String p : worlds.keySet()) {
		for (int i = 0; i < worlds.get(p).size(); i++) {
			if (worlds.get(p).get(i).equals(w)) {
				if (!Minigame.getMinigameInstance(p).getConfigManager().isBlockBurnAllowed()) {
					e.setCancelled(true);
					cancelled = true;
					break;
				}
			}
		}
	}
	if (cancelled) {
		return;
	}
	Block adjBlock = MGUtil.getAttachedSign(e.getBlock());
	if (adjBlock != null) {
		for (Minigame mg : Minigame.getMinigameInstances()) {
			for (LobbySign l : mg.getLobbyManager().signs.values()) {
				if (l.getX() == adjBlock.getX() && l.getY() == adjBlock.getY() && l.getZ() == adjBlock.getZ() &&
						l.getWorld().equals(adjBlock.getWorld().getName())) {
					e.setCancelled(true);
					break;
				}
			}
		}
	}
}
 
開發者ID:myiume,項目名稱:MyiuLib,代碼行數:32,代碼來源:MGListener.java

示例12: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockBurn(BlockBurnEvent event) {
    Lot lot = this.module.getLotManager().getLot(event.getBlock().getLocation());
    Town town = this.module.getLotManager().getTown(event.getBlock().getLocation());
    if(lot != null || town != null) {
        event.setCancelled(true);
    }
}
 
開發者ID:Steveice10,項目名稱:Peacecraft,代碼行數:9,代碼來源:LotsListener.java

示例13: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockBurn(BlockBurnEvent event) {
    BlockProtection blockProtection = this.module.getProtectManager().getBlockProtection(event.getBlock().getLocation());
    if(blockProtection.exists()) {
        event.setCancelled(true);
    }
}
 
開發者ID:Steveice10,項目名稱:Peacecraft,代碼行數:8,代碼來源:ProtectListener.java

示例14: onBlockBurnEvent

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true)
public void onBlockBurnEvent(BlockBurnEvent event) {
    if (plugin.getChestSettings().allowDestroyBy(AttackType.FIRE)) {
        return;
    }
    if (isProtected(event.getBlock())) {
        event.setCancelled(true);
    }
}
 
開發者ID:rutgerkok,項目名稱:BlockLocker,代碼行數:10,代碼來源:BlockDestroyListener.java

示例15: onBlockBurn

import org.bukkit.event.block.BlockBurnEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
  public void onBlockBurn(BlockBurnEvent event)
  {
Block block = event.getBlock();
Chunk blockChunk = block.getChunk();
if (config.getClaimed(blockChunk))
{
	event.setCancelled(true);
}

  }
 
開發者ID:jediminer543,項目名稱:Plugin,代碼行數:12,代碼來源:ClaimListener.java


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