public void explode(MainClass m, Location loc) { for (int x = -5; x < 5; x++) for (int z = -5; z < 5; z++) { if (Location.getDistance( loc.add(new Location(random.nextInt(4) - 2, random.nextInt(4) - 2)), new Location(loc.x + x, loc.z + z)) <= range) { Location loc2 = new Location(loc.getX() + x, loc.getZ() + z); m.getWorld() .addParticle( new Particle(loc2.x, loc2.z, 50 + random.nextInt(80), new Velocity(0, 0), 6)); hit(loc2, m.getWorld().getPlayer()); for (int a = 0; a < m.getWorld().getEntityArray().length; a++) { if (m.getWorld().getEntityArray()[a] == null) continue; if (m.getWorld().getEntityArray()[a] instanceof EntityLiving) { EntityLiving el = (EntityLiving) m.getWorld().getEntityArray()[a]; hit(loc2, el); } } } } }
public float getX() { return location.getX(); }