本文整理汇总了Java中org.bukkit.event.block.BlockFormEvent.getBlock方法的典型用法代码示例。如果您正苦于以下问题:Java BlockFormEvent.getBlock方法的具体用法?Java BlockFormEvent.getBlock怎么用?Java BlockFormEvent.getBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.event.block.BlockFormEvent
的用法示例。
在下文中一共展示了BlockFormEvent.getBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockForm
import org.bukkit.event.block.BlockFormEvent; //导入方法依赖的package包/类
@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);
}
}
示例2: onBlockSpread
import org.bukkit.event.block.BlockFormEvent; //导入方法依赖的package包/类
@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);
}
}
示例3: onBF
import org.bukkit.event.block.BlockFormEvent; //导入方法依赖的package包/类
@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);
}
}
}
示例4: onBlockForm
import org.bukkit.event.block.BlockFormEvent; //导入方法依赖的package包/类
@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);
}
}
}