fixed NoSuchElementException on velocity

This commit is contained in:
NEZNAMY committed 2020-11-07 21:47:00 +01:00
1 parent 4b3a9c3894
commit bdc5ba162d
1 file changed
+6 -1
@@ -29,7 +29,12 @@ public class VelocityTabPlayer extends ITabPlayer{
*/
public VelocityTabPlayer(Player p) {
player = p;
world = p.getCurrentServer().get().getServerInfo().getName();
if (p.getCurrentServer().isPresent()) {
world = p.getCurrentServer().get().getServerInfo().getName();
} else {
//tab reload while a player is connecting, how unfortunate
world = "<null>";
}
channel = ((ConnectedPlayer)player).getConnection().getChannel();
uniqueId = p.getUniqueId();
name = p.getUsername();