Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void createAllBorderAtStartSV() {
- Bukkit.getConsoleSender().sendMessage("Creating all border sizes...");
- createAllBorderLocation("uhcworld", 25, 4, locations25);
- createAllBorderLocation("uhcworld", 50, 4, locations50);
- createAllBorderLocation("uhcworld", 100, 4, locations100);
- createAllBorderLocation("uhcworld", 500, 4, locations500);
- createAllBorderLocation("uhcworld", 1500, 4, locations1500);
- createAllBorderLocation("uhcworld", 1000, 4, locations1000);
- createAllBorderLocation("uhcworld", 2000, 4, locations2000);
- createAllBorderLocation("uhcpractice", 150, 4, praclocations);
- Bukkit.getConsoleSender().sendMessage("All border has been created!");
- }
- public void createAllBorderLocation(String borderWorld, int radius, int amount, LinkedList<Location> locations) {
- World world = Bukkit.getWorld(borderWorld);
- if (world == null) {
- Bukkit.broadcastMessage("World not found: "+borderWorld);
- return;
- }
- for (int i = 0; i < amount; i++) {
- for (int z = -radius; z <= radius; z++) {
- Location location = new Location(world, radius, world.getHighestBlockYAt(radius, z) + i, z);
- locations.add(location);
- }
- for (int z = -radius; z <= radius; z++) {
- Location location = new Location(world, -radius, world.getHighestBlockYAt(-radius, z) + i, z);
- locations.add(location);
- }
- for (int x = -radius; x <= radius; x++) {
- Location location = new Location(world, x, world.getHighestBlockYAt(x, radius) + i, radius);
- locations.add(location);
- }
- for (int x = -radius; x <= radius; x++) {
- Location location = new Location(world, x, world.getHighestBlockYAt(x, -radius) + i, -radius);
- locations.add(location);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement