From c4f7aecfa631592e1a5a8777fac240bb26a2ca0c Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 31 May 2020 21:41:25 +0200 Subject: [PATCH] feat: add TabList Header and Footer --- .../varo/managers/GameTimeManager.java | 54 ++----------------- .../de/cliffbreak/varo/utils/PlayerUtils.java | 4 ++ 2 files changed, 7 insertions(+), 51 deletions(-) diff --git a/varo/src/main/java/de/cliffbreak/varo/managers/GameTimeManager.java b/varo/src/main/java/de/cliffbreak/varo/managers/GameTimeManager.java index 61d459c..7ec8636 100644 --- a/varo/src/main/java/de/cliffbreak/varo/managers/GameTimeManager.java +++ b/varo/src/main/java/de/cliffbreak/varo/managers/GameTimeManager.java @@ -17,20 +17,14 @@ public class GameTimeManager { private final Varo plugin; private static final int firstPlayTimeMinutes = 50; private static final int firstPlayTimeLoginMinutes = 10; - // private static final int firstPlayTimeMinutes = 360; - // private static final int protectionPeriodMinutes = 11; - private static final int protectionPeriodMinutes = 4; + private static final int protectionPeriodMinutes = 11; // private static final LocalTime firstPlayStart = LocalTime.of(19, 20, 00); private static final LocalTime firstPlayStart = LocalTime.now().plusMinutes(1); private static final int firstRoundPreStartMinutes = 1; - // private static final int playTimeMinutes = 30; - // private static final int playTimeLoginMinutes = 5; - private static final int playTimeMinutes = 1; - private static final int playTimeLoginMinutes = 1; + private static final int playTimeMinutes = 30; + private static final int playTimeLoginMinutes = 5; // private static final LocalTime playStart = LocalTime.of(19, 30, 00); - // private static final LocalTime playStart = LocalTime.now().plusMinutes(30); private static final LocalTime playStart = LocalTime.now().plusSeconds(10); - // private static final LocalTime playStart = LocalTime.now(); public GameTimeManager(final Varo plugin) { this.plugin = plugin; @@ -67,48 +61,6 @@ public class GameTimeManager { return (int) currentTime.until(start, ChronoUnit.SECONDS); } - // TODO: Rewrite - // private void startPlayTimeTimer() { - // new BukkitRunnable() { - // boolean broadcast1 = false; - // boolean broadcast2 = false; - - // @Override - // public void run() { - // if (currentDay() == 1) { - // for (final Player p : Bukkit.getOnlinePlayers()) { - // if (getGameTimeLeft() < 50 && getGameTimeLeft() > 45) { - // if (!p.getLocation().getWorld().getEnvironment().equals(Environment.THE_END)) { - // p.setGameMode(GameMode.ADVENTURE); - // } - // } - // if (getGameTimeLeft() == 45) { - // if (!p.getLocation().getWorld().getEnvironment().equals(Environment.THE_END)) { - // p.setGameMode(GameMode.SURVIVAL); - // } - // if (!broadcast1) { - // Bukkit.broadcastMessage("§aEs geht Los!"); - // Bukkit.broadcastMessage("Genießt die 10 minütige Schutzzeit."); - // } - // broadcast1 = true; - // } - // if (getGameTimeLeft() == 35) { - // if (!broadcast2) { - // Bukkit.broadcastMessage("Die Schutzzeit ist nur vorbei."); - // } - // broadcast2 = true; - // } - // } - // } - // if (isPlayTimeOver()) { - // for (final Player p : Bukkit.getOnlinePlayers()) { - // p.kickPlayer(plugin.getLangUtils().get("Service.KickPlayTimeOver")); - // } - // this.cancel(); - // } - // } - // }.runTaskTimer(this.plugin, 20l, 20l); - // } private void startPlayTimeTimer() { new BukkitRunnable() { @Override diff --git a/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java b/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java index 3b1aba5..758165e 100644 --- a/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java +++ b/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java @@ -44,6 +44,10 @@ public class PlayerUtils { p.removePotionEffect(PotionEffectType.BLINDNESS); p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, seconds * 20, 1, false, false)); + p.setPlayerListHeaderFooter("§b------------------------------\n" + + this.plugin.getLangUtils().get("Service.LoadingTitle") + "\n§b------------------------------\n§r ", + "§7§o\npowered by Cliffbreak.de"); + final BukkitTask hidePlayersTask = new BukkitRunnable() { @Override public void run() {