/*
 * 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.item.inventory.lens.impl.minecraft;

import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import org.spongepowered.common.item.inventory.adapter.InventoryAdapter;
import org.spongepowered.common.item.inventory.lens.SlotProvider;
import org.spongepowered.common.item.inventory.lens.impl.comp.OrderedInventoryLensImpl;
import org.spongepowered.common.item.inventory.lens.impl.slots.FuelSlotLensImpl;
import org.spongepowered.common.item.inventory.lens.impl.slots.InputSlotLensImpl;
import org.spongepowered.common.item.inventory.lens.impl.slots.OutputSlotLensImpl;

public class FurnaceInventoryLens extends OrderedInventoryLensImpl {

    private InputSlotLensImpl input;
    private FuelSlotLensImpl fuel;
    private OutputSlotLensImpl output;

    public FurnaceInventoryLens(InventoryAdapter<IInventory, ItemStack> adapter, SlotProvider<IInventory, ItemStack> slots) {
        this(0, adapter, slots);
    }

    public FurnaceInventoryLens(int base, InventoryAdapter<IInventory, ItemStack> adapter, SlotProvider<IInventory, ItemStack> slots) {
        super(base, adapter.getInventory().getSize(), 1, adapter.getClass(), slots);
    }

    @Override
    protected void init(SlotProvider<IInventory, ItemStack> slots) {
        this.input = new InputSlotLensImpl(0, (i) -> true, (i) -> true);
        this.fuel = new FuelSlotLensImpl(1, (i) -> true, (i) -> true);       // TODO SlotFurnaceFuel
        this.output = new OutputSlotLensImpl(2, (i) -> false, (i) -> false); // SlotFurnaceOutput

        this.addSpanningChild(input);
        this.addSpanningChild(fuel);
        this.addSpanningChild(output);
    }
}

@@ -1391,16 +1391,80 @@
 mStack;%0A
+import org.spongepowered.api.item.inventory.property.SlotIndex;%0A
 import o
@@ -2580,32 +2580,89 @@
 Stack%3E slots) %7B%0A
+        super.init(slots); // Set spanning SlotAdapters%0A%0A
         this.inp
@@ -2930,32 +2930,24 @@
     this.add
-Spanning
 Child(input)
@@ -2945,16 +2945,34 @@
 ld(input
+, new SlotIndex(0)
 );%0A     
@@ -2978,32 +2978,24 @@
     this.add
-Spanning
 Child(fuel);
@@ -2992,16 +2992,34 @@
 ild(fuel
+, new SlotIndex(1)
 );%0A     
@@ -3033,16 +3033,8 @@
 .add
-Spanning
 Chil
@@ -3041,16 +3041,34 @@
 d(output
+, new SlotIndex(2)
 );%0A    %7D

fix Furnace slotindex