Compare commits

..

No commits in common. "3906bd747b221e9c30ed3a4b5cb3d25d895b8004" and "491e6a6050224fb1de42734ebb5a948727f9e1ca" have entirely different histories.

4 changed files with 6 additions and 9 deletions

View File

@ -45,7 +45,6 @@ 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(),
@ -62,7 +61,6 @@ 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) {

View File

@ -54,6 +54,7 @@ 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));

View File

@ -31,12 +31,8 @@ public class PlayerTeleporterService implements RoundListener {
}
public void teleportPlayer(Player player, DESTINATION 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);
}
log.info("Teleporting {} to {}}", player.getName(), destination.name());
player.teleport(getLocationFromDestination(destination));
}
public void reset() {

View File

@ -12,8 +12,10 @@ import java.util.Optional;
@UtilityClass
public class WorldBorderUtil {
private static final int BORDER_TRANSITION_SECONDS = 45;
public static void setSize(int size) {
setSize(size, Config.ROUND.DEFAULT_BORDER_TRANSITION_SECONDS);
setSize(size, BORDER_TRANSITION_SECONDS);
}
public static void setSize(int size, int seconds) {