Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 14:30:17 +01:00
Match Advancement Packet Behavior Towards Java (#4684)
* Send advancement packet regardless of current tab * Send advancement close packet when single-advancement form closed
Dieser Commit ist enthalten in:
Ursprung
96bfda2ed3
Commit
6f4c29c834
@ -91,11 +91,9 @@ public class AdvancementsCache {
|
|||||||
builder.validResultHandler((response) -> {
|
builder.validResultHandler((response) -> {
|
||||||
String id = rootAdvancementIds.get(response.clickedButtonId());
|
String id = rootAdvancementIds.get(response.clickedButtonId());
|
||||||
if (!id.equals("")) {
|
if (!id.equals("")) {
|
||||||
if (!id.equals(currentAdvancementCategoryId)) {
|
|
||||||
// Send a packet indicating that we are opening this particular advancement window
|
// Send a packet indicating that we are opening this particular advancement window
|
||||||
ServerboundSeenAdvancementsPacket packet = new ServerboundSeenAdvancementsPacket(id);
|
ServerboundSeenAdvancementsPacket packet = new ServerboundSeenAdvancementsPacket(id);
|
||||||
session.sendDownstreamGamePacket(packet);
|
session.sendDownstreamGamePacket(packet);
|
||||||
}
|
|
||||||
currentAdvancementCategoryId = id;
|
currentAdvancementCategoryId = id;
|
||||||
buildAndShowListForm();
|
buildAndShowListForm();
|
||||||
}
|
}
|
||||||
@ -188,6 +186,10 @@ public class AdvancementsCache {
|
|||||||
.content(content)
|
.content(content)
|
||||||
.button(GeyserLocale.getPlayerLocaleString("gui.back", language))
|
.button(GeyserLocale.getPlayerLocaleString("gui.back", language))
|
||||||
.validResultHandler((response) -> buildAndShowListForm())
|
.validResultHandler((response) -> buildAndShowListForm())
|
||||||
|
.closedResultHandler(() -> {
|
||||||
|
// Indicate that we have closed the current advancement tab
|
||||||
|
session.sendDownstreamGamePacket(new ServerboundSeenAdvancementsPacket());
|
||||||
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren