Skip to content
This repository was archived by the owner on Dec 14, 2024. It is now read-only.

Commit 2b096df

Browse files
committed
1.2
1 parent 00e469c commit 2b096df

File tree

7 files changed

+42
-28
lines changed

7 files changed

+42
-28
lines changed

pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
<pattern>net.kyori</pattern>
8484
<shadedPattern>lol.hyper.partychat.adventure</shadedPattern>
8585
</relocation>
86+
<relocation>
87+
<pattern>space.arim.morepaperlib</pattern>
88+
<shadedPattern>lol.hyper.partychat.morepaperlib</shadedPattern>
89+
</relocation>
8690
</relocations>
8791
<createDependencyReducedPom>false</createDependencyReducedPom>
8892
</configuration>
@@ -103,13 +107,17 @@
103107
<id>spigotmc-repo</id>
104108
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
105109
</repository>
110+
<repository>
111+
<id>arim-mvn-lgpl3</id>
112+
<url>https://mvn-repo.arim.space/lesser-gpl3/</url>
113+
</repository>
106114
</repositories>
107115

108116
<dependencies>
109117
<dependency>
110118
<groupId>org.spigotmc</groupId>
111119
<artifactId>spigot-api</artifactId>
112-
<version>1.19-R0.1-SNAPSHOT</version>
120+
<version>1.20.1-R0.1-SNAPSHOT</version>
113121
<scope>provided</scope>
114122
</dependency>
115123
<dependency>
@@ -142,5 +150,11 @@
142150
<version>4.3.0</version>
143151
<scope>compile</scope>
144152
</dependency>
153+
<dependency>
154+
<groupId>space.arim.morepaperlib</groupId>
155+
<artifactId>morepaperlib</artifactId>
156+
<version>0.4.3</version>
157+
<scope>compile</scope>
158+
</dependency>
145159
</dependencies>
146160
</project>

src/main/java/lol/hyper/partychat/PartyChat.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.bukkit.configuration.file.FileConfiguration;
3535
import org.bukkit.configuration.file.YamlConfiguration;
3636
import org.bukkit.plugin.java.JavaPlugin;
37+
import space.arim.morepaperlib.MorePaperLib;
3738

3839
import java.io.File;
3940
import java.io.IOException;
@@ -61,10 +62,12 @@ public final class PartyChat extends JavaPlugin {
6162

6263
public final Set<Party> loadedParties = new HashSet<>();
6364
public final Set<Invite> invites = new HashSet<>();
65+
public MorePaperLib morePaperLib;
6466

6567
@Override
6668
public void onEnable() {
6769
this.adventure = BukkitAudiences.create(this);
70+
morePaperLib = new MorePaperLib(this);
6871
partyManagement = new PartyManagement(this);
6972
commandParty = new CommandParty(this);
7073
commandPartyChatMessage = new CommandPartyChatMessage(this);
@@ -77,15 +80,13 @@ public void onEnable() {
7780

7881
if (!partyFolder.toFile().exists()) {
7982
if (!partyFolder.toFile().mkdirs()) {
80-
logger.severe("Unable to create the party folder " + partyFolder
81-
+ "! Please manually create this folder because things will break!");
83+
logger.severe("Unable to create the party folder " + partyFolder + "! Please manually create this folder because things will break!");
8284
} else {
8385
logger.info("Creating parties folder for data storage.");
8486
}
8587
}
8688

87-
Bukkit.getScheduler().runTaskAsynchronously(this, this::checkForUpdates);
88-
89+
morePaperLib.scheduling().asyncScheduler().run(this::checkForUpdates);
8990

9091
if (!messagesFile.exists()) {
9192
this.saveResource("messages.yml", true);
@@ -123,14 +124,15 @@ public void checkForUpdates() {
123124
}
124125

125126
public BukkitAudiences getAdventure() {
126-
if(this.adventure == null) {
127+
if (this.adventure == null) {
127128
throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
128129
}
129130
return this.adventure;
130131
}
131132

132133
/**
133134
* Gets a message from messages.yml.
135+
*
134136
* @param path The path to the message.
135137
* @return Component with formatting applied.
136138
*/
@@ -145,6 +147,7 @@ public String getConfigMessage(String path) {
145147

146148
/**
147149
* Gets a message from messages.yml.
150+
*
148151
* @param path The path to the message.
149152
* @return Component with formatting applied.
150153
*/

src/main/java/lol/hyper/partychat/commands/CommandParty.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@
5050
import org.bukkit.entity.Player;
5151
import org.jetbrains.annotations.NotNull;
5252

53-
import java.util.*;
53+
import java.util.ArrayList;
54+
import java.util.Arrays;
55+
import java.util.List;
56+
import java.util.UUID;
5457

5558
public class CommandParty implements TabExecutor {
5659

@@ -365,22 +368,9 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
365368
}
366369

367370
@Override
368-
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String
369-
alias, String[] args) {
371+
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
370372
if (args.length == 1) {
371-
return Arrays.asList(
372-
"create",
373-
"invite",
374-
"accept",
375-
"deny",
376-
"kick",
377-
"leave",
378-
"disband",
379-
"info",
380-
"transfer",
381-
"help",
382-
"trust",
383-
"untrust");
373+
return Arrays.asList("create", "invite", "accept", "deny", "kick", "leave", "disband", "info", "transfer", "help", "trust", "untrust");
384374
}
385375
return null;
386376
}

src/main/java/lol/hyper/partychat/commands/CommandPartyChatMessage.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636

3737
import lol.hyper.partychat.PartyChat;
3838
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
39-
import net.kyori.adventure.text.minimessage.MiniMessage;
40-
import org.bukkit.command.*;
39+
import org.bukkit.command.Command;
40+
import org.bukkit.command.CommandSender;
41+
import org.bukkit.command.ConsoleCommandSender;
42+
import org.bukkit.command.TabExecutor;
4143
import org.bukkit.entity.Player;
4244
import org.jetbrains.annotations.NotNull;
4345

src/main/java/lol/hyper/partychat/party/Party.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
import org.json.JSONObject;
4545

4646
import java.io.File;
47-
import java.util.*;
47+
import java.util.HashSet;
48+
import java.util.Set;
49+
import java.util.UUID;
4850

4951
public class Party {
5052

@@ -215,8 +217,7 @@ public void invitePlayer(UUID sender, UUID receiver) {
215217
}
216218

217219
String sentInvite = partyChat.getConfigMessage("commands.invite.sent-invite").replace("%player1%", senderPlayer.getName()).replace("%player2%", receiverPlayer.getName());
218-
partyChat.logger.info(
219-
sender + " sent an invite to " + receiver + " for party " + partyID);
220+
partyChat.logger.info(sender + " sent an invite to " + receiver + " for party " + partyID);
220221
sendMessage(miniMessage.deserialize(sentInvite));
221222
}
222223

src/main/java/lol/hyper/partychat/tools/PartyManagement.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
import org.json.JSONObject;
2424

2525
import java.io.*;
26-
import java.util.*;
26+
import java.util.HashMap;
27+
import java.util.HashSet;
28+
import java.util.Set;
29+
import java.util.UUID;
2730

2831
public class PartyManagement {
2932

src/main/resources/plugin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ api-version: 1.13
55
author: hyperdefined
66
website: https://www.spigotmc.org/resources/partychat.88947/
77
description: A simple party chat plugin.
8+
folia-supported: true
89
commands:
910
party:
1011
description: The main party command.

0 commit comments

Comments
 (0)