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

项目:SurvivalPlus    文件:SnowGeneration.java   
@EventHandler(ignoreCancelled = true)
public void snowForm(final BlockFormEvent event)
{
    if(Survival.snowGenOption)
    {
        if(event.getNewState().getType() != Material.SNOW)
            return;

        Bukkit.getScheduler().runTask(Survival.instance, new Runnable()
        {
            public void run()
            {
                placeSnow(event.getBlock());
            }
        });
    }
}
项目:BedwarsRel    文件:BlockListener.java   
@EventHandler(ignoreCancelled = true)
public void onForm(BlockFormEvent form) {

  if (form.getNewState().getType() != Material.SNOW) {
    return;
  }

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

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

  form.setCancelled(true);
}
项目:RedProtect    文件:RPBlockListener.java   
@EventHandler
   public void onBlockForm(BlockFormEvent event) { 
    RedProtect.get().logger.debug("RPBlockListener - Is Blockform event!");     
    if (event.isCancelled()){
        return;
    }

    BlockState b = event.getNewState();
    if (b == null){
        return;
    }
    RedProtect.get().logger.debug("Is Blockform event: "+b.getType().name());       

    if (b.getType().equals(Material.SNOW) || b.getType().equals(Material.ICE)){
        Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
        if (r != null && !r.canIceForm()){
            event.setCancelled(true);
        }
    }
}
项目:AncientGates    文件:PluginBlockListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onBlockForm(final BlockFormEvent event) {
    if (event.isCancelled())
        return;

    final Block block = event.getBlock();

    // Ok so blocks starts forming within a portal frame
    // Find the nearest gate!
    final WorldCoord blockCoord = new WorldCoord(block);
    final Gate nearestGate = Gates.gateFromPortal(blockCoord);

    if (nearestGate != null) {
        event.setCancelled(true);
    }
}
项目:civcraft    文件:BlockListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void OnBlockFormEvent (BlockFormEvent event) {

    /* Disable cobblestone generators. */
    if (ItemManager.getId(event.getNewState()) == CivData.COBBLESTONE) {
        ItemManager.setTypeId(event.getNewState(), CivData.GRAVEL);
        return;
    }

    Chunk spreadChunk = event.getNewState().getChunk();
    coord.setX(spreadChunk.getX());
    coord.setZ(spreadChunk.getZ());
    coord.setWorldname(spreadChunk.getWorld().getName());

    TownChunk tc = CivGlobal.getTownChunk(coord);
    if (tc == null) {
        return;
    }

    if (tc.perms.isFire() == false) {
        if(event.getNewState().getType() == Material.FIRE) {
            event.setCancelled(true);
        }
    }
}
项目:PlotSquared    文件:PlayerEvents.java   
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockSpread(BlockFormEvent event) {
    Block block = event.getBlock();
    Location location = BukkitUtil.getLocation(block.getLocation());
    if (location.isPlotRoad()) {
        event.setCancelled(true);
        return;
    }
    PlotArea area = location.getPlotArea();
    if (area == null) {
        return;
    }
    Plot plot = area.getOwnedPlot(location);
    if (plot == null) {
        return;
    }
    if (Flags.SNOW_FORM.isFalse(plot)) {
        event.setCancelled(true);
    }
}
项目:Pokkit    文件:PlayerBlockEvents.java   
@EventHandler(ignoreCancelled = false)
public void onBlockForm(cn.nukkit.event.block.BlockFormEvent event) {
    if (canIgnore(BlockFormEvent.getHandlerList())) {
        return;
    }

    cn.nukkit.block.Block forming = event.getBlock();

    BlockFormEvent bukkitEvent = new BlockFormEvent(PokkitBlock.toBukkit(forming),
            PokkitBlockState.getBlockState(PokkitBlock.toBukkit(event.getNewState())));
    callCancellable(event, bukkitEvent);
}
项目:Cardinal-Plus    文件:CoreObjective.java   
@EventHandler
public void onObsidianForm(BlockFormEvent event) {
    if (this.lava.contains(event.getBlock())) {
        if (event.getNewState().getType().equals(Material.OBSIDIAN)) {
            event.setCancelled(true);
        }
    }
}
项目:PlotSquared-Chinese    文件:PlayerEvents.java   
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBF(final BlockFormEvent 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 onBlockForm(BlockFormEvent 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));

        }
    }
}
项目:modules-extra    文件:ListenerBlock.java   
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockForm(BlockFormEvent event)
{
    if (event instanceof EntityBlockFormEvent)
    {
        return;
    }
    this.setAndLog(BlockForm.class, event.getBlock().getState(), event.getNewState());
}
项目:Empirecraft    文件:OnBlockForm.java   
@EventHandler
public void onBlockForm(BlockFormEvent 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);
        }
    }
}
项目:ShankShock-Core    文件:BlockListener.java   
@EventHandler(priority = EventPriority.HIGH)
public void onBlockForm(BlockFormEvent event) {
    if (event.getNewState().getType() == Material.ICE
            || event.getNewState().getType() == Material.SNOW) {
        if (plugin.zoneManager.checkBlockIsInAntiGriefZone(event.getBlock()
                .getLocation())) {
            event.setCancelled(true);
        }
    }
}
项目:CardinalPGM    文件:CoreObjective.java   
@EventHandler
public void onObsidianForm(BlockFormEvent event) {
    if (this.lava.contains(event.getBlock())) {
        if (event.getNewState().getType().equals(Material.OBSIDIAN)) {
            event.setCancelled(true);
        }
    }
}
项目:NPlugins    文件:WorldListener.java   
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onSnowForm(final BlockFormEvent event) {
    if (event.getNewState().getType() == Material.SNOW) {
        final Location loc = event.getBlock().getLocation();
        final Altar altar = this.plugin.getAltars().get(new ChunkCoord(loc.getChunk()));
        if (altar != null && altar.preventsBlockPlacement(loc)) {
            event.setCancelled(true);
        }
    }
}
项目:NPlugins    文件:SnowFlagListener.java   
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockForm(final BlockFormEvent event) {
    final BlockState newState = event.getNewState();
    if (newState.getType() == Material.SNOW || newState.getType() == Material.ICE) {
        final GeneralRegion region = this.getPlugin().getDb().getPriorByLocation(event.getBlock().getLocation());
        if (region != null && region.getFlag(Flag.SNOW)) {
            event.setCancelled(true);
        }
    }
}
项目:ZentrelaRPG    文件:EnvironmentManager.java   
@EventHandler
public void onBlockForm(BlockFormEvent event) {
    event.setCancelled(true);
}
项目:ProjectAres    文件:BlockTransformListener.java   
@EventWrapper
public void onBlockForm(final BlockFormEvent event) {
    callEvent(event, event.getBlock().getState(), event.getNewState());
}
项目:ProjectAres    文件:EnvironmentControlListener.java   
@EventHandler(priority = EventPriority.HIGH)
public void noForm(final BlockFormEvent event) {
    event.setCancelled(true);
}
项目:Arcade2    文件:BlockTransformListeners.java   
@EventHandler(ignoreCancelled = true)
public void onBlockForm(BlockFormEvent event) {
    this.post(event,
              event.getBlock().getState(),
              event.getNewState());
}
项目:Steel    文件:RollbackBlockListener.java   
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockForm(BlockFormEvent event) {
    RollbackAgent.checkBlockChange(event.getBlock().getLocation(), event.getBlock().getState(), event);
}
项目:SniperGamemode    文件:WeatherHandler.java   
@EventHandler
public void onBlockForm(BlockFormEvent event){
    event.setCancelled(true);
}
项目:CardinalPGM    文件:WorldFreeze.java   
@EventHandler
public void onBlockForm(BlockFormEvent event) {
    if (!match.isRunning()) {
        event.setCancelled(true);
    }
}
项目:CardinalPGM    文件:BlockEventRegion.java   
@EventHandler
public void onBlockForm(BlockFormEvent event) {
    if (filter.evaluate(event.getBlock(), event).equals(FilterState.DENY) && region.contains(new BlockRegion(null, event.getBlock().getLocation().toVector()))) {
        event.setCancelled(true);
    }
}
项目:Cardinal    文件:AppliedModule.java   
/**
 * Filters BlockFormEvent, like endermen placing down blocks or falling sand entity converting to block.
 * <p>If new block is air, it will filter as block removing else it will filter as block placing </p>
 *
 * <p>Applies to: block, block place and block break<p/>
 */
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockForm(BlockFormEvent event) {
  handleStateChange(event.getWorld(), event.getBlock(), event, event, event.getNewState());
}
项目:Breakpoint    文件:BanListener.java   
@EventHandler public void e(BlockFormEvent event) { event.setCancelled(true); }
项目:Breakpoint    文件:BanListener.java   
@EventHandler public void e(BlockFormEvent event) { event.setCancelled(true); }