This repository has been archived on 2024-10-31. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
LibZontreck/src/main/java/dev/zontreck/libzontreck/items/OutputItemStackHandler.java

45 lines
1.1 KiB
Java

package dev.zontreck.libzontreck.items;
import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.ItemStackHandler;
public class OutputItemStackHandler extends ItemStackHandler {
private final ItemStackHandler internalSlot;
public OutputItemStackHandler(ItemStackHandler hidden) {
super();
internalSlot = hidden;
}
@Override
public void setSize(int size) {
stacks = NonNullList.<ItemStack>withSize(size, ItemStack.EMPTY);
}
@Override
public void setStackInSlot(int slot, ItemStack stack) {
internalSlot.setStackInSlot(slot, stack);
}
@Override
public int getSlots() {
return internalSlot.getSlots();
}
@Override
public ItemStack getStackInSlot(int slot) {
return internalSlot.getStackInSlot(slot);
}
@Override
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
return stack;
}
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
return internalSlot.extractItem(slot, amount, simulate);
}
}