当前位置: 首页>>代码示例>>Java>>正文


Java BlockFadeEvent类代码示例

本文整理汇总了Java中org.bukkit.event.block.BlockFadeEvent的典型用法代码示例。如果您正苦于以下问题:Java BlockFadeEvent类的具体用法?Java BlockFadeEvent怎么用?Java BlockFadeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BlockFadeEvent类属于org.bukkit.event.block包,在下文中一共展示了BlockFadeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onFade(BlockFadeEvent e) {

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

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

  if (!game.getRegion().isPlacedBlock(e.getBlock())) {
    e.setCancelled(true);
  }
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:18,代码来源:BlockListener.java

示例2: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockFade(final BlockFadeEvent event) {
    final Block block = event.getBlock();
    final Location location = block.getLocation();
    final Material material = block.getType();

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

    if (!Material.SNOW.equals(material) && !Material.ICE.equals(material) && !Material.SOIL.equals(material)) {
        return;
    }

    if (!reinforcementManager.isReinforced(location)) {
        return;
    }

    if (!allowBlockFading) {
        event.setCancelled(true);
        return;
    }

    Bukkit.getServer().getPluginManager().callEvent(new BlockDeinforceEvent(block, "Environment", true));
}
 
开发者ID:MinerAp,项目名称:block-saver,代码行数:26,代码来源:GeneralListener.java

示例3: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler
public void onBlockFade(BlockFadeEvent e) {
    if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Block-Fade.Disable")) {
    	if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Block-Fade.World.All_World")) {
    		if (WorldUtils.getWBF().contains(e.getBlock().getWorld().getName())) {
    			e.setCancelled(true);
    		}
    	} else {
    		e.setCancelled(true);
    	}
    }
}
 
开发者ID:DianoxDragon,项目名称:UltimateSpawn,代码行数:13,代码来源:BasicFeatures.java

示例4: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
public void onBlockFade(BlockFadeEvent event) {
    switch (event.getBlock().getType()) {
    case SNOW:
    case ICE:
        event.setCancelled(true);
        break;
    default:
        break;
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:12,代码来源:WorldListener.java

示例5: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockFade(BlockFadeEvent 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().isBlockFadeAllowed()) {
					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

示例6: onFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onFade(final BlockFadeEvent e) {
    final Block b = e.getBlock();
    final Location loc = BukkitUtil.getLocation(b.getLocation());
    if (PlotSquared.isPlotWorld(loc.getWorld())) {
        if (MainUtil.isPlotRoad(loc)) {
            e.setCancelled(true);
        }
    }
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:11,代码来源:PlayerEvents.java

示例7: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
    Location location = BukkitUtil.adapt(event.getBlock().getLocation());

    if (manager.isPlotWorld(location)) {
        PlotId id = manager.getPlotId(location);

        if (id == null) {
            event.setCancelled(true);
        } else {
            event.setCancelled(api.isPlotLocked(id));

        }
    }
}
 
开发者ID:WorldCretornica,项目名称:PlotMe-Core,代码行数:16,代码来源:BukkitPlotListener.java

示例8: onFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onFade(BlockFadeEvent event) {
    Block b = event.getBlock();
    Location location = BukkitUtil.getLocation(b.getLocation());
    PlotArea area = location.getPlotArea();
    if (area == null) {
        return;
    }
    Plot plot = area.getOwnedPlot(location);
    if (plot == null) {
        event.setCancelled(true);
        return;
    }
    switch (b.getType()) {
        case ICE:
            if (Flags.ICE_MELT.isFalse(plot)) {
                event.setCancelled(true);
            }
            break;
        case SNOW:
            if (Flags.SNOW_MELT.isFalse(plot)) {
                event.setCancelled(true);
            }
            break;
        case SOIL:
            if (Flags.SOIL_DRY.isFalse(plot)) {
                event.setCancelled(true);
            }
            break;
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:32,代码来源:PlayerEvents.java

示例9: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event)
{
    if (this.getConfig(event.getBlock().getWorld()).block.fade.ignore.contains(event.getBlock().getType()))
    {
        return;
    }
    this.setAndLog(BlockFade.class, event.getBlock().getState(), AIR);
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:10,代码来源:ListenerBlock.java

示例10: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {

	World world = event.getBlock().getWorld();
	
	String biome = String.valueOf(event.getBlock().getBiome());
	
	// if the biome has a bypass, allow ice to melt
	if (PwnBuckets.containsCaseInsensitive(biome, PwnBuckets.icemeltBypass)) 
	{
		return;
	}
	
	if (PwnBuckets.isEnabledIn(world.getName())) 
	{
		if(PwnBuckets.blockIceMelt)
    	{				
			//only care about water
			if(event.getNewState().getType() == Material.STATIONARY_WATER)
			{					

    			Block block = event.getBlock();
    			
    			block.setType(Material.WATER);
    			EvaporateWaterTask task = new EvaporateWaterTask(block);
    			plugin.getServer().getScheduler().runTaskLater(plugin, task, 30L);
    			
	    		event.setCancelled(true);
    			
    	    	if (PwnBuckets.logEnabled) 
    	    	{	
    	    		PwnBuckets.logToFile("Blocked water source from ice melt");
    	    	}
			}
    	}
	}		
	
}
 
开发者ID:Pwn9,项目名称:PwnBuckets,代码行数:39,代码来源:WaterListener.java

示例11: onBlockBurn

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler
public void onBlockBurn(BlockFadeEvent event) {
    Block block = event.getBlock();
    String world = block.getWorld().getUID().toString();
    Integer x = block.getLocation().getChunk().getX(), z = block.getLocation().getChunk().getZ();
    if (QuickChecks.isWorldChunkClaimed(serverdata.get("worldmap").get(world), x, z, "cla")) {
        if (((HashMap) ((HashMap) serverdata.get("worldmap").get(world).get(x)).get(z)).containsKey("str")) {
            event.setCancelled(true);
        }
    }
}
 
开发者ID:N1T3SLAY3R,项目名称:Empirecraft,代码行数:12,代码来源:OnBlockBurn.java

示例12: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler (priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
    final Block fading = event.getBlock();
    //Don't do a lookup if it isn't soil.
    if (fading.getType() != Material.SOIL) {
        return;
    }
    final Block top = event.getBlock().getRelative((BlockFace.UP));
    if (plugin.getWorldRegistry().contains(top.getWorld().getName(), top.getX(), top.getY(), top.getZ())) {
        event.setCancelled(true);
    }
}
 
开发者ID:AlmuraDev,项目名称:Sprout,代码行数:13,代码来源:SproutListener.java

示例13: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
/**
 * Cancels block fade events in arenas not currently running.
 * @param event The {@link org.bukkit.event.block.BlockFadeEvent} event.
 */
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
    Arena arena = ultimateGames.getArenaManager().getLocationArena(event.getBlock().getLocation());
    if (arena != null && arena.getStatus() == ArenaStatus.RUNNING) {
        arena.getGame().getGamePlugin().onBlockFade(arena, event);
    } else {
        event.setCancelled(true);
    }
}
 
开发者ID:UltimateGames,项目名称:UltimateGames,代码行数:14,代码来源:ArenaListener.java

示例14: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    event.setCancelled(true);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:5,代码来源:EnvironmentManager.java

示例15: onBlockFade

import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventWrapper
public void onBlockFade(final BlockFadeEvent event) {
    BlockState state = event.getBlock().getState();
    this.callEvent(new BlockTransformEvent(event, state, BlockStateUtils.toAir(state)));
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:6,代码来源:BlockTransformListener.java


注:本文中的org.bukkit.event.block.BlockFadeEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。