Skip to content

Commit

Permalink
Merge branch 'server-inventory' of https://github.com/GeyserMC/Geyser
Browse files Browse the repository at this point in the history
…into server-inventory
  • Loading branch information
Camotoy committed Mar 12, 2021
2 parents 821e312 + bba602b commit d4c21bb
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.geysermc.connector.inventory.Inventory;
import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.inventory.BedrockContainerSlot;
import org.geysermc.connector.network.translators.inventory.SlotType;
import org.geysermc.connector.network.translators.inventory.updater.UIInventoryUpdater;
import org.geysermc.connector.network.translators.item.translators.BannerTranslator;

Expand Down Expand Up @@ -144,7 +145,7 @@ public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession se
ClientClickWindowButtonPacket packet = new ClientClickWindowButtonPacket(inventory.getId(), index);
session.sendDownstreamPacket(packet);

GeyserItemStack inputCopy = inventory.getItem(0).copy();
GeyserItemStack inputCopy = inventory.getItem(0).copy(1);
inputCopy.setNetId(session.getNextItemNetId());
// Add the pattern manually, for better item synchronization
if (inputCopy.getNbt() == null) {
Expand Down Expand Up @@ -219,4 +220,12 @@ public int javaSlotToBedrock(int slot) {
}
return super.javaSlotToBedrock(slot);
}

@Override
public SlotType getSlotType(int javaSlot) {
if (javaSlot == 3) {
return SlotType.OUTPUT;
}
return super.getSlotType(javaSlot);
}
}

0 comments on commit d4c21bb

Please sign in to comment.