mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-05 06:28:48 +00:00
Add special handling for @s operator to support vanilla suggestions
This commit is contained in:
1 parent
50289d9ca5
commit
af91b224a0
1 file changed
+2
-2
@@ -41,8 +41,8 @@ public class TpCommand extends CommandBase implements TabCompletable, ConsoleExe
|
||||
plugin.getCache().updatePlayerListCache(plugin, onlineUser).join();
|
||||
final String playerToTeleport = plugin.getCache().players.stream()
|
||||
.filter(user -> user.equalsIgnoreCase(targetPlayerToTeleport)).findFirst()
|
||||
.or(() -> plugin.getCache().players.stream()
|
||||
.filter(user -> user.toLowerCase().startsWith(targetPlayerToTeleport)).findFirst())
|
||||
.or(() -> Optional.ofNullable(targetPlayerToTeleport.equals("@s") ? onlineUser.username : null))
|
||||
.or(() -> plugin.getCache().players.stream().filter(user -> user.toLowerCase().startsWith(targetPlayerToTeleport)).findFirst())
|
||||
.orElse(null);
|
||||
|
||||
// Ensure the player to teleport exists
|
||||
|
||||
Reference in new issue
Block a user