Java 类org.bukkit.event.block.BlockFadeEvent 实例源码

项目:BedwarsRel    文件:BlockListener.java   
@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);
  }
}
项目:block-saver    文件:GeneralListener.java   
@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));
}
项目:UltimateSpawn    文件:BasicFeatures.java   
@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);
        }
    }
}
项目:HCFCore    文件:WorldListener.java   
@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;
    }
}
项目:HCFCore    文件:WorldListener.java   
@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;
    }
}
项目:MyiuLib    文件:MGListener.java   
@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;
                }
            }
        }
    }
}
项目:PlotSquared-Chinese    文件:PlayerEvents.java   
@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);
        }
    }
}
项目:PlotMe-Core    文件:BukkitPlotListener.java   
@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));

        }
    }
}
项目:PlotSquared    文件:PlayerEvents.java   
@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;
    }
}
项目:modules-extra    文件:ListenerBlock.java   
@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);
}
项目:PwnBuckets    文件:WaterListener.java   
@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");
                }
            }
        }
    }       

}
项目:Empirecraft    文件:OnBlockBurn.java   
@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);
        }
    }
}
项目:MGLib    文件:MGListener.java   
@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;
                }
            }
        }
    }
}
项目:Sprout    文件:SproutListener.java   
@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);
    }
}
项目:UltimateGames    文件:ArenaListener.java   
/**
 * 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);
    }
}
项目:ZentrelaRPG    文件:EnvironmentManager.java   
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    event.setCancelled(true);
}
项目:ProjectAres    文件:BlockTransformListener.java   
@EventWrapper
public void onBlockFade(final BlockFadeEvent event) {
    BlockState state = event.getBlock().getState();
    this.callEvent(new BlockTransformEvent(event, state, BlockStateUtils.toAir(state)));
}
项目:ProjectAres    文件:EnvironmentControlListener.java   
@EventHandler(priority = EventPriority.HIGH)
public void noFade(final BlockFadeEvent event) {
    event.setCancelled(true);
}
项目:Arcade2    文件:BlockTransformListeners.java   
@EventHandler(ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
    this.post(event,
              event.getBlock().getState(),
              event.getNewState());
}
项目:Steel    文件:RollbackBlockListener.java   
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
    RollbackAgent.checkBlockChange(event.getBlock().getLocation(), event.getBlock().getState(), event);
}
项目:MiniMiniGames    文件:WorldListener.java   
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
   event.setCancelled(true);
}
项目:UltimateSurvivalGames    文件:ResetListener.java   
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if(!event.isCancelled()) {
        logChunk(event.getBlock().getLocation());
    }
}
项目:CardinalPGM    文件:WorldFreeze.java   
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if (!match.isRunning()) {
        event.setCancelled(true);
    }
}
项目:CardinalPGM    文件:BlockEventRegion.java   
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if (filter.evaluate(event.getBlock(), event).equals(FilterState.DENY) && region.contains(new BlockRegion(null, event.getBlock().getLocation().toVector()))) {
        event.setCancelled(true);
    }
}
项目:UltimateGames    文件:GamePlugin.java   
/**
 * Handles blocks fading.
 *
 * @param arena The arena the block is in.
 * @param event The BlockFadeEvent.
 */
public void onBlockFade(Arena arena, BlockFadeEvent event) {
}
项目:Breakpoint    文件:BanListener.java   
@EventHandler public void e(BlockFadeEvent event) { event.setCancelled(true); }
项目:Breakpoint    文件:BanListener.java   
@EventHandler public void e(BlockFadeEvent event) { event.setCancelled(true); }