1
mirror of https://github.com/Shiewk/SModeration.git synced 2026-04-29 06:34:17 +02:00

Notify player when they receive a punishment

This commit is contained in:
Shy
2024-06-08 11:18:40 +02:00
parent fe4e87d9b4
commit 56d705173e
3 changed files with 25 additions and 3 deletions
@@ -8,6 +8,7 @@ import de.shiewk.smoderation.util.TimeUtil;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import java.nio.ByteBuffer;
@@ -91,6 +92,18 @@ public class Punishment {
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()){
container.add(punishment);
punishment.firstIssue();
}
}
private void firstIssue(){
switch (type) {
case MUTE, BAN -> {
final CommandSender sender = PlayerUtil.senderByUUID(to);
if (sender != null) {
sender.sendMessage(playerMessage());
}
}
}
}