本文整理匯總了Java中org.bukkit.event.block.BlockBurnEvent類的典型用法代碼示例。如果您正苦於以下問題:Java BlockBurnEvent類的具體用法?Java BlockBurnEvent怎麽用?Java BlockBurnEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BlockBurnEvent類屬於org.bukkit.event.block包,在下文中一共展示了BlockBurnEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onBlockBurn
import org.bukkit.event.block.BlockBurnEvent; //導入依賴的package包/類
/**
* So far specifically handles these cases:
*
* 1) Block burnt is tracked
* 2) Block burnt is under a tracked block (probably only mushrooms eligible)
* 3) Block burnt was a jungle tree, checks for cocoa.
* 4) Burnt block had mushroom on top and cocoa on the sides
*
* @param e The event
*/
@EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockBurn(BlockBurnEvent e) {
Block block = e.getBlock();
if (maybeSideTracked(block)) {
trySideBreak(block, BreakType.FIRE, null);
}
if (maybeBelowTracked(block)) {
block = block.getRelative(BlockFace.UP);
}
Location loc = block.getLocation();
if (!pendingChecks.contains(loc)) {
pendingChecks.add(loc);
handleBreak(block, BreakType.FIRE, null, null);
}
}
示例2: onBlockBurn
import org.bukkit.event.block.BlockBurnEvent; //導入依賴的package包/類
@EventWrapper
public void onBlockBurn(final BlockBurnEvent event) {
Match match = PGM.getMatchManager().getMatch(event.getBlock().getWorld());
if(match == null) return;
BlockState oldState = event.getBlock().getState();
BlockState newState = BlockStateUtils.toAir(oldState);
MatchPlayerState igniterState = null;
for(BlockFace face : NEIGHBORS) {
Block neighbor = oldState.getBlock().getRelative(face);
if(neighbor.getType() == Material.FIRE) {
igniterState = blockResolver.getOwner(neighbor);
if(igniterState != null) break;
}
}
this.callEvent(event, oldState, newState, igniterState);
}
示例3: onBlockBurn
import org.bukkit.event.block.BlockBurnEvent; //導入依賴的package包/類
@EventHandler
public void onBlockBurn(BlockBurnEvent event) throws InterruptedException {
if (disabling) { return; }
Block block = event.getBlock();
if (plugin.needsCheck.contains(block)) {
plugin.needsCheck.remove(block);
}
if (plugin.monitorBlocks.contains(block)) {
while (plugin.isUpdatingChecks) {
Thread.sleep(25);
}
plugin.monitorBlocks.remove(block);
}
}
示例4: 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);
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: 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;
}
}
示例8: 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;
}
}
示例9: onBlockBurn
import org.bukkit.event.block.BlockBurnEvent; //導入依賴的package包/類
@EventHandler
public void onBlockBurn(BlockBurnEvent event) {
Block block = event.getBlock();
if (block.getRelative(BlockFace.UP).getType() == Material.FIRE) {
block.getRelative(BlockFace.UP).setType(Material.AIR);
}
if (block.getRelative(BlockFace.NORTH).getType() == Material.FIRE) {
block.getRelative(BlockFace.NORTH).setType(Material.AIR);
}
if (block.getRelative(BlockFace.SOUTH).getType() == Material.FIRE) {
block.getRelative(BlockFace.SOUTH).setType(Material.AIR);
}
if (block.getRelative(BlockFace.WEST).getType() == Material.FIRE) {
block.getRelative(BlockFace.WEST).setType(Material.AIR);
}
if (block.getRelative(BlockFace.EAST).getType() == Material.FIRE) {
block.getRelative(BlockFace.EAST).setType(Material.AIR);
}
//rather than disabling fire spread, we make it burn itself out by targeting fire blocks and removing them
}
示例10: 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);
}
示例11: 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);
}
}
}
示例12: 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);
}
示例13: 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);
}
}
}
示例14: onBlockBurn
import org.bukkit.event.block.BlockBurnEvent; //導入依賴的package包/類
@EventHandler(ignoreCancelled = false)
public void onBlockBurn(cn.nukkit.event.block.BlockBurnEvent event) {
if (canIgnore(BlockBurnEvent.getHandlerList())) {
return;
}
cn.nukkit.block.Block burning = event.getBlock();
// Nukkit does not provide ignitingBlock, so we have to use this
// deprecated method
@SuppressWarnings("deprecation")
BlockBurnEvent bukkitEvent = new BlockBurnEvent(PokkitBlock.toBukkit(burning));
callCancellable(event, bukkitEvent);
}
示例15: 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);
}
}