use of com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCreativeInventoryActionPacket in project DragonProxy by DragonetMC.
the class PEBlockPickRequestPacketTranslator method translate.
@Override
public Packet[] translate(UpstreamSession session, BlockPickRequestPacket packet) {
ItemStack item = session.getChunkCache().getBlock(new Position(packet.x, packet.y, packet.z));
int selectedSlot = (int) session.getDataCache().getOrDefault(CacheKey.PLAYER_SELECTED_SLOT, 36);
ClientCreativeInventoryActionPacket backPacket = new ClientCreativeInventoryActionPacket(selectedSlot + 36, item);
// System.out.println("BlockPickRequestPacket " + DebugTools.getAllFields(packet));
// System.out.println("ItemStack " + DebugTools.getAllFields(item));
session.getChunkCache().getDebugGrid();
return new Packet[] { backPacket };
}
Aggregations