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


Java BlockGrowEvent.setCancelled方法代码示例

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


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

示例1: onBlockGrowth

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:11,代码来源:CanaryBlockListener.java

示例2: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent grow) {

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

  grow.setCancelled(true);
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:12,代码来源:BlockListener.java

示例3: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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);
	}		
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:12,代码来源:RPBlockListener.java

示例4: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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;
				}
			}
		}
	}
}
 
开发者ID:myiume,项目名称:MyiuLib,代码行数:15,代码来源:MGListener.java

示例5: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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);
	}
}
 
开发者ID:NoChanceSD,项目名称:AncientGates,代码行数:14,代码来源:PluginBlockListener.java

示例6: onGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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);
        }
    }
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:11,代码来源:PlayerEvents.java

示例7: onBlockGrowEvent

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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);
	}
}
 
开发者ID:netizen539,项目名称:civcraft,代码行数:15,代码来源:BlockListener.java

示例8: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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));
        }
    }
}
 
开发者ID:WorldCretornica,项目名称:PlotMe-Core,代码行数:15,代码来源:BukkitPlotListener.java

示例9: onGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:9,代码来源:PlayerEvents.java

示例10: onGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler
private void onGrow(final BlockGrowEvent event) {
    ProtectedArea area = Areas.findArea(event.getBlock().getLocation());
    if (area != null) {
        event.setCancelled(true);
    }
}
 
开发者ID:dobrakmato,项目名称:PexelCore,代码行数:8,代码来源:EventProcessor.java

示例11: onBlockGrow

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

示例12: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
    if (!match.isRunning()) {
        event.setCancelled(true);
    }
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:7,代码来源:WorldFreeze.java

示例13: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:twizmwazin,项目名称:CardinalPGM,代码行数:7,代码来源:BlockEventRegion.java

示例14: e

import org.bukkit.event.block.BlockGrowEvent; //导入方法依赖的package包/类
@EventHandler public void e(BlockGrowEvent event) { event.setCancelled(true); } 
开发者ID:Limeth,项目名称:Breakpoint,代码行数:2,代码来源:BanListener.java


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