Skip to content

Instantly share code, notes, and snippets.

@DiabolicaTrix
Created June 25, 2018 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiabolicaTrix/35cd8e0ebd4b9353069324afcae2f273 to your computer and use it in GitHub Desktop.
Save DiabolicaTrix/35cd8e0ebd4b9353069324afcae2f273 to your computer and use it in GitHub Desktop.
package xyz.diabolicatrixlab.showcasemod.tileentity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.ItemStackHandler;
public class ItemStackHandlerBase extends ItemStackHandler {
public ItemStackHandlerBase(int size) {
super(size);
}
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
return slot > 0 ? super.extractItem(slot, amount, simulate) : ItemStack.EMPTY;
}
@Override
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
return slot > 0 ? super.insertItem(slot, stack, simulate) : ItemStack.EMPTY;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment