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

项目:PwnPlantGrowth    文件:PwnPlantGrowth.java   
public static String getBiome(BlockGrowEvent e) 
{
    if (tc != null) 
    {       
        String tControl = TerrainControl.getBiomeName(e.getBlock().getWorld().getName(), e.getBlock().getLocation().getBlockX(), e.getBlock().getLocation().getBlockZ());
        if (tControl != null)
        {
            return tControl;
        }
        else
        {
            return String.valueOf(e.getBlock().getBiome());
        }
    }
    else
    {
        return String.valueOf(e.getBlock().getBiome());
    }
}
项目:Pokkit    文件:PlayerBlockEvents.java   
@EventHandler(ignoreCancelled = false)
public void onBlockGrowing(cn.nukkit.event.block.BlockGrowEvent event) {
    if (canIgnore(BlockGrowEvent.getHandlerList())) {
        return;
    }

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

    BlockGrowEvent bukkitEvent = new BlockGrowEvent(PokkitBlock.toBukkit(growing),
            PokkitBlockState.getBlockState(PokkitBlock.toBukkit(event.getNewState())));
    callCancellable(event, bukkitEvent);
}
项目:CanaryBukkit    文件:CanaryBlockListener.java   
@HookHandler(priority = Priority.CRITICAL, ignoreCanceled = true)
public void onBlockGrowth(final BlockGrowHook hook) {
    BlockGrowEvent event = new BlockGrowEvent(new CanaryBlock(hook.getOriginal()), null);
    event.setCancelled(hook.isCanceled());
    server.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        hook.setCanceled();
    }
    // TODO: Fill in second argument
}
项目:BedwarsRel    文件:BlockListener.java   
@EventHandler(ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent grow) {

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

  grow.setCancelled(true);
}
项目:RedProtect    文件:RPBlockListener.java   
@EventHandler
   public void onBlockGrow(BlockGrowEvent event) {
    RedProtect.get().logger.debug("RPBlockListener - Is BlockGrowEvent event: "+event.getNewState().getType().name());  
    if (event.isCancelled()){
        return;
    }
    Region r = RedProtect.get().rm.getTopRegion(event.getBlock().getLocation());
    if (r != null && !r.canGrow()){
        event.setCancelled(true);
    }       
}
项目:MyiuLib    文件:MGListener.java   
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockGrow(BlockGrowEvent e) {
    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().isBlockGrowAllowed()) {
                    e.setCancelled(true);
                    break;
                }
            }
        }
    }
}
项目:AncientGates    文件:PluginBlockListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onBlockGrow(final BlockGrowEvent event) {
    if (event.isCancelled())
        return;

    final Block block = event.getNewState().getBlock();
    final WorldCoord coord = new WorldCoord(block);

    // Stop sugarcane blocks from growing
    if (BlockUtil.isStandableGateMaterial(event.getNewState().getType()) && Gates.gateFromPortalSurround(coord) != null) {
        event.setCancelled(true);
    }
}
项目:PlotSquared-Chinese    文件:PlayerEvents.java   
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onGrow(final BlockGrowEvent 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);
        }
    }
}
项目:civcraft    文件:BlockListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onBlockGrowEvent(BlockGrowEvent event) {
    bcoord.setFromLocation(event.getBlock().getLocation().add(0, -1, 0));
    if (CivGlobal.vanillaGrowthLocations.contains(bcoord)) {
        /* Allow vanilla growth on these plots. */
        return;
    }

    Block b = event.getBlock();

    if (Farm.isBlockControlled(b)) {
        event.setCancelled(true);
    }
}
项目:PlotMe-Core    文件:BukkitPlotListener.java   
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent 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 onGrow(BlockGrowEvent event) {
    Block b = event.getBlock();
    Location location = BukkitUtil.getLocation(b.getLocation());
    if (location.isUnownedPlotArea()) {
        event.setCancelled(true);
    }
}
项目:PexelCore    文件:EventProcessor.java   
@EventHandler
private void onGrow(final BlockGrowEvent event) {
    ProtectedArea area = Areas.findArea(event.getBlock().getLocation());
    if (area != null) {
        event.setCancelled(true);
    }
}
项目:MGLib    文件:MGListener.java   
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockGrow(BlockGrowEvent e) {
    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().isBlockGrowAllowed()) {
                    e.setCancelled(true);
                    break;
                }
            }
        }
    }
}
项目:ZentrelaRPG    文件:EnvironmentManager.java   
@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
    event.setCancelled(true);
}
项目:ProjectAres    文件:BlockTransformListener.java   
@EventWrapper
public void onBlockForm(final BlockGrowEvent event) {
    this.callEvent(new BlockTransformEvent(event, event.getBlock().getState(), event.getNewState()));
}
项目:Arcade2    文件:BlockTransformListeners.java   
@EventHandler(ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent event) {
    this.post(event,
              event.getBlock().getState(),
              event.getNewState());
}
项目:Steel    文件:RollbackBlockListener.java   
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent event) {
    RollbackAgent.checkBlockChange(event.getBlock().getLocation(), event.getBlock().getState(), event);
}
项目:UltimateSurvivalGames    文件:ResetListener.java   
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockGrow(BlockGrowEvent event) {
    if(!event.isCancelled()) {
        logChunk(event.getBlock().getLocation());
    }
}
项目:CardinalPGM    文件:WorldFreeze.java   
@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
    if (!match.isRunning()) {
        event.setCancelled(true);
    }
}
项目:CardinalPGM    文件:BlockEventRegion.java   
@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
    if (filter.evaluate(event.getBlock(), event).equals(FilterState.DENY) && region.contains(new BlockRegion(null, event.getBlock().getLocation().toVector()))) {
        event.setCancelled(true);
    }
}
项目:PwnPlantGrowth    文件:PlantListener.java   
public List<List<String>> specialBlockList(BlockGrowEvent e)
{
    List<String> fBlocksFound = new ArrayList<String>();
    List<String> wkBlocksFound = new ArrayList<String>();
    List<String> uvBlocksFound = new ArrayList<String>();;

    List<List<String>> result = new ArrayList<List<String>>();

    // Check for fertilizer blocks
    if (PwnPlantGrowth.fenabled) 
    {
        for (int fx = -(PwnPlantGrowth.fradius); fx <= PwnPlantGrowth.fradius; fx++) 
        {
            for (int fy = -(PwnPlantGrowth.fradius); fy <= PwnPlantGrowth.fradius; fy++) 
            {
               for (int fz = -(PwnPlantGrowth.fradius); fz <= PwnPlantGrowth.fradius; fz++) 
               {
                   fBlocksFound.add(String.valueOf(e.getBlock().getRelative(fx, fy, fz).getType()));
               }
            }
        }
    }       

    // Check for weed killer blocks
    if (PwnPlantGrowth.wkenabled)
    {
        for (int wx = -(PwnPlantGrowth.wkradius); wx <= PwnPlantGrowth.wkradius; wx++) 
        {
            for (int wy = -(PwnPlantGrowth.wkradius); wy <= PwnPlantGrowth.wkradius; wy++) 
            {
               for (int wz = -(PwnPlantGrowth.wkradius); wz <= PwnPlantGrowth.wkradius; wz++) 
               {
                   wkBlocksFound.add(String.valueOf(e.getBlock().getRelative(wx, wy, wz).getType()));
               }
            }
        }
    }

    // Check for uv blocks
    if (PwnPlantGrowth.uvenabled)
    {
        for (int ux = -(PwnPlantGrowth.uvradius); ux <= PwnPlantGrowth.uvradius; ux++) 
        {
            for (int uy = -(PwnPlantGrowth.uvradius); uy <= PwnPlantGrowth.uvradius; uy++) 
            {
               for (int uz = -(PwnPlantGrowth.uvradius); uz <= PwnPlantGrowth.uvradius; uz++) 
               {
                   uvBlocksFound.add(String.valueOf(e.getBlock().getRelative(ux, uy, uz).getType()));
               }
            }
        }
    }       

    result.add(fBlocksFound);
    result.add(wkBlocksFound);
    result.add(uvBlocksFound);

    return result;
}
项目:Breakpoint    文件:BanListener.java   
@EventHandler public void e(BlockGrowEvent event) { event.setCancelled(true); }
项目:Breakpoint    文件:BanListener.java   
@EventHandler public void e(BlockGrowEvent event) { event.setCancelled(true); }