Skip to content

Commit 52ceab7

Browse files
committed
fix(build): ✨ improve API key instructions and enhance module shutdown checks
1 parent ed341fc commit 52ceab7

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public boolean enable(@NotNull Module module, @Nullable CommandSender executor)
6060
if (m.getModuleName().equals(module.getModuleName()) && m.isEnabled())
6161
return false;
6262

63-
if (!module.getModuleName().equals("Common") && BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES, List.of()).contains(module.getModuleName())) {
63+
if (!module.getModuleName().equals("Common") && BuildTeamTools.getInstance().getConfig()
64+
.getStringList(ConfigPaths.DISABLED_MODULES).stream().anyMatch(module.getModuleName()::equalsIgnoreCase)) {
6465
module.shutdown("This module is disabled in the config.");
6566
} else {
6667
boolean containsDisabledDependencyModule = false;

src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,18 @@ public void enable() {
4848
return;
4949
}
5050

51-
if (!NetworkModule.getInstance().getBuildTeam().isConnected() || !Bukkit.getServerConfig().isProxyEnabled()) {
51+
if (!NetworkModule.getInstance().getBuildTeam().isConnected()) {
5252
shutdown("The Build Team have to be connected to the BtE Network (Proxy).");
5353
return;
5454
}
5555

56+
try {
57+
if (!Bukkit.getServerConfig().isProxyEnabled()) {
58+
shutdown("The Build Team have to be connected to the BtE Network (Proxy).");
59+
return;
60+
}
61+
} catch (NoSuchMethodError e) { /* it's fine - we assume proxy is enabled This Method only exist in 1.21.5+ */}
62+
5663
statsServer = new StatsServer();
5764
statsPlayerList = new HashMap<>();
5865

src/main/resources/config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
# | [Contacts - Discord] BTE Development Hub, @zoriot
77
# ----------------------------------------------------------------------------------------------
88

9-
# The Build Team API Key used to fetch build team info for display.
10-
# Find the key on the Minecraft Network at "buildtheearth.net". Navigate: Compass > Build Teams > My Teams > Your Team > API-Key.
11-
# Without this key, some plugin components wont function. For assistance, see #server-support on the staff discord.
9+
# The Build Team API Key used to fetch build team info for display. Find the key on the Minecraft Network at "buildtheearth.net".
10+
# Navigate: Compass > Build Teams > Your Country > Your Team → Edit > API-Key → Right click on it → Click on the api key in chat.
11+
# Without this key, some plugin components won`t function. For assistance, see #server-support on the staff discord -
12+
# you might need to be added as a owner first.
1213
api-key: 00000000-0000-0000-0000-000000000000
1314

1415
# The main world using the custom BTE Dynmaxion projection

0 commit comments

Comments
 (0)