American2050 Posted February 21, 2018 Posted February 21, 2018 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. Quote
American2050 Posted February 21, 2018 Author Posted February 21, 2018 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? Quote
American2050 Posted February 21, 2018 Author Posted February 21, 2018 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. Quote
American2050 Posted February 23, 2018 Author Posted February 23, 2018 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? Quote
American2050 Posted February 23, 2018 Author Posted February 23, 2018 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. Quote
Draco18s Posted February 23, 2018 Posted February 23, 2018 Change Slot to SlotItemHandler. 1 Quote 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.
American2050 Posted February 23, 2018 Author Posted February 23, 2018 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. Quote
Draco18s Posted February 23, 2018 Posted February 23, 2018 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 Quote 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.
Recommended Posts
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.