File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
balancer/src/main/java/com/jaimemartz/playerbalancer/commands Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -35,19 +35,10 @@ public void execute(CommandSender sender, String[] args) {
3535 String input = args [1 ];
3636 ServerSection section = plugin .getSectionManager ().getByName (input );
3737 if (section != null ) {
38- if (args .length == 3 ) {
39- ProxiedPlayer player = plugin .getProxy ().getPlayer (args [2 ]);
40- if (player != null ) {
41- ConnectionIntent .simple (plugin , player , section );
42- } else {
43- sender .sendMessage (new ComponentBuilder ("There is no player with that name connected to this proxy" ).color (ChatColor .RED ).create ());
44- }
38+ if (sender instanceof ProxiedPlayer ) {
39+ ConnectionIntent .simple (plugin , (ProxiedPlayer ) sender , section );
4540 } else {
46- if (sender instanceof ProxiedPlayer ) {
47- ConnectionIntent .simple (plugin , (ProxiedPlayer ) sender , section );
48- } else {
49- sender .sendMessage (new ComponentBuilder ("This command variant can only be executed by a player" ).color (ChatColor .RED ).create ());
50- }
41+ sender .sendMessage (new ComponentBuilder ("This command variant can only be executed by a player" ).color (ChatColor .RED ).create ());
5142 }
5243 } else {
5344 MessageUtils .send (sender , plugin .getSettings ().getMessagesProps ().getUnknownSectionMessage ());
You can’t perform that action at this time.
0 commit comments