Skip to content

Commit c3523ad

Browse files
authored
Merge branch 'main' into 4-add-mail-functionality
2 parents 4ed6241 + 8d7831f commit c3523ad

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<plugin>
3131
<groupId>org.apache.maven.plugins</groupId>
3232
<artifactId>maven-shade-plugin</artifactId>
33-
<version>3.5.3</version>
33+
<version>3.6.0</version>
3434
<executions>
3535
<execution>
3636
<phase>package</phase>
@@ -46,7 +46,7 @@
4646
<plugin>
4747
<groupId>org.apache.maven.plugins</groupId>
4848
<artifactId>maven-javadoc-plugin</artifactId>
49-
<version>3.6.3</version>
49+
<version>3.10.1</version>
5050
<configuration>
5151
<links>
5252
<link>https://jd.papermc.io/paper/1.20/</link>

src/main/java/pro/cloudnode/smp/cloudnodemsg/PluginConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,13 @@ public int mailNotifyInterval() {
498498
);
499499
}
500500

501+
/**
502+
* You are trying to ignore yourself
503+
*/
504+
public @NotNull Component ignoreYourself() {
505+
return MiniMessage.miniMessage().deserialize(Objects.requireNonNull(config.getString("errors.ignore-yourself")));
506+
}
507+
501508
/**
502509
* Target player has never joined the server
503510
* <p>Placeholders:</p>

src/main/java/pro/cloudnode/smp/cloudnodemsg/command/IgnoreCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public boolean run(final @NotNull CommandSender sender, final @NotNull String la
2626
if (!(sender instanceof final @NotNull Player player)) return new NotPlayerError().send(sender);
2727
if (args.length == 0) return sendMessage(player, CloudnodeMSG.getInstance().config().usage(label, usage));
2828
final @NotNull OfflinePlayer target = CloudnodeMSG.getInstance().getServer().getOfflinePlayer(args[0]);
29+
if (target.getUniqueId().equals(player.getUniqueId())) return sendMessage(player, CloudnodeMSG.getInstance().config().ignoreYourself());
2930
if (Message.isIgnored(player, target)) return unignore(player, target);
3031
return ignore(player, target);
3132
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package pro.cloudnode.smp.cloudnodemsg.error;
2+
3+
import pro.cloudnode.smp.cloudnodemsg.CloudnodeMSG;
4+
5+
public final class IgnoreYourselfError extends Error {
6+
public IgnoreYourselfError() {
7+
super(CloudnodeMSG.getInstance().config().ignoreYourself());
8+
}
9+
}

src/main/resources/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ errors:
190190
# <player> - the player's username
191191
cannot-ignore: "<red>(!) You cannot ignore <gray><player></gray>.</red>"
192192

193+
# You are trying to ignore yourself
194+
ignore-yourself: "<red>(!) You cannot ignore yourself.</red>"
195+
193196
# Target player has never joined the server
194197
# Placeholders:
195198
# <player> - the player's username

0 commit comments

Comments
 (0)