Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Merge branch 'dev/1.1.0' into dev/3.0.0
# Conflicts: # build.gradle
Dieser Commit ist enthalten in:
Commit
445688b9a1
@ -285,8 +285,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(ResourcePackResponse packet) {
|
public boolean handle(ResourcePackResponse packet) {
|
||||||
return player.onResourcePackResponse(packet.getStatus(),
|
return player.onResourcePackResponse(packet.getStatus());
|
||||||
ByteBufUtil.decodeHexDump(packet.getHash()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -808,7 +808,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
|
.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
onResourcePackResponse(PlayerResourcePackStatusEvent.Status.DECLINED, new byte[0]);
|
onResourcePackResponse(PlayerResourcePackStatusEvent.Status.DECLINED);
|
||||||
queued = null;
|
queued = null;
|
||||||
}
|
}
|
||||||
if (queued == null) {
|
if (queued == null) {
|
||||||
@ -844,9 +844,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
/**
|
/**
|
||||||
* Processes a client response to a sent resource-pack.
|
* Processes a client response to a sent resource-pack.
|
||||||
*/
|
*/
|
||||||
public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status,
|
public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status) {
|
||||||
@Nullable byte[] hash) {
|
|
||||||
|
|
||||||
final boolean peek = status == PlayerResourcePackStatusEvent.Status.ACCEPTED;
|
final boolean peek = status == PlayerResourcePackStatusEvent.Status.ACCEPTED;
|
||||||
final ResourcePackInfo queued = peek
|
final ResourcePackInfo queued = peek
|
||||||
? outstandingResourcePacks.peek() : outstandingResourcePacks.poll();
|
? outstandingResourcePacks.peek() : outstandingResourcePacks.poll();
|
||||||
@ -863,7 +861,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case ACCEPTED:
|
case ACCEPTED:
|
||||||
previousResourceResponse = true;
|
previousResourceResponse = true;
|
||||||
@ -884,9 +881,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!peek) {
|
if (!peek) {
|
||||||
connection.eventLoop().execute(() -> {
|
connection.eventLoop().execute(this::tickResourcePackQueue);
|
||||||
tickResourcePackQueue();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return queued != null && queued.getOrigin() == ResourcePackInfo.Origin.DOWNSTREAM_SERVER;
|
return queued != null && queued.getOrigin() == ResourcePackInfo.Origin.DOWNSTREAM_SERVER;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren