Send message if plugin failed to find a headstone location
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user