// 5 2 * end left drag
// 5 4 * start right drag
// 5 5 add slot right drag
// 5 6 * end right drag
DragTracker drag = player.getInventory().getDragTracker();
boolean right = (message.getButton() >= 4);
switch (message.getButton()) {
case 0: // start left drag
case 4: // start right drag
return drag.start(right);
case 1: // add slot left
case 5: // add slot right
return drag.addSlot(right, message.getSlot());
case 2: // end left drag
case 6: // end right drag
List<Integer> slots = drag.finish(right);
if (slots == null || cursor == null) {
return false;
}
ItemStack newCursor = cursor.clone();