InventoryUtils: Don't send Java packet on hotbar item selection (#1301)

The Bedrock client sends a confirmation packet we translate regardless.
This commit is contained in:
Camotoy 2020-09-17 23:07:20 -04:00 committed by GitHub
parent 99e72f35b3
commit 2f2164f387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -27,7 +27,6 @@ package org.geysermc.connector.utils;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
import com.github.steveice10.mc.protocol.packet.ingame.client.player.ClientPlayerChangeHeldItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCreativeInventoryActionPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientMoveItemToHotbarPacket;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
@ -241,8 +240,6 @@ public class InventoryUtils {
hotbarPacket.setSelectedHotbarSlot(slot - 36);
hotbarPacket.setSelectHotbarSlot(true);
session.sendUpstreamPacket(hotbarPacket);
ClientPlayerChangeHeldItemPacket heldItemPacket = new ClientPlayerChangeHeldItemPacket(slot);
session.sendDownstreamPacket(heldItemPacket);
session.getInventory().setHeldItemSlot(slot - 36);
// No need to send a Java packet as Bedrock sends a confirmation packet back that we translate
}
}