restyled team chat (buggy do not use)

This commit is contained in:
grng 2024-07-25 10:32:25 +01:00
parent ec97defd6a
commit 160677ff82
4 changed files with 14 additions and 4 deletions

2
db.ps1 Normal file
View file

@ -0,0 +1,2 @@
docker-compose up
docker ps

8
docker-compose.yml Normal file
View file

@ -0,0 +1,8 @@
version: '3'
services:
civil_test_db:
environment:
- POSTGRES_PASSWORD=TEST123
image: postgres:16.3
ports:
- 5432:5432

View file

@ -13,7 +13,7 @@
<groupId>rip.iwakura</groupId>
<artifactId>CivilCore</artifactId>
<version>0.1a</version>
<version>0.1b</version>
<repositories>
<repository>

View file

@ -30,11 +30,11 @@ public class PlayerHandler implements Listener {
boolean inTeamChat = civilCore.teamChatRegister.contains(p);
DbPlayer dbPlayer = civilCore.db.getPlayerByName(player_name);
String prefix = (inTeamChat ? ChatColor.DARK_BLUE + "TC " + ChatColor.RESET : "")
String prefix = (inTeamChat ? ChatColor.DARK_GREEN + "TEAM >" + ChatColor.RESET : "")
+ (dbPlayer.team.prefix == null ?
"" :
ChatColor.translateAlternateColorCodes('&', "[" + dbPlayer.team.prefix + "]") + " ");
String message = String.format("%s%s: %s", prefix, player_name, e.getMessage());
ChatColor.translateAlternateColorCodes('&', inTeamChat ? "" : "[" + dbPlayer.team.prefix + "]"));
String message = String.format("%s %s: %s", prefix, player_name, e.getMessage());
if (!inTeamChat) {
Bukkit.broadcastMessage(message);