forked from zhdev/griefus
Add MiniMessage support to CoreProtectAPI chat logger
This commit is contained in:
parent
c5bfb3c0d9
commit
2c91899055
1 changed files with 25 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
@ -235,6 +236,30 @@ public class CoreProtectAPI extends Queue {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs a componentized chat message for a player.
|
||||||
|
*
|
||||||
|
* @param player
|
||||||
|
* The player who sent the message
|
||||||
|
* @param component
|
||||||
|
* The chat message
|
||||||
|
* @return True if the message was logged
|
||||||
|
*/
|
||||||
|
public boolean logChat(Player player, Component component) {
|
||||||
|
if (!isEnabledForPlayer(player) || !Config.getConfig(player.getWorld()).PLAYER_MESSAGES) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (component == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
long timestamp = System.currentTimeMillis() / 1000L;
|
||||||
|
// TODO: proper implementation
|
||||||
|
Queue.queuePlayerChat(player, component.insertion(), timestamp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs a command executed by a player.
|
* Logs a command executed by a player.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue