Skip to content

Commit 45f8936

Browse files
committed
Update for Plex 2.0
1 parent c44fccc commit 45f8936

25 files changed

Lines changed: 355 additions & 394 deletions

build.gradle.kts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ repositories {
1616
}
1717

1818
dependencies {
19-
compileOnly("org.projectlombok:lombok:1.18.38")
20-
annotationProcessor("org.projectlombok:lombok:1.18.38")
21-
compileOnly("io.papermc.paper:paper-api:1.21.7-R0.1-SNAPSHOT")
22-
implementation("org.apache.commons:commons-lang3:3.17.0")
23-
compileOnly("dev.plex:server:1.5")
24-
compileOnly("org.json:json:20250517")
25-
implementation("org.jetbrains:annotations:26.0.2")
19+
compileOnly("org.projectlombok:lombok:1.18.46")
20+
annotationProcessor("org.projectlombok:lombok:1.18.46")
21+
compileOnly("io.papermc.paper:paper-api:26.1.2.build.+")
22+
implementation("org.apache.commons:commons-lang3:3.20.0")
23+
compileOnly("dev.plex:api:2.0-SNAPSHOT")
24+
compileOnly("org.json:json:20251224")
25+
implementation("org.jetbrains:annotations:26.1.0")
2626
}
2727

2828
group = "dev.plex"
29-
version = "1.5"
29+
version = "2.0-SNAPSHOT"
3030
description = "The Guilds module for Plex"
3131

3232
java {
33-
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
33+
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
3434
}
3535

3636
publishing {

gradle/wrapper/gradle-wrapper.jar

4.76 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
44
networkTimeout=10000
5+
retries=0
6+
retryBackOffMs=500
57
validateDistributionUrl=true
68
zipStoreBase=GRADLE_USER_HOME
79
zipStorePath=wrapper/dists

gradlew

Lines changed: 5 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 10 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/dev/plex/Guilds.java

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import dev.plex.data.SQLManager;
77
import dev.plex.guild.GuildHolder;
88
import dev.plex.module.PlexModule;
9-
import dev.plex.util.PlexLog;
109
import lombok.Getter;
1110

1211
@Getter
@@ -25,6 +24,8 @@ public void load()
2524
module = this;
2625
config = new ModuleConfig(this, "guilds/config.yml", "config.yml");
2726
config.load();
27+
loadMessages("guilds/messages.yml");
28+
this.registerCommand(new GuildCommand());
2829
}
2930

3031
@Override
@@ -34,56 +35,29 @@ public void enable()
3435
sqlGuildManager = new SQLGuildManager();
3536
sqlGuildManager.getGuilds().whenComplete((guilds, throwable) ->
3637
{
37-
PlexLog.debug("Finished loading {0} guilds", guilds.size());
38+
if (throwable != null)
39+
{
40+
getLogger().error("Failed to load guilds", throwable);
41+
return;
42+
}
43+
if (guilds == null)
44+
{
45+
getLogger().error("Failed to load guilds");
46+
return;
47+
}
48+
api().logging().debug("Finished loading {0} guilds", guilds.size());
3849
guilds.forEach(guildHolder::addGuild);
39-
this.registerCommand(new GuildCommand());
4050
});
41-
42-
//Plex.get().setChat(new ChatHandlerImpl());
43-
44-
addDefaultMessage("guildsHelpCommand", "<gradient:gold:yellow>======</gradient>Guild Menu<gradient:gold:yellow>======</gradient><newline><newline>{0}", "0 - The commands list");
45-
addDefaultMessage("guildsCommandDisplay", "<gold>{0} <yellow>{1}", "0 - The command name", "1 - The command description");
46-
addDefaultMessage("guildCommandNotFound", "<red>'<gold>{0}</gold>'<red> is not a valid sub command!", "0 - The sub command");
47-
addDefaultMessage("guildNotFound", "<red>You're currently not a part of a guild!");
48-
addDefaultMessage("guildInThis", "<red>You're currently a part of this guild!");
49-
addDefaultMessage("alreadyInGuild", "<red>You're currently in a guild. Please do <gold>/guild leave<red> if you're a member, or if you're an owner with members, <gold>/guild promote <player><red> then <gold>/guild leave<red>, or just an owner, <gold>/guild disband<red>.");
50-
addDefaultMessage("guildNotOwner", "<red>You're not the owner of this guild!");
51-
addDefaultMessage("guildMemberNotFound", "<red>This guild member could not be found!");
52-
addDefaultMessage("guildOwnerSet", "<green>You have successfully promoted <dark_green>{0}<green> to be the new guild owner. You have been set to a default guild member.");
53-
54-
addDefaultMessage("guildPrefixSet", "<green>You have changed the guild prefix to '<gold>{0}</gold><green>'", "0 - The new prefix");
55-
addDefaultMessage("guildPrefixCleared", "<green>Your guild's prefix has been cleared.");
56-
57-
addDefaultMessage("guildWarpAlphanumeric", "<red>Warp names may only contain alphabetical and/or numerical characters.");
58-
addDefaultMessage("guildWarpExists", "<red>'<gold>{0}</gold>'<red> is already an existing warp!", "0 - The warp name");
59-
addDefaultMessage("guildWarpNotFound", "<red>'<gold>{0}</gold>'<red> is not a valid warp!", "0 - The warp name");
60-
addDefaultMessage("guildWarpCreated", "<green>You have created a warp called '<dark_green>{0}</dark_green><green>'", "0 - The warp name");
61-
62-
addDefaultMessage("guildHomeRemoved", "<green>You have removed the guild's home!");
63-
addDefaultMessage("guildHomeSet", "<green>You have changed the guild's home!");
64-
addDefaultMessage("guildHomeNotFound", "<red>This guild currently has no home set.");
65-
66-
addDefaultMessage("guildChatMessage", "<blue>[GUILD] <aqua>{0} <yellow>{1}", "0 - The player name", "1 - The message");
67-
addDefaultMessage("guildChatToggled", "<green>Your chat has been toggled {0}", "0 - On / Off");
68-
addDefaultMessage("guildChatConsoleLog", "<blue>[GUILD - {0}:{1}] <aqua>{2} <yellow>{3}", "0 - The guild name", "1 - The guild unique identifier", "2 - The player name", "3 - The message");
69-
70-
addDefaultMessage("guildNoInvite", "<red>You don't have any pending invitations!");
71-
addDefaultMessage("guildNotValidInvite", "<red>You don't have an invite from this guild!");
72-
addDefaultMessage("guildInviteExists", "<red>You've already sent an invite to this person!");
73-
addDefaultMessage("guildInviteSent", "<green>You have sent an invite to <dark_green>{0}", "0 - The invitee");
74-
addDefaultMessage("guildInviteReceived", "<gold>You have received an invite from <yellow>{0}<gold> for the guild <yellow>{1}<newline><newline><green><bold><click:run_command:/guild invite accept {1}>[ACCEPT]<newline><newline><!bold><gold>You may also run <yellow>/guild invite accept {1}<gold> to accept this invite. It will expire in 5 minutes", "0 - The inviter", "1 - The guild name");
75-
addDefaultMessage("guildMemberJoined", "<green>{0} has joined the guild!", "0 - The player who joined");
76-
addDefaultMessage("guildMemberLeft", "<green>{0} has left the guild!", "0 - The player who left");
77-
addDefaultMessage("guildDisbandNeeded", "<red>You need to disband your guild using <gold>/guild disband<red> or promote a new owner using <gold>/guild owner <player>");
78-
addDefaultMessage("guildAutoDisbanded", "<green>Auto-disbanding your guild since there were no members");
7951
}
8052

8153
@Override
8254
public void disable()
8355
{
8456
// Unregistering listeners / commands is handled by Plex
85-
this.getGuildHolder().getGuilds().forEach(sqlGuildManager::updateGuild);
86-
//this.getPlex().setChat(new ChatListener.PlexChatRenderer());
57+
if (sqlGuildManager != null)
58+
{
59+
this.getGuildHolder().getGuilds().forEach(sqlGuildManager::updateGuild);
60+
}
8761
}
8862

8963
public static Guilds get()

0 commit comments

Comments
 (0)