|
5 | 5 | import org.bukkit.entity.Player; |
6 | 6 | import org.bukkit.scoreboard.Scoreboard; |
7 | 7 |
|
| 8 | +import java.util.UUID; |
| 9 | + |
8 | 10 | public interface CloudChatApi { |
9 | 11 |
|
10 | 12 | default Scoreboard getVanillaScoreboard() { |
11 | 13 | return Bukkit.getScoreboardManager().getMainScoreboard(); |
12 | 14 | } |
13 | 15 |
|
| 16 | + // creation |
| 17 | + |
14 | 18 | default boolean createTeam(Player player) { |
15 | 19 | return this.createTeam(this.getVanillaScoreboard(), player); |
16 | 20 | } |
17 | 21 |
|
18 | | - boolean createTeam(Scoreboard scoreboard, Player player); |
| 22 | + default boolean createTeam(Scoreboard scoreboard, Player player) { |
| 23 | + return this.createTeam(scoreboard, player.getUniqueId(), player.getName()); |
| 24 | + } |
| 25 | + |
| 26 | + default boolean createTeam(UUID playerId, String username) { |
| 27 | + return this.createTeam(this.getVanillaScoreboard(), playerId, username); |
| 28 | + } |
| 29 | + |
| 30 | + boolean createTeam(Scoreboard scoreboard, UUID playerId, String username); |
| 31 | + |
| 32 | + // removal |
19 | 33 |
|
20 | 34 | default boolean removeTeam(Player player) { |
21 | 35 | return this.removeTeam(this.getVanillaScoreboard(), player); |
22 | 36 | } |
23 | 37 |
|
24 | | - boolean removeTeam(Scoreboard scoreboard, Player player); |
| 38 | + default boolean removeTeam(Scoreboard scoreboard, Player player) { |
| 39 | + return this.removeTeam(scoreboard, player.getUniqueId(), player.getName()); |
| 40 | + } |
| 41 | + |
| 42 | + default boolean removeTeam(UUID playerId, String username) { |
| 43 | + return this.removeTeam(this.getVanillaScoreboard(), playerId, username); |
| 44 | + } |
| 45 | + |
| 46 | + boolean removeTeam(Scoreboard scoreboard, UUID playerId, String username); |
| 47 | + |
| 48 | + // updates |
25 | 49 |
|
26 | 50 | default boolean updateTeam(Player player) { |
27 | 51 | return this.updateTeam(this.getVanillaScoreboard(), player); |
28 | 52 | } |
29 | 53 |
|
30 | | - boolean updateTeam(Scoreboard scoreboard, Player player); |
| 54 | + default boolean updateTeam(Scoreboard scoreboard, Player player) { |
| 55 | + return this.updateTeam(scoreboard, player.getUniqueId(), player.getName()); |
| 56 | + } |
| 57 | + |
| 58 | + default boolean updateTeam(UUID playerId, String username) { |
| 59 | + return this.updateTeam(this.getVanillaScoreboard(), playerId, username); |
| 60 | + } |
| 61 | + |
| 62 | + boolean updateTeam(Scoreboard scoreboard, UUID playerId, String username); |
31 | 63 | } |
0 commit comments