Compare commits

...

2 Commits

Author SHA1 Message Date
virustotalop 181aac0f2a
Merge ba2b1d6595 into 6f057b361b 2024-04-07 10:10:29 -05:00
virustotalop ba2b1d6595 Temporary workaround for invalid player data
Fixes https://github.com/dmulloy2/ProtocolLib/issues/2775
2024-02-14 19:56:24 -08:00
2 changed files with 18 additions and 1 deletions

View File

@ -135,6 +135,12 @@ class SerializedOfflinePlayer implements OfflinePlayer, Serializable {
return bedSpawnLocation;
}
@Nullable
@Override
public Location getRespawnLocation() {
return null;
}
// @Override
public long getLastLogin() {
return lastLogin;
@ -209,6 +215,12 @@ class SerializedOfflinePlayer implements OfflinePlayer, Serializable {
return null;
}
@Nullable
@Override
public Location getLocation() {
return null;
}
@Override
public long getFirstPlayed() {
return firstPlayed;

View File

@ -93,7 +93,12 @@ public class NetworkManagerInjector implements ChannelListener {
if (marker != null || MinecraftReflection.isBundlePacket(packetClass) || outboundListeners.contains(packetClass)) {
// wrap packet and construct the event
PacketType.Protocol currentProtocol = injector.getCurrentProtocol(PacketType.Sender.SERVER);
PacketContainer container = new PacketContainer(PacketRegistry.getPacketType(currentProtocol, packetClass), packet);
PacketType type = PacketRegistry.getPacketType(currentProtocol, packetClass);
if (type == null) {
ProtocolLogger.debug("Invalid packet type: " + packetClass.getName());
return null;
}
PacketContainer container = new PacketContainer(type, packet);
PacketEvent packetEvent = PacketEvent.fromServer(this, container, marker, injector.getPlayer());
// post to all listeners, then return the packet event we constructed