Skip to content

Commit c0e08f5

Browse files
committed
Finished the manage command, now lets migrate the config system
1 parent 7b77f33 commit c0e08f5

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- [ ] Stop using inventivetalent's deprecated bungee-update
1313
- [ ] Create a spigot addon that adds connector signs and placeholders
1414
- [ ] Separate the types of connections in classes instead of being in ConnectionIntent
15-
- [ ] Make the plugin API not be so dependent on a instance of PlayerBalancer
15+
- [ ] Make the plugin API be not so dependent on a instance of PlayerBalancer
1616
- [ ] Separate connection providers in classes instead of being hardcoded in an enum
1717
- [ ] Make the feature `marker-descs` work per section
1818
- [ ] Add a identifier to get the servers of a section (auto complete)

src/main/java/com/jaimemartz/playerbalancer/commands/ManageCommand.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import net.md_5.bungee.api.plugin.Command;
1616
import org.apache.commons.lang3.StringUtils;
1717

18+
import java.util.Arrays;
1819
import java.util.Map;
1920

2021
public class ManageCommand extends Command {
@@ -138,11 +139,16 @@ public void execute(CommandSender sender, String[] args) {
138139
.append(section.getCommand().getName())
139140
.color(ChatColor.AQUA)
140141
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
141-
new ComponentBuilder("Extra Information: ") //todo implement this
142-
.create()
143-
)
144-
)
145-
.create()
142+
new ComponentBuilder("Permission: ")
143+
.color(ChatColor.GRAY)
144+
.append(section.getCommand().getPermission().equals("") ? "None" : section.getCommand().getPermission())
145+
.color(ChatColor.AQUA)
146+
.append("\nAliases: ")
147+
.color(ChatColor.GRAY)
148+
.append(Arrays.toString(section.getCommand().getAliases()))
149+
.color(ChatColor.AQUA)
150+
.create())
151+
).create()
146152
);
147153
} else {
148154
sender.sendMessage(new ComponentBuilder("Section Command: ")
@@ -159,15 +165,26 @@ public void execute(CommandSender sender, String[] args) {
159165
.create()
160166
);
161167

162-
//TODO show status when hovering over server
163168
section.getServers().forEach(server -> {
164169
ServerStatus status = plugin.getStatusManager().getStatus(server);
165170
sender.sendMessage(new ComponentBuilder("\u2022 Server: ")
166171
.color(ChatColor.GRAY)
167172
.append(server.getName())
168173
.color(ChatColor.AQUA)
169174
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
170-
new ComponentBuilder("This is a test\nThis is a test").create())) //todo implement this
175+
new ComponentBuilder("Accessible: ")
176+
.color(ChatColor.GRAY)
177+
.append(status.isAccessible() ? "yes" : "no")
178+
.color(status.isAccessible() ? ChatColor.GREEN : ChatColor.RED)
179+
.append("\nDescription: ")
180+
.color(ChatColor.GRAY)
181+
.append("\"")
182+
.color(ChatColor.AQUA)
183+
.append(status.getDescription())
184+
.color(ChatColor.WHITE)
185+
.append("\"")
186+
.color(ChatColor.AQUA)
187+
.create()))
171188
.append(String.format(" (%d/%d) ",
172189
status.getOnline(),
173190
status.getMaximum()))

0 commit comments

Comments
 (0)