@@ -0,0 +1,1327 @@
+package cat.nyaa.autobloodmoon.utils;%0A%0A%0Aimport org.bukkit.Location;%0Aimport org.bukkit.Material;%0Aimport org.bukkit.World;%0Aimport org.bukkit.block.Block;%0Aimport org.bukkit.util.Vector;%0A%0Aimport java.util.Random;%0A%0Apublic class RandomLocation %7B%0A    public static Location RandomLocation(Location loc, int min, int max) %7B%0A        World world = loc.getWorld();%0A        for (int i = 0; i %3C 10; i++) %7B%0A            Block block = getRandomLocation(loc, min, max);%0A            if (block != null) %7B%0A                Block b = world.getBlockAt(block.getX(), block.getY() - 1, block.getZ());%0A                if (block.getY() %3E 5) %7B%0A                    if (!b.getType().equals(Material.LAVA)) %7B%0A                        return block.getLocation().add(new Vector(0.5D, 0.1D, 0.5D));%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A%0A    private static Block getRandomLocation(Location loc, int min, int max) %7B%0A        World world = loc.getWorld();%0A        int x = min + new Random().nextInt(max - min) + 1;%0A        int z = min + new Random().nextInt(max - min) + 1;%0A        if (new Random().nextBoolean()) %7B%0A            x *= -1;%0A        %7D%0A        if (new Random().nextBoolean()) %7B%0A            z *= -1;%0A        %7D%0A        return world.getHighestBlockAt((int) loc.getX() + x, (int) loc.getZ() + z);%0A    %7D%0A%7D%0A

add RandomLocation