/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.common.mixin.core.item.inventory;

import net.minecraft.inventory.ContainerRepair;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.common.item.inventory.adapter.InventoryAdapter;
import org.spongepowered.common.item.inventory.adapter.impl.slots.InputSlotAdapter;
import org.spongepowered.common.item.inventory.adapter.impl.slots.OutputSlotAdapter;
import org.spongepowered.common.item.inventory.lens.Fabric;
import org.spongepowered.common.item.inventory.lens.Lens;
import org.spongepowered.common.item.inventory.lens.LensProvider;
import org.spongepowered.common.item.inventory.lens.SlotProvider;
import org.spongepowered.common.item.inventory.lens.impl.collections.SlotCollection;
import org.spongepowered.common.item.inventory.lens.impl.comp.OrderedInventoryLensImpl;

@Mixin(ContainerRepair.class)
public abstract class MixinContainerRepair extends MixinContainer implements LensProvider {

    @Override
    public Lens rootLens(Fabric fabric, InventoryAdapter adapter) {
        return new OrderedInventoryLensImpl(0, 3, 1, inventory$getSlotProvider());
    }

    @SuppressWarnings("unchecked")
    @Override
    public SlotProvider slotProvider(Fabric fabric, InventoryAdapter adapter) {
        SlotCollection.Builder builder = new SlotCollection.Builder()
                .add(2, InputSlotAdapter.class)
                .add(1, OutputSlotAdapter.class);
        return builder.build();
    }
}

@@ -2035,32 +2035,267 @@
 omp.
-OrderedInventoryLensImpl
+MainPlayerInventoryLensImpl;%0Aimport org.spongepowered.common.item.inventory.lens.impl.comp.OrderedInventoryLensImpl;%0Aimport org.spongepowered.common.item.inventory.lens.impl.minecraft.container.ContainerLens;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List
 ;%0A%0A@
@@ -2506,23 +2506,74 @@
         
-return 
+List%3CLens%3E lenses = new ArrayList%3C%3E();%0A        lenses.add(
 new Orde
@@ -2630,16 +2630,188 @@
 vider())
+);%0A        lenses.add(new MainPlayerInventoryLensImpl(3, inventory$getSlotProvider(), true));%0A        return new ContainerLens(adapter, inventory$getSlotProvider(), lenses)
 ;%0A    %7D%0A
@@ -3106,16 +3106,41 @@
 r.class)
+%0A                .add(36)
 ;%0A      

fix ContainerRepair Lens fixes #2022