Search in sources :

Example 6 with GhostBackgroundItemSlot

use of com.enderio.core.client.gui.widget.GhostBackgroundItemSlot in project EnderIO by SleepyTrousers.

the class ContainerEnchanter method createGhostSlots.

public void createGhostSlots(List<GhostSlot> slots) {
    slots.add(new GhostBackgroundItemSlot(Items.WRITABLE_BOOK, getSlotFromInventory(0)));
    slots.add(new GhostBackgroundItemSlot(new ItemStack(Items.DYE, 1, 4), getSlotFromInventory(2)));
}
Also used : GhostBackgroundItemSlot(com.enderio.core.client.gui.widget.GhostBackgroundItemSlot) ItemStack(net.minecraft.item.ItemStack)

Example 7 with GhostBackgroundItemSlot

use of com.enderio.core.client.gui.widget.GhostBackgroundItemSlot in project EnderIO by SleepyTrousers.

the class ContainerWiredCharger method addGhostslots.

public void addGhostslots(NNList<GhostSlot> ghostSlots) {
    NNList<ItemStack> empties = new NNList<>();
    NNList<ItemStack> fulls = new NNList<>();
    getValidPair(ItemHelper.getValidItems()).apply(new Callback<Triple<ItemStack, ItemStack, Integer>>() {

        @Override
        public void apply(@Nonnull Triple<ItemStack, ItemStack, Integer> e) {
            empties.add(e.getLeft());
            fulls.add(e.getMiddle());
        }
    });
    // JEI will cause initGui to be re-run after closing the recipe view, causing duplicate ghost
    ghostSlots.removeAllByClass(GhostBackgroundItemSlot.class);
    // slots
    final GhostBackgroundItemSlot ghost0 = new GhostBackgroundItemSlot(empties, getSlotFromInventory(0));
    ghost0.setDisplayStdOverlay(true);
    ghostSlots.add(ghost0);
    final GhostBackgroundItemSlot ghost1 = new GhostBackgroundItemSlot(fulls, getSlotFromInventory(1));
    ghost1.setDisplayStdOverlay(true);
    ghostSlots.add(ghost1);
}
Also used : Triple(org.apache.commons.lang3.tuple.Triple) GhostBackgroundItemSlot(com.enderio.core.client.gui.widget.GhostBackgroundItemSlot) NNList(com.enderio.core.common.util.NNList) ItemStack(net.minecraft.item.ItemStack)

Aggregations

GhostBackgroundItemSlot (com.enderio.core.client.gui.widget.GhostBackgroundItemSlot)7 ItemStack (net.minecraft.item.ItemStack)4 NNList (com.enderio.core.common.util.NNList)3 Triple (org.apache.commons.lang3.tuple.Triple)1