From c600ab92428690cf751412247efe52c519f73dd7 Mon Sep 17 00:00:00 2001 From: Trixkz Date: Fri, 27 Oct 2023 10:58:13 -0400 Subject: [PATCH] Updates And Started On The Scoreboard Management System --- .../eventcore/listeners/StaffModeListener.java | 1 + .../loganmagnan/eventcore/managers/event/Event.java | 2 +- .../eventcore/managers/event/EventManager.java | 5 ++--- .../eventcore/scoreboard/ScoreboardProvider.java | 12 +++++++++--- .../com/loganmagnan/eventcore/utils/Constants.java | 4 ++++ src/main/resources/config.yml | 1 + 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java b/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java index ca58176..5899d4b 100644 --- a/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java +++ b/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java @@ -1,6 +1,7 @@ package com.loganmagnan.eventcore.listeners; import com.loganmagnan.eventcore.EventCore; +import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.entity.Entity; import org.bukkit.entity.HumanEntity; diff --git a/src/main/java/com/loganmagnan/eventcore/managers/event/Event.java b/src/main/java/com/loganmagnan/eventcore/managers/event/Event.java index 746ce24..9e035b9 100644 --- a/src/main/java/com/loganmagnan/eventcore/managers/event/Event.java +++ b/src/main/java/com/loganmagnan/eventcore/managers/event/Event.java @@ -26,7 +26,7 @@ public class Event { private List teamSpawnPoints; - private int duration; + private String duration; private boolean scoreboardEnabled; private boolean timerEnabled; diff --git a/src/main/java/com/loganmagnan/eventcore/managers/event/EventManager.java b/src/main/java/com/loganmagnan/eventcore/managers/event/EventManager.java index b6bd146..5360761 100644 --- a/src/main/java/com/loganmagnan/eventcore/managers/event/EventManager.java +++ b/src/main/java/com/loganmagnan/eventcore/managers/event/EventManager.java @@ -8,7 +8,6 @@ import lombok.Getter; import lombok.Setter; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; - import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -73,7 +72,7 @@ public class EventManager { this.config.getInt("EVENT.AMOUNT-OF-TEAMS"), this.config.getInt("EVENT.AMOUNT-PER-TEAM"), teamSpawnPoints, - this.config.getInt("EVENT.DURATION"), + this.config.getString("EVENT.DURATION"), this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.SCOREBOARD-ENABLED"), this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.TIMER-ENABLED"), this.config.getBoolean("EVENT.TOGGLEABLE-OPTIONS.EVENTS.BLOCK-PLACE.CANCELLED"), @@ -90,7 +89,7 @@ public class EventManager { 2, 10, new ArrayList(), - 600, + "10m", true, true, false, diff --git a/src/main/java/com/loganmagnan/eventcore/scoreboard/ScoreboardProvider.java b/src/main/java/com/loganmagnan/eventcore/scoreboard/ScoreboardProvider.java index 08ff23f..fc3b1ea 100644 --- a/src/main/java/com/loganmagnan/eventcore/scoreboard/ScoreboardProvider.java +++ b/src/main/java/com/loganmagnan/eventcore/scoreboard/ScoreboardProvider.java @@ -7,6 +7,7 @@ import com.loganmagnan.eventcore.EventCore; import com.loganmagnan.eventcore.playerdata.PlayerData; import com.loganmagnan.eventcore.playerdata.PlayerSettings; import com.loganmagnan.eventcore.utils.ColorUtils; +import com.loganmagnan.eventcore.utils.Constants; import org.bukkit.entity.Player; import org.bukkit.scoreboard.Scoreboard; import java.util.ArrayList; @@ -19,7 +20,7 @@ public class ScoreboardProvider implements BoardAdapter { @Override public String getTitle(Player player) { - return ColorUtils.getMessageType("&b&lEvent Core"); + return ColorUtils.getMessageType("&b&l" + this.main.getEventManager().getEvent().getName()); } @Override @@ -53,8 +54,13 @@ public class ScoreboardProvider implements BoardAdapter { List lines = new ArrayList<>(); lines.add(ColorUtils.getMessageType("")); - lines.add(ColorUtils.getMessageType("&b&l" + player.getName())); - lines.add(ColorUtils.getMessageType("&7┃ &fOnline: &b" + this.main.getServer().getOnlinePlayers())); + lines.add(ColorUtils.getMessageType("&b┏ &b&l" + player.getName())); + lines.add(ColorUtils.getMessageType("&b┕ &fOnline: &b" + this.main.getServer().getOnlinePlayers().size())); + lines.add(ColorUtils.getMessageType("")); + lines.add(ColorUtils.getMessageType("&b┏ &b&lEvent Information")); + lines.add(ColorUtils.getMessageType("&b┕ &fTeams: &b" + this.main.getEventManager().getEvent().getTeams().size())); + lines.add(ColorUtils.getMessageType("")); + lines.add(ColorUtils.getMessageType("&7&o" + Constants.INFORMATION.get("server-ip-address"))); return lines; } diff --git a/src/main/java/com/loganmagnan/eventcore/utils/Constants.java b/src/main/java/com/loganmagnan/eventcore/utils/Constants.java index 51fdf70..9338e8b 100644 --- a/src/main/java/com/loganmagnan/eventcore/utils/Constants.java +++ b/src/main/java/com/loganmagnan/eventcore/utils/Constants.java @@ -11,6 +11,7 @@ public class Constants { public static Map> LISTENER_MESSAGES = new HashMap>(); public static Map> CHAT_MANAGEMENT_MESSAGES = new HashMap>(); public static Map> STAFF_MANAGEMENT_MESSAGES = new HashMap>(); + public static Map INFORMATION = new HashMap(); public static Map PERMISSION_NODES = new HashMap(); public Constants() { @@ -46,6 +47,9 @@ public class Constants { STAFF_MANAGEMENT_MESSAGES.put("vanish.enabled", Collections.singletonList(this.main.getMessagesConfig().getConfig().getString("MESSAGES.STAFF-MANAGEMENT.VANISH.ENABLED"))); STAFF_MANAGEMENT_MESSAGES.put("vanish.disabled", Collections.singletonList(this.main.getMessagesConfig().getConfig().getString("MESSAGES.STAFF-MANAGEMENT.VANISH.DISABLED"))); + // Information + INFORMATION.put("server-ip-address", this.main.getMainConfig().getConfig().getString("SERVER-IP-ADDRESS")); + // Permission Nodes PERMISSION_NODES.put("chat.bypass", this.main.getMainConfig().getConfig().getString("PERMISSION-NODES.CHAT-BYPASS")); PERMISSION_NODES.put("staff-mode.bypass", this.main.getMainConfig().getConfig().getString("PERMISSION-NODES.STAFF-MODE-BYPASS")); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index cf63715..7161839 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -16,5 +16,6 @@ MONGO: CONNECTION-STRING: "" DATABASE-NAME: "" +SERVER-IP-ADDRESS: "dev.loganmagnan.com" PERMISSION-NODES: CHAT-BYPASS: "eventcore.chat.bypass" \ No newline at end of file