Compare commits
No commits in common. "6cb0f04170530fd6e3b1f79f838b55254d7574bb" and "26971e75bbdf16532d0042ba82e59205f8c358c9" have entirely different histories.
6cb0f04170
...
26971e75bb
5 changed files with 18 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,4 +4,3 @@ test_server/
|
|||
build/
|
||||
server/
|
||||
bin/
|
||||
bin/*
|
||||
|
|
7
bin/main/paper-plugin.yml
Normal file
7
bin/main/paper-plugin.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
api-version: "1.21"
|
||||
name: CivilCore
|
||||
version: 0.1.0
|
||||
main: rip.iwakura.civil.Core
|
||||
authors:
|
||||
- hex
|
||||
- grng
|
BIN
bin/main/rip/iwakura/civil/Core.class
Normal file
BIN
bin/main/rip/iwakura/civil/Core.class
Normal file
Binary file not shown.
|
@ -47,27 +47,24 @@ public class Core extends JavaPlugin {
|
|||
.color(NamedTextColor.BLUE)
|
||||
.decoration(TextDecoration.BOLD, true)
|
||||
.append(Component.text(" Discord", NamedTextColor.BLUE).decoration(TextDecoration.BOLD, false)
|
||||
.appendSpace()
|
||||
.append(Component.text(author.getName())
|
||||
.append(Component.text(": "))
|
||||
.append(Component.text(message))
|
||||
.color(NamedTextColor.WHITE).decoration(TextDecoration.BOLD, false)));
|
||||
.appendSpace()
|
||||
.append(Component.text(author.getName())
|
||||
.append(Component.text(": "))
|
||||
.append(Component.text(message))
|
||||
.color(NamedTextColor.WHITE).decoration(TextDecoration.BOLD, false)));
|
||||
}
|
||||
|
||||
|
||||
public void sendTeamMessage(CivilPlayer author, Component message) throws SQLException {
|
||||
Component deserializedMessage = renderTeamChat(author, message);
|
||||
discord.sendMessage(author, PlainTextComponentSerializer.plainText().serialize(message));
|
||||
for (CivilPlayer member : database.getAllPlayers(author.getTeam())) {
|
||||
try {
|
||||
Player player = Bukkit.getPlayer(member.getName());
|
||||
Player player = Bukkit.getPlayer(member.getName());
|
||||
|
||||
if (player == null || !player.isOnline())
|
||||
continue;
|
||||
|
||||
player.sendMessage(deserializedMessage);
|
||||
} catch (Exception e) {
|
||||
if (!player.isOnline())
|
||||
continue;
|
||||
}
|
||||
|
||||
player.sendMessage(deserializedMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ public class Team {
|
|||
try {
|
||||
CivilPlayer p = database.getPlayer((Player) sender);
|
||||
|
||||
core.sendTeamMessage(p, MiniMessage.miniMessage().deserialize(message));
|
||||
core.sendTeamMessage(p, message);
|
||||
|
||||
return Command.SINGLE_SUCCESS;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue