Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority=EventPriority.NORMAL)
- public void onExplosion(EntityExplodeEvent event) {
- if (((event.getEntity() instanceof TNTPrimed)) || ((event.getEntity() instanceof ExplosiveMinecart))) {
- List blocks = new ArrayList();
- int radious = 3;
- for (int x = (int)(event.getLocation().getX() - radious); x < event.getLocation().getX() + radious; x++) {
- for (int y = (int)(event.getLocation().getY() - radious); y < event.getLocation().getY() + radious; y++)
- for (int z = (int)(event.getLocation().getZ() - radious); z < event.getLocation().getZ() + radious; z++)
- blocks.add(event.getLocation().getWorld().getBlockAt(x, y, z));
- }
- for (int i = 0; i < blocks.size(); i++) {
- int material = ((Block)blocks.get(i)).getTypeId();
- Random random = new Random();
- if (material == 49) {
- int percent = 40;
- if (percent > random.nextInt(100)) ((Block)blocks.get(i)).setType(Material.AIR);
- }
- else if ((material == 8) ||asd (material == 9) || (material == 10) || (material == 11)) {
- int percent = 50;
- if (percent > random.nextInt(100)) ((Block)blocks.get(i)).setType(Material.AIR);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement