Compare commits
3 Commits
491e6a6050
...
3906bd747b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3906bd747b | ||
|
|
0d757aa2ab | ||
|
|
5f35866e7a |
|
|
@ -45,6 +45,7 @@ public class Config extends AbstractConfig {
|
|||
public static Duration TIME_TO_FINALE = Duration.ofMinutes(5);
|
||||
public static int INITIAL_BORDER_SIZE = 5000;
|
||||
public static int FINALE_BORDER_SIZE = 48;
|
||||
public static int DEFAULT_BORDER_TRANSITION_SECONDS = 45;
|
||||
public static List<GameStage> STAGES = List.of(
|
||||
GameStage.builder().duration(Duration.ofMinutes(5)).worldBorderSize(1000).build(),
|
||||
GameStage.builder().duration(Duration.ofMinutes(5)).worldBorderSize(750).build(),
|
||||
|
|
@ -61,6 +62,7 @@ public class Config extends AbstractConfig {
|
|||
TIME_TO_FINALE = Duration.ofSeconds(killPhaseSeconds);
|
||||
INITIAL_BORDER_SIZE = config.getInt(prefix, "initial-border-size", INITIAL_BORDER_SIZE);
|
||||
FINALE_BORDER_SIZE = config.getInt(prefix, "finale-border-size", FINALE_BORDER_SIZE);
|
||||
DEFAULT_BORDER_TRANSITION_SECONDS = config.getInt(prefix, "default-border-transition-seconds", DEFAULT_BORDER_TRANSITION_SECONDS);
|
||||
|
||||
ConfigurationSection configurationSection = config.getConfigurationSection(prefix + "stages");
|
||||
if (configurationSection == null) {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ public class PlayerService implements RoundListener {
|
|||
}
|
||||
case FINALE -> {
|
||||
Set<UUID> players = roundService.getPlayers(PLAYER_STATE.REGISTERED);
|
||||
log.info("Teleporting players {} to finale area", players);
|
||||
Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> players.contains(player.getUniqueId()))
|
||||
.forEach(player -> playerTeleporterService.teleportPlayer(player, DESTINATION.FINALE_AREA));
|
||||
|
|
|
|||
|
|
@ -31,8 +31,12 @@ public class PlayerTeleporterService implements RoundListener {
|
|||
}
|
||||
|
||||
public void teleportPlayer(Player player, DESTINATION destination) {
|
||||
log.info("Teleporting {} to {}}", player.getName(), destination.name());
|
||||
player.teleport(getLocationFromDestination(destination));
|
||||
Location locationFromDestination = getLocationFromDestination(destination);
|
||||
try {
|
||||
player.teleportAsync(getLocationFromDestination(destination));
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to teleport player {} to destination {} ({})", player.getName(), destination.name(), locationFromDestination, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@ import java.util.Optional;
|
|||
@UtilityClass
|
||||
public class WorldBorderUtil {
|
||||
|
||||
private static final int BORDER_TRANSITION_SECONDS = 45;
|
||||
|
||||
public static void setSize(int size) {
|
||||
setSize(size, BORDER_TRANSITION_SECONDS);
|
||||
setSize(size, Config.ROUND.DEFAULT_BORDER_TRANSITION_SECONDS);
|
||||
}
|
||||
|
||||
public static void setSize(int size, int seconds) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user