Send message if plugin failed to find a headstone location

This commit is contained in:
Sebastian Beckmann
2025-11-12 12:28:42 +01:00
parent f092dd61b6
commit b8275d81c5
2 changed files with 9 additions and 0 deletions

View File

@@ -212,6 +212,7 @@ public class Headstone {
return block.getLocation(); return block.getLocation();
} }
} }
Message.sendBroadcast("&4 Could not create headstone for the most recent death of " + owner.getName() + "!");
return null; return null;
} }

View File

@@ -1,5 +1,8 @@
package tk.alex3025.headstones.utils; package tk.alex3025.headstones.utils;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -61,6 +64,11 @@ public class Message {
Message.sendMessage(sender, prefix + " " + message); Message.sendMessage(sender, prefix + " " + message);
} }
public static void sendBroadcast(String message) {
TextComponent component = LegacyComponentSerializer.legacyAmpersand().deserialize(message);
Bukkit.broadcast(component);
}
public static String getTranslation(String key) { public static String getTranslation(String key) {
return Headstones.getInstance().getMessages().getString(key); return Headstones.getInstance().getMessages().getString(key);
} }