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