3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-06 00:00:47 +01:00

only send extended resource pack states on supported versions

Dieser Commit ist enthalten in:
Shane Freeder 2024-04-02 13:53:22 +01:00
Ursprung ad50582836
Commit d4077ddc1a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C

Datei anzeigen

@ -28,6 +28,7 @@ import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.event.player.PlayerResourcePackStatusEvent; import com.velocitypowered.api.event.player.PlayerResourcePackStatusEvent;
import com.velocitypowered.api.event.player.ServerResourcePackSendEvent; import com.velocitypowered.api.event.player.ServerResourcePackSendEvent;
import com.velocitypowered.api.event.proxy.ProxyPingEvent; import com.velocitypowered.api.event.proxy.ProxyPingEvent;
import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier; import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.player.ResourcePackInfo; import com.velocitypowered.api.proxy.player.ResourcePackInfo;
import com.velocitypowered.proxy.VelocityServer; import com.velocitypowered.proxy.VelocityServer;
@ -209,10 +210,14 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
if (serverConn.getConnection() != null) { if (serverConn.getConnection() != null) {
serverConn.getConnection().write(new ResourcePackResponsePacket( serverConn.getConnection().write(new ResourcePackResponsePacket(
packet.getId(), packet.getHash(), PlayerResourcePackStatusEvent.Status.ACCEPTED)); packet.getId(), packet.getHash(), PlayerResourcePackStatusEvent.Status.ACCEPTED));
serverConn.getConnection().write(new ResourcePackResponsePacket( if (serverConn.getConnection().getProtocolVersion().noLessThan(ProtocolVersion.MINECRAFT_1_20_3)) {
packet.getId(), packet.getHash(), PlayerResourcePackStatusEvent.Status.DOWNLOADED)); serverConn.getConnection().write(new ResourcePackResponsePacket(
serverConn.getConnection().write(new ResourcePackResponsePacket( packet.getId(), packet.getHash(),
packet.getId(), packet.getHash(), PlayerResourcePackStatusEvent.Status.SUCCESSFUL)); PlayerResourcePackStatusEvent.Status.DOWNLOADED));
serverConn.getConnection().write(new ResourcePackResponsePacket(
packet.getId(), packet.getHash(),
PlayerResourcePackStatusEvent.Status.SUCCESSFUL));
}
} }
if (modifiedPack) { if (modifiedPack) {
logger.warn("A plugin has tried to modify a ResourcePack provided by the backend server " logger.warn("A plugin has tried to modify a ResourcePack provided by the backend server "