本文整理汇总了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());
}
}
示例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);
}
示例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
}
示例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);
}
示例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);
}
}
示例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;
}
}
}
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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));
}
}
}
示例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);
}
}
示例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);
}
}
示例13: onBlockGrow
import org.bukkit.event.block.BlockGrowEvent; //导入依赖的package包/类
@EventHandler
public void onBlockGrow(BlockGrowEvent event) {
event.setCancelled(true);
}
示例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()));
}
示例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());
}