3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

We don't need the hash to go along with the resource pack response

Dieser Commit ist enthalten in:
Andrew Steinborn 2021-06-08 15:41:54 -04:00
Ursprung 4619053962
Commit 8892e2a5c6
2 geänderte Dateien mit 4 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -285,8 +285,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Override
public boolean handle(ResourcePackResponse packet) {
return player.onResourcePackResponse(packet.getStatus(),
ByteBufUtil.decodeHexDump(packet.getHash()));
return player.onResourcePackResponse(packet.getStatus(), packet.getHash());
}
@Override

Datei anzeigen

@ -924,7 +924,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
break;
}
onResourcePackResponse(PlayerResourcePackStatusEvent.Status.DECLINED, new byte[0]);
onResourcePackResponse(PlayerResourcePackStatusEvent.Status.DECLINED);
queued = null;
}
if (queued == null) {
@ -960,9 +960,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
/**
* Processes a client response to a sent resource-pack.
*/
public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status,
@Nullable byte[] hash) {
public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status) {
final boolean peek = status == PlayerResourcePackStatusEvent.Status.ACCEPTED;
final ResourcePackInfo queued = peek
? outstandingResourcePacks.peek() : outstandingResourcePacks.poll();
@ -979,7 +977,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
}
});
switch (status) {
case ACCEPTED:
previousResourceResponse = true;
@ -1000,9 +997,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
}
if (!peek) {
connection.eventLoop().execute(() -> {
tickResourcePackQueue();
});
connection.eventLoop().execute(this::tickResourcePackQueue);
}
return queued != null && queued.getOrigin() == ResourcePackInfo.Origin.DOWNSTREAM_SERVER;