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


Java BlockGrowEvent类代码示例

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


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

示例1: getBiome

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

示例2: onBlockGrowing

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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: onBlockGrow

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

示例14: onBlockForm

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

示例15: onBlockGrow

import org.bukkit.event.block.BlockGrowEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent event) {
    this.post(event,
              event.getBlock().getState(),
              event.getNewState());
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:7,代码来源:BlockTransformListeners.java


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