Skip to content

Commit dabde08

Browse files
authored
Merge pull request #38 from Antideveloppeur/fix/commands
Fix execution of the velocity send command from the console
2 parents 3347c18 + bc96a0b commit dabde08

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

catalyst-velocity/src/main/java/org/anvilpowered/catalyst/velocity/command/VelocitySendCommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public void execute(CommandSource source, @NonNull String[] args) {
7575
TextComponent.of(player.get().getUsername()
7676
+ " is already connected to that server.")));
7777
} else {
78-
Player sender = (Player) source;
7978
source.sendMessage(
8079
pluginInfo.getPrefix().append(
8180
TextComponent.of("sending " + player.get().getUsername()
@@ -84,7 +83,7 @@ public void execute(CommandSource source, @NonNull String[] args) {
8483
pluginInfo.getPrefix().append(
8584
TextComponent.of("you have been sent to "
8685
+ server.get().getServerInfo().getName()
87-
+ " by " + sender.getUsername())));
86+
+ " by " + (source instanceof Player ? ((Player) source).getUsername() : "Console"))));
8887
player.get().createConnectionRequest(server.get()).fireAndForget();
8988
}
9089
} else {

0 commit comments

Comments
 (0)