Inform players why they are teleported to spawn during an island restart.

This commit is contained in:
Len 2024-02-10 22:45:43 +01:00
parent 46ac79503e
commit be52a305fe
2 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,7 @@ public class MessageConfiguration implements Configuration {
public static class Restart { public static class Restart {
String created = "Island restart request created type <yellow>/island restart confirm</yellow> or <yellow>/island restart deny</yellow>.<newline><red>This action can not be reversed!"; String created = "Island restart request created type <yellow>/island restart confirm</yellow> or <yellow>/island restart deny</yellow>.<newline><red>This action can not be reversed!";
String cancelled = "You have cancelled your island restart request!"; String cancelled = "You have cancelled your island restart request!";
String teleported = "You have been teleported to spawn because this island is restarting!";
} }
private Leave leave = new Leave(); private Leave leave = new Leave();

View File

@ -34,6 +34,7 @@ public class RestartRequest extends Request {
Location spawnLocation = world.getSpawnLocation(); Location spawnLocation = world.getSpawnLocation();
for (Player target : islandWorld.getPlayers()) { for (Player target : islandWorld.getPlayers()) {
target.teleport(spawnLocation); target.teleport(spawnLocation);
target.sendRichMessage(requests().restart().teleported(), placeholders());
} }
// TODO - run code to generate a new world and update the id for all members! // TODO - run code to generate a new world and update the id for all members!
super.accept(); super.accept();