@Override
 public void onBlockCanBuild(BlockCanBuildEvent event) {
   if (event.getMaterialId() == NetherTrees.SAPLING_TYPE
       && event.getBlock().getRelative(0, -1, 0).getType() == Material.NETHERRACK) {
     NetherTreePopulator.generateTree(event.getBlock(), new Random());
     // event.setBuildable(true);
   }
 }
コード例 #2
0
 public void onBlockCanBuild(BlockCanBuildEvent e) {
   ZombieSiegeGame game = instance.getGame();
   if (game == null) {
     return;
   }
   int x = e.getBlock().getX();
   int y = e.getBlock().getY();
   int z = e.getBlock().getZ();
   int baseX = game.getBase().getBlock().getX();
   int baseY = game.getBase().getBlock().getY();
   int baseZ = game.getBase().getBlock().getZ();
   if ((x == baseX && y == baseY + 1 && z == baseZ) || (x == baseX && y == baseY && z == baseZ)) {
     e.setBuildable(false);
   }
 }
コード例 #3
0
 @EventHandler
 public void onBlockBuilt(BlockCanBuildEvent event) {
   location = new dLocation(event.getBlock().getLocation());
   old_material =
       dMaterial.getMaterialFrom(event.getBlock().getType(), event.getBlock().getData());
   new_material =
       dMaterial.getMaterialFrom(
           event.getMaterial()); // Deprecated because it doesn't have proper data
   cancelled = !event.isBuildable();
   this.event = event;
   fire();
   event.setBuildable(!cancelled);
 }
コード例 #4
0
 /*    */ @EventHandler
 /*    */ public void onBlockCanBuild(BlockCanBuildEvent event) /*    */ {
   /* 60 */ Block block = event.getBlock();
   /* 61 */ if (block.getType() == Material.TORCH) /* 62 */ event.setBuildable(true);
   /*    */ }
コード例 #5
0
 @EventHandler
 public void BlockCanBuildEvent(BlockCanBuildEvent event) {
   if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return;
   if (arena.getArena().isInside(event.getBlock().getLocation()) && arena.isRunning()) return;
   event.setBuildable(false);
 }
コード例 #6
0
 @Override
 public void destroy() {
   BlockCanBuildEvent.getHandlerList().unregister(this);
 }
コード例 #7
0
 public void onBlockCanBuild(BlockCanBuildEvent curEvent) {
   if (FlowerFarm.isTimer(curEvent.getBlock())) {
     curEvent.setBuildable(true);
   }
 }