Skip to content

Commit

Permalink
Fixed skin values and NPE on ping.
Browse files Browse the repository at this point in the history
  • Loading branch information
MCMDEV committed Apr 12, 2022
1 parent 850c528 commit 8820901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public boolean handleLogin(ConnectionEvent connectionEvent) {
connectionEvent.setUuid(profile.getUuid());
connectionEvent.setName(profile.getName());
connectionEvent.setSkinCopy(profile.isSkinCopy());
if (connectionEvent.getSkinValue() != null) {
if (profile.getSkinValue() != null) {
connectionEvent.setSkinValue(profile.getSkinValue());
if (connectionEvent.getSkinSignature() != null) {
if (profile.getSkinSignature() != null) {
connectionEvent.setSkinSignature(profile.getSkinSignature());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;

import java.net.InetSocketAddress;

@RequiredArgsConstructor
public class PaperListener implements Listener {

Expand Down Expand Up @@ -54,7 +56,9 @@ private void onAsyncLogin(AsyncPlayerPreLoginEvent event) {

@EventHandler
public void onPing(PaperServerListPingEvent event) {
String hostname = event.getClient().getVirtualHost().getHostName();
InetSocketAddress virtualHost = event.getClient().getVirtualHost();
if (virtualHost == null) return;
String hostname = virtualHost.getHostName();
PingEvent pingEvent = new PingEvent(hostname);
connectionHandler.handlePing(pingEvent);
if (pingEvent.getMotd() != null) {
Expand Down

0 comments on commit 8820901

Please sign in to comment.