Block tab complete if player is not logged
This commit is contained in:
parent
f583d70d1a
commit
71b7aff0dd
@ -5,10 +5,12 @@ import com.glyart.authmevelocity.proxy.event.ProxyLoginEvent;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.velocitypowered.api.event.Subscribe;
|
||||
import com.velocitypowered.api.event.command.CommandExecuteEvent;
|
||||
import com.velocitypowered.api.event.command.PlayerAvailableCommandsEvent;
|
||||
import com.velocitypowered.api.event.connection.DisconnectEvent;
|
||||
import com.velocitypowered.api.event.connection.PluginMessageEvent;
|
||||
import com.velocitypowered.api.event.player.PlayerChatEvent;
|
||||
import com.velocitypowered.api.event.player.ServerPreConnectEvent;
|
||||
//import com.velocitypowered.api.event.player.TabCompleteEvent;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
@ -97,4 +99,25 @@ public class ProxyListener {
|
||||
|
||||
event.setResult(ServerPreConnectEvent.ServerResult.denied());
|
||||
}
|
||||
|
||||
/*
|
||||
"You have the opportunity to modify the response sent to the remote player."
|
||||
In theory... it could be modified, but the respective methods do not exist.
|
||||
I hope that the other event works for <1.12 even though this one should work.
|
||||
*/
|
||||
|
||||
/*@Subscribe
|
||||
public void onTabComplete(TabCompleteEvent event){
|
||||
Player player = event.getPlayer();
|
||||
if (plugin.loggedPlayers.contains(player.getUniqueId())) return;
|
||||
event.setTabComplete();?
|
||||
}*/
|
||||
|
||||
@Subscribe
|
||||
public void onTabComplete(PlayerAvailableCommandsEvent event){
|
||||
Player player = event.getPlayer();
|
||||
if (!plugin.loggedPlayers.contains(player.getUniqueId())) {
|
||||
event.getRootNode().getChildren().iterator().remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user