Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2025-01-11 15:41:08 +01:00
Fix crafting output not updating sometimes (#4692)
* Only cancel crafting grid future if slot == 0 * Add some comments
Dieser Commit ist enthalten in:
Ursprung
cb0488a271
Commit
3570caae25
@ -71,10 +71,6 @@ public class JavaContainerSetSlotTranslator extends PacketTranslator<Clientbound
|
||||
|
||||
InventoryTranslator translator = session.getInventoryTranslator();
|
||||
if (translator != null) {
|
||||
if (session.getCraftingGridFuture() != null) {
|
||||
session.getCraftingGridFuture().cancel(false);
|
||||
}
|
||||
|
||||
int slot = packet.getSlot();
|
||||
if (slot >= inventory.getSize()) {
|
||||
GeyserLogger logger = session.getGeyser().getLogger();
|
||||
@ -111,14 +107,22 @@ public class JavaContainerSetSlotTranslator extends PacketTranslator<Clientbound
|
||||
* Checks for a changed output slot in the crafting grid, and ensures Bedrock sees the recipe.
|
||||
*/
|
||||
private static void updateCraftingGrid(GeyserSession session, int slot, ItemStack item, Inventory inventory, InventoryTranslator translator) {
|
||||
// Check if it's the crafting grid result slot.
|
||||
if (slot != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if there is any crafting grid.
|
||||
int gridSize = translator.getGridSize();
|
||||
if (gridSize == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only process the most recent crafting grid result, and cancel the previous one.
|
||||
if (session.getCraftingGridFuture() != null) {
|
||||
session.getCraftingGridFuture().cancel(false);
|
||||
}
|
||||
|
||||
if (InventoryUtils.isEmpty(item)) {
|
||||
return;
|
||||
}
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren