3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 22:40:18 +01:00

Merge remote-tracking branch 'upstream/master' into feature/blocky

Dieser Commit ist enthalten in:
Joshua Castle 2023-03-05 18:31:05 -08:00
Commit f59d72843f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: F674F38216C35D5D
4 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -17,7 +17,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here! Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
### Currently supporting Minecraft Bedrock 1.19.20 - 1.19.62 and Minecraft Java 1.19.3. ### Currently supporting Minecraft Bedrock 1.19.20 - 1.19.63 and Minecraft Java 1.19.3.
## Setting Up ## Setting Up
Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser. Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser.

Datei anzeigen

@ -89,6 +89,10 @@ public abstract class Inventory {
@Setter @Setter
private boolean pending = false; private boolean pending = false;
@Getter
@Setter
private boolean displayed = false;
protected Inventory(int id, int size, ContainerType containerType) { protected Inventory(int id, int size, ContainerType containerType) {
this("Inventory", id, size, containerType); this("Inventory", id, size, containerType);
} }

Datei anzeigen

@ -95,6 +95,7 @@ public class InventoryUtils {
if (openInv != null && openInv.getJavaId() == inventory.getJavaId()) { if (openInv != null && openInv.getJavaId() == inventory.getJavaId()) {
translator.openInventory(session, inventory); translator.openInventory(session, inventory);
translator.updateInventory(session, inventory); translator.updateInventory(session, inventory);
openInv.setDisplayed(true);
} else if (openInv != null && openInv.isPending()) { } else if (openInv != null && openInv.isPending()) {
// Presumably, this inventory is no longer relevant, and the client doesn't care about it // Presumably, this inventory is no longer relevant, and the client doesn't care about it
displayInventory(session, openInv); displayInventory(session, openInv);
@ -103,6 +104,7 @@ public class InventoryUtils {
} else { } else {
translator.openInventory(session, inventory); translator.openInventory(session, inventory);
translator.updateInventory(session, inventory); translator.updateInventory(session, inventory);
inventory.setDisplayed(true);
} }
} else { } else {
session.setOpenInventory(null); session.setOpenInventory(null);
@ -117,7 +119,7 @@ public class InventoryUtils {
if (inventory != null) { if (inventory != null) {
InventoryTranslator translator = session.getInventoryTranslator(); InventoryTranslator translator = session.getInventoryTranslator();
translator.closeInventory(session, inventory); translator.closeInventory(session, inventory);
if (confirm && !inventory.isPending() && !(translator instanceof LecternInventoryTranslator)) { if (confirm && inventory.isDisplayed() && !inventory.isPending() && !(translator instanceof LecternInventoryTranslator)) {
session.setClosingInventory(true); session.setClosingInventory(true);
} }
} }

Datei anzeigen

@ -91,7 +91,7 @@ public class WebUtils {
InputStream in = con.getInputStream(); InputStream in = con.getInputStream();
Files.copy(in, Paths.get(fileLocation), StandardCopyOption.REPLACE_EXISTING); Files.copy(in, Paths.get(fileLocation), StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) { } catch (Exception e) {
throw new AssertionError("Unable to download and save file: " + fileLocation + " (" + reqURL + ")", e); throw new RuntimeException("Unable to download and save file: " + fileLocation + " (" + reqURL + ")", e);
} }
} }