feat: added in-game debug messages
This commit is contained in:
parent
8cc19c68c6
commit
cbbccbda99
@ -0,0 +1,32 @@
|
||||
package ru.dragonestia.msb3.api.util;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.minestom.server.entity.Player;
|
||||
|
||||
@UtilityClass
|
||||
public class DebugMessage {
|
||||
|
||||
private final boolean disabled = !Env.bool("MSB3_DEBUG").orElse(false);
|
||||
|
||||
public void send(Player player, String message) {
|
||||
if (disabled) return;
|
||||
|
||||
player.sendMessage(Component.text()
|
||||
.append(Component.text("[DEBUG] ", TextColor.color(0xFFC909), TextDecoration.BOLD))
|
||||
.append(Component.text(message, TextColor.color(0xFFD297)))
|
||||
.build());
|
||||
}
|
||||
|
||||
public void sendError(Player player, String message) {
|
||||
if (disabled) return;
|
||||
|
||||
player.sendMessage(Component.text()
|
||||
.append(Component.text("[DEBUG] ", TextColor.color(0xFFC909), TextDecoration.BOLD))
|
||||
.append(Component.text("Error: ", TextColor.color(0xFF3F3F)))
|
||||
.append(Component.text(message, TextColor.color(0xFF6A6B)))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user