Skip to content

Commit ac5ffe3

Browse files
folia 1.20.1 dev
1 parent c57bada commit ac5ffe3

7 files changed

Lines changed: 18 additions & 19 deletions

File tree

pom.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55

66
<groupId>org.zeroBzeroT.chatCo</groupId>
77
<artifactId>ChatCoPlus</artifactId>
8-
<version>0.27.4</version>
8+
<version>1.0.0</version>
99
<packaging>jar</packaging>
1010
<name>${project.artifactId}</name>
1111

1212
<description>An efficient chat system with colored text, ignore list, whispering and chat logging.</description>
1313

1414
<properties>
15-
<java.version>1.8</java.version>
15+
<java.version>17</java.version>
1616
<maven.compiler.source>${java.version}</maven.compiler.source>
1717
<maven.compiler.target>${java.version}</maven.compiler.target>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<minecraft.version>1.20.1</minecraft.version>
1920
</properties>
2021

2122
<build>
@@ -92,8 +93,8 @@
9293
<repositories>
9394
<!-- This adds the Spigot Maven repository to the build -->
9495
<repository>
95-
<id>spigot-repo</id>
96-
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
96+
<id>papermc</id>
97+
<url>https://repo.papermc.io/repository/maven-public/</url>
9798
</repository>
9899
<repository>
99100
<id>codemc-repo</id>
@@ -104,10 +105,11 @@
104105

105106
<dependencies>
106107
<!--This adds the Spigot API artifact to the build -->
108+
<!-- folia api -->
107109
<dependency>
108-
<groupId>org.spigotmc</groupId>
109-
<artifactId>spigot-api</artifactId>
110-
<version>1.12.2-R0.1-SNAPSHOT</version>
110+
<groupId>dev.folia</groupId>
111+
<artifactId>folia-api</artifactId>
112+
<version>${minecraft.version}-R0.1-SNAPSHOT</version>
111113
<scope>provided</scope>
112114
</dependency>
113115
<dependency>

src/main/java/org/zeroBzeroT/chatCo/ChatPlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void saveIgnoreList(final String p) throws IOException {
4646
bwo.close();
4747
}
4848

49-
if (!p.equals("")) {
49+
if (!p.isEmpty()) {
5050
if (!this.isIgnored(p)) {
5151
final FileWriter fwo = new FileWriter(this.IgnoreList, true);
5252
final BufferedWriter bwo = new BufferedWriter(fwo);

src/main/java/org/zeroBzeroT/chatCo/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.bukkit.entity.Player;
99
import org.bukkit.plugin.PluginManager;
1010
import org.bukkit.plugin.java.JavaPlugin;
11+
import org.jetbrains.annotations.NotNull;
1112

1213
import java.io.File;
1314
import java.io.IOException;
@@ -114,7 +115,7 @@ private void saveResourceFiles() {
114115
}
115116
}
116117

117-
public boolean onCommand(final CommandSender sender, final Command cmd, final String commandLabel, final String[] args) {
118+
public boolean onCommand(final @NotNull CommandSender sender, final @NotNull Command cmd, final @NotNull String commandLabel, final String[] args) {
118119
if (sender instanceof Player) {
119120
if (cmd.getName().equalsIgnoreCase("togglechat") && getConfig().getBoolean("toggleChatEnabled", true)) {
120121
if (toggleChat((Player) sender)) {

src/main/java/org/zeroBzeroT/chatCo/PublicChat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void onPlayerChat(final AsyncPlayerChatEvent event) {
6868
legacyMessage = replaceInlineColors(legacyMessage, player);
6969

7070
// Do not send empty messages
71-
if (ChatColor.stripColor(legacyMessage).trim().length() == 0) {
71+
if (ChatColor.stripColor(legacyMessage).trim().isEmpty()) {
7272
event.setCancelled(true);
7373
return;
7474
}

src/main/java/org/zeroBzeroT/chatCo/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static TextComponent componentFromLegacyText(String legacyText) {
3535
TextComponent textComponent = null;
3636

3737
for (BaseComponent component : TextComponent.fromLegacyText(legacyText)) {
38-
if (component.toLegacyText().length() > 0) {
38+
if (!component.toLegacyText().isEmpty()) {
3939
if (textComponent == null)
4040
textComponent = (TextComponent) component;
4141
else

src/main/java/org/zeroBzeroT/chatCo/Whispers.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
2020
import static org.zeroBzeroT.chatCo.Utils.componentFromLegacyText;
2121
import static org.zeroBzeroT.chatCo.Utils.now;
2222

23-
public class Whispers implements Listener {
24-
public final Main plugin;
25-
26-
public Whispers(final Main plugin) {
27-
this.plugin = plugin;
28-
}
29-
23+
public record Whispers(Main plugin) implements Listener {
3024
@EventHandler(ignoreCancelled = true)
3125
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) {
3226
final String[] args = event.getMessage().split(" ");

src/main/resources/plugin.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: ChatCo
22
version: ${project.version}
33
main: org.zeroBzeroT.chatCo.Main
4+
api-version: 1.20
5+
folia-supported: true
6+
description: ${project.description}
47
authors:
58
- jj20051
69
- bierdosenhalter
7-
description: ${project.description}
810
commands:
911
togglechat:
1012
description: Enables or disables chat for the player.

0 commit comments

Comments
 (0)