Advertisement
CubyGC

Untitled

Jun 1st, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1.  
  2. public void createAllBorderAtStartSV() {
  3. Bukkit.getConsoleSender().sendMessage("Creating all border sizes...");
  4. createAllBorderLocation("uhcworld", 25, 4, locations25);
  5. createAllBorderLocation("uhcworld", 50, 4, locations50);
  6. createAllBorderLocation("uhcworld", 100, 4, locations100);
  7. createAllBorderLocation("uhcworld", 500, 4, locations500);
  8. createAllBorderLocation("uhcworld", 1500, 4, locations1500);
  9. createAllBorderLocation("uhcworld", 1000, 4, locations1000);
  10. createAllBorderLocation("uhcworld", 2000, 4, locations2000);
  11.  
  12. createAllBorderLocation("uhcpractice", 150, 4, praclocations);
  13. Bukkit.getConsoleSender().sendMessage("All border has been created!");
  14. }
  15. public void createAllBorderLocation(String borderWorld, int radius, int amount, LinkedList<Location> locations) {
  16. World world = Bukkit.getWorld(borderWorld);
  17. if (world == null) {
  18. Bukkit.broadcastMessage("World not found: "+borderWorld);
  19. return;
  20. }
  21.  
  22. for (int i = 0; i < amount; i++) {
  23. for (int z = -radius; z <= radius; z++) {
  24. Location location = new Location(world, radius, world.getHighestBlockYAt(radius, z) + i, z);
  25. locations.add(location);
  26. }
  27. for (int z = -radius; z <= radius; z++) {
  28. Location location = new Location(world, -radius, world.getHighestBlockYAt(-radius, z) + i, z);
  29. locations.add(location);
  30. }
  31. for (int x = -radius; x <= radius; x++) {
  32. Location location = new Location(world, x, world.getHighestBlockYAt(x, radius) + i, radius);
  33. locations.add(location);
  34. }
  35. for (int x = -radius; x <= radius; x++) {
  36. Location location = new Location(world, x, world.getHighestBlockYAt(x, -radius) + i, -radius);
  37. locations.add(location);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement