Skip to content

Commit 746b6da

Browse files
committed
Update for API changes
1 parent 9c05018 commit 746b6da

9 files changed

Lines changed: 16 additions & 15 deletions

File tree

‎build.gradle.kts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
java
33
`maven-publish`
4-
id("com.gradleup.shadow") version "9.6.0"
4+
id("com.gradleup.shadow") version "9.6.1"
55
}
66

77
repositories {
@@ -57,6 +57,7 @@ tasks.shadowJar {
5757
archiveBaseName.set("Module-Guilds")
5858
archiveClassifier.set("")
5959
archiveVersion.set("")
60+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
6061
}
6162

6263
tasks.build {

‎gradle/wrapper/gradle-wrapper.jar‎

-957 Bytes
Binary file not shown.

‎gradle/wrapper/gradle-wrapper.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
44
networkTimeout=10000
55
retries=0
66
retryBackOffMs=500

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.plex;
22

33
import dev.plex.command.GuildCommand;
4-
import dev.plex.config.ModuleConfig;
4+
import dev.plex.api.config.ModuleConfiguration;
55
import dev.plex.guild.GuildHolder;
66
import dev.plex.handler.ChatHandlerImpl;
77
import dev.plex.handler.GuildMenuListener;
@@ -34,13 +34,13 @@ public class Guilds extends PlexModule
3434

3535
private GuildRepository guildRepository;
3636

37-
private ModuleConfig config;
37+
private ModuleConfiguration config;
3838

3939
@Override
4040
public void load()
4141
{
4242
module = this;
43-
config = new ModuleConfig(this, "config.yml", "config.yml");
43+
config = api().moduleConfigs().create(this, "config.yml");
4444
config.load();
4545
loadMessages("messages.yml");
4646
this.registerCommand(new GuildCommand());

‎src/main/java/dev/plex/command/sub/InfoSubCommand.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected Component execute(@NotNull CommandSender commandSender, @Nullable Play
5151
send(player, mmString("<gold>Prefix: " + (guild.getPrefix() == null ? "N/A" : guild.getPrefix())));
5252
send(player, mmString("<gold>Created At: " + formatter.format(guild.getCreatedAt())));
5353
}
54-
}, Guilds.get().api().scheduler().asyncExecutor());
54+
}, Guilds.get().scheduler().asyncExecutor());
5555
return null;
5656
}
5757

‎src/main/java/dev/plex/command/sub/WorldSubCommand.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ protected Component execute(@NotNull CommandSender commandSender, @Nullable Play
3838
{
3939
if (throwable != null)
4040
{
41-
Guilds.get().api().scheduler().executeGlobal(() ->
41+
Guilds.get().scheduler().executeGlobal(() ->
4242
{
4343
throwable.printStackTrace();
4444
send(player, messageComponent("guildWorldLoadFailed"));
4545
});
4646
return;
4747
}
48-
Guilds.get().api().scheduler().executeEntity(player, () -> teleport(player, world), 1L);
48+
Guilds.get().scheduler().executeEntity(player, () -> teleport(player, world), 1L);
4949
});
5050
}, () -> send(player, messageComponent("guildNotFound")));
5151
return null;

‎src/main/java/dev/plex/handler/GuildMenuListener.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ private void clickHome(Player player, Guild guild, int slot)
140140
{
141141
if (throwable != null)
142142
{
143-
Guilds.get().api().scheduler().executeGlobal(() -> player.sendMessage(Guilds.get().messageComponent("guildWorldLoadFailed")));
143+
Guilds.get().scheduler().executeGlobal(() -> player.sendMessage(Guilds.get().messageComponent("guildWorldLoadFailed")));
144144
return;
145145
}
146-
Guilds.get().api().scheduler().executeEntity(player, () -> player.teleportAsync(world.getSpawnLocation().toCenterLocation()), 1L);
146+
Guilds.get().scheduler().executeEntity(player, () -> player.teleportAsync(world.getSpawnLocation().toCenterLocation()), 1L);
147147
});
148148
return;
149149
}

‎src/main/java/dev/plex/storage/JdbiGuildRepository.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class JdbiGuildRepository implements GuildRepository
3939
public JdbiGuildRepository(ModuleStorage storage)
4040
{
4141
this.jdbi = storage.jdbi();
42-
this.executor = Guilds.get().api().scheduler().asyncExecutor();
42+
this.executor = Guilds.get().scheduler().asyncExecutor();
4343
this.guildsTable = storage.table("guilds");
4444
this.membersTable = storage.table("members");
4545
this.warpsTable = storage.table("warps");

‎src/main/java/dev/plex/world/AspGuildWorldService.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public CompletableFuture<World> ensureWorld(Guild guild)
5353
return CompletableFuture.completedFuture(aspLoadedWorld.getBukkitWorld());
5454
}
5555

56-
return CompletableFuture.supplyAsync(() -> readOrCreateWorld(guild), Guilds.get().api().scheduler().asyncExecutor())
56+
return CompletableFuture.supplyAsync(() -> readOrCreateWorld(guild), Guilds.get().scheduler().asyncExecutor())
5757
.thenCompose(slimeWorld -> loadWorld(guild, slimeWorld))
5858
.thenApply(world ->
5959
{
@@ -71,7 +71,7 @@ public void saveWorld(Guild guild)
7171
{
7272
return;
7373
}
74-
CompletableFuture.runAsync(() -> saveLoadedWorld(loadedWorld), Guilds.get().api().scheduler().asyncExecutor());
74+
CompletableFuture.runAsync(() -> saveLoadedWorld(loadedWorld), Guilds.get().scheduler().asyncExecutor());
7575
}
7676

7777
@Override
@@ -82,7 +82,7 @@ public void ejectNonMembers(Guild guild)
8282
{
8383
return;
8484
}
85-
Guilds.get().api().scheduler().executeGlobal(() ->
85+
Guilds.get().scheduler().executeGlobal(() ->
8686
{
8787
World fallback = Bukkit.getWorlds().getFirst();
8888
loadedWorld.getBukkitWorld().getPlayers().stream()
@@ -126,7 +126,7 @@ private SlimeWorld readOrCreateWorld(Guild guild)
126126
private CompletableFuture<World> loadWorld(Guild guild, SlimeWorld slimeWorld)
127127
{
128128
CompletableFuture<World> future = new CompletableFuture<>();
129-
Guilds.get().api().scheduler().executeGlobal(() ->
129+
Guilds.get().scheduler().executeGlobal(() ->
130130
{
131131
try
132132
{

0 commit comments

Comments
 (0)