Make sure that the backend server knows the pack application was successful

accepted, is just the first expected state, we also need to tell that the pack
was actually applied on the client in order to allow it to progress in the connection
process
This commit is contained in:
Shane Freeder
2024-03-02 15:05:35 +00:00
parent 82189a6a21
commit 62c6ec044e

View File

@@ -137,8 +137,13 @@ public class ConfigSessionHandler implements MinecraftSessionHandler {
if (serverConn.getPlayer().resourcePackHandler().hasPackAppliedByHash(toSend.getHash())) { if (serverConn.getPlayer().resourcePackHandler().hasPackAppliedByHash(toSend.getHash())) {
// Do not apply a resource pack that has already been applied // Do not apply a resource pack that has already been applied
if (serverConn.getConnection() != null) { if (serverConn.getConnection() != null) {
// We can technically skip these first 2 states, however, for conformity to normal state flow expectations...
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(
packet.getId(), packet.getHash(), 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 "