Posted May 25, 20205 yr Hi, i have attached a IItemHandler capability to my entity but i have to pass an IInventory to my Container and i don't kwon how convert it in order to be able to pass to the Container constructor. Here is the code: Entity: @CapabilityInject(IItemHandler.class) private static Capability<IItemHandler> ITEM_HANDLER_CAPABILITY = null; protected IItemHandler inventory = new ItemStackHandler(); Container: public class RidableDolphinContainer extends Container { private PlayerInventory playerInventory; private IInventory inventory; public RidableDolphinContainer(int windowID, PlayerInventory playerInventory) { this(windowID, playerInventory, new Inventory(1)); } public RidableDolphinContainer(int windowID, PlayerInventory playerInventory, IInventory inventory) { super(ModContainers.RIDABLE_DOLPHIN.get(), windowID); assertInventorySize(inventory, 1); this.playerInventory = playerInventory; this.inventory = inventory; inventory.openInventory(playerInventory.player); this.addSlot(new SlotSonarRidableDolphin(inventory, 0, 80, 20)); Edited May 26, 20205 yr by ArcaneDiver
May 25, 20205 yr Author Yes because i have to pass an IInventory to Slot. I obviously could be wrong because i'm quite new with GUI. Edited May 25, 20205 yr by ArcaneDiver
May 25, 20205 yr 2 minutes ago, ArcaneDiver said: Yes because i have to pass an IInventory to Slot. *cough*SlotItemHandler *cough* Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 25, 20205 yr Author But what about IInventory#openInventory? Just ignore Edited May 25, 20205 yr by ArcaneDiver
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.