|
4 | 4 | import net.kyori.adventure.text.Component; |
5 | 5 | import net.kyori.adventure.text.format.NamedTextColor; |
6 | 6 | import net.kyori.adventure.text.format.TextDecoration; |
| 7 | +import net.kyori.adventure.title.Title; |
7 | 8 | import org.bukkit.Bukkit; |
8 | 9 | import org.bukkit.Location; |
9 | 10 | import org.bukkit.World; |
|
20 | 21 | import java.io.IOException; |
21 | 22 | import java.nio.file.*; |
22 | 23 | import java.nio.file.attribute.BasicFileAttributes; |
23 | | -import java.util.ArrayList; |
24 | | -import java.util.Arrays; |
25 | | -import java.util.List; |
26 | | -import java.util.Map; |
| 24 | +import java.util.*; |
27 | 25 |
|
28 | 26 | public class BuildManager { |
29 | 27 | public static void createWorld(Player p, String mapName, String minigame, boolean empty, Biome biome, boolean spawnMobs, boolean dayNightCycle, boolean weatherCycle) throws IOException, InvalidConfigurationException { |
@@ -52,10 +50,21 @@ public static void createWorld(Player p, String mapName, String minigame, boolea |
52 | 50 | } |
53 | 51 |
|
54 | 52 | public static void delete(@NotNull World world) { |
55 | | - world.getPlayers().forEach(player -> |
56 | | - player.kick(Component.text("World is getting deleted!") |
57 | | - .decorate(TextDecoration.BOLD) |
58 | | - .color(NamedTextColor.DARK_RED)) |
| 53 | + world.getPlayers().forEach(player -> { |
| 54 | + player.teleport( |
| 55 | + Objects.requireNonNull(Bukkit.getWorld("world")).getSpawnLocation() |
| 56 | + ); |
| 57 | + player.showTitle(Title.title( |
| 58 | + Component.text("World is getting") |
| 59 | + .color(NamedTextColor.DARK_RED) |
| 60 | + .decorate(TextDecoration.BOLD), |
| 61 | + Component.text("deleted") |
| 62 | + .color(NamedTextColor.DARK_RED) |
| 63 | + .decorate(TextDecoration.BOLD) |
| 64 | + )); |
| 65 | + |
| 66 | + |
| 67 | + } |
59 | 68 | ); |
60 | 69 |
|
61 | 70 | Bukkit.getScheduler().runTask(BuildSystem.getInstance(), () -> { |
|
0 commit comments