Advertisement
Guest User

sdaasd

a guest
Mar 9th, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 1.24 KB | None | 0 0
  1.    
  2.   @EventHandler(priority=EventPriority.NORMAL)
  3.   public void onExplosion(EntityExplodeEvent event) {
  4.     if (((event.getEntity() instanceof TNTPrimed)) || ((event.getEntity() instanceof ExplosiveMinecart))) {
  5.       List blocks = new ArrayList();
  6.       int radious = 3;
  7.  
  8.       for (int x = (int)(event.getLocation().getX() - radious); x < event.getLocation().getX() + radious; x++) {
  9.         for (int y = (int)(event.getLocation().getY() - radious); y < event.getLocation().getY() + radious; y++)
  10.           for (int z = (int)(event.getLocation().getZ() - radious); z < event.getLocation().getZ() + radious; z++)
  11.             blocks.add(event.getLocation().getWorld().getBlockAt(x, y, z));
  12.       }
  13.       for (int i = 0; i < blocks.size(); i++) {
  14.         int material = ((Block)blocks.get(i)).getTypeId();
  15.         Random random = new Random();
  16.  
  17.         if (material == 49) {
  18.           int percent = 40;
  19.           if (percent > random.nextInt(100)) ((Block)blocks.get(i)).setType(Material.AIR);
  20.         }
  21.         else if ((material == 8) ||asd (material == 9) || (material == 10) || (material == 11)) {
  22.           int percent = 50;
  23.           if (percent > random.nextInt(100)) ((Block)blocks.get(i)).setType(Material.AIR);
  24.         }
  25.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement