Posted February 21, 20187 yr I have a simple question, I'm making a custom chest for a mod, I want to know, what should I implement or take into account to make pipes from any mod be able to interact with my chest with no conflicts. Thanks a lot.
February 21, 20187 yr Author 6 minutes ago, diesieben07 said: Expose IItemHandler as a capability and you should be good to go. Thanks you. Do I also need ISidedInventory or that's only in the case I want to only allow certain things coming from X side or been taken from X side?
February 21, 20187 yr Author I am already extending TileEntityLockableLoot that class extends TileEntityLockable that implements ILockableContainer that extends IInventory What would be a better alternative to have the basics of what a chest should have.
February 23, 20187 yr Author On 2/21/2018 at 7:45 PM, diesieben07 said: The basics of what a chest should have can be implemented by creating an ItemStackHandler instance and exposing it through getCapability. Thanks, I think I get the idea. Just one thing I'm not sure now. I still have to implement both IItemHandler and also ICapabilityProvider on my TileEntity right?
February 23, 20187 yr Author 19 minutes ago, diesieben07 said: No. TileEntity already implements ICapabilityProvider. IItemHandler will be implemented by ItemStackHandler (or you can make your own implementation) and then exposed through getCapability. You do not implement the inventory functionality on the TileEntity itself. Ohh ok. Perfect. Now one question. I had "Slots" on my Container for the TE and this container took IInventory in order to add the slots when using public ContainerCardBox(InventoryPlayer invPlayer, IInventory inventory, EntityPlayer playerIn) { ..... this.addSlotToContainer(new SlotCardBoxCards(inventory, m, 8 + m * 36, 18)); Now I don't have IInventory anymore, as that was my TE implementing IInventory, thing that I'm not supposed to do anymore. How do I go around this? Because Slot needs an IInventory.
February 23, 20187 yr Change Slot to SlotItemHandler. 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.
February 23, 20187 yr Author 2 hours ago, Draco18s said: Change Slot to SlotItemHandler. Thanks you so much. Yes doing some Google I found out that existed. I'm heading in the right direction and I believe I have everything sorted out. Just some minor problems here and there, like noticing that the method that handles inserting items into my TE doesn't care about checking on my Slot class if Item is Valid for Slot. I would think that's something they would do by default but apparently not, unless I'm missing something. I also need to implement some stuff that I'm not 100% sure how yet, but I will let you guys know once I get there. Thanks once again for the great help and patience always provided.
February 23, 20187 yr If you want your slots to be discriminatory, you need to write your own subclass. eg: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/inventory/SlotDust.java 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.
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.