Posted October 17, 201213 yr If I have an IIventory TileEntity with several slots, and want only one of these to only take one item at a time(an Itemstack of size 1, that is), even if the item itself can be stacked, is that possible?
October 17, 201213 yr I did this in my Particle Deco Mod, here's the source: https://github.com/SanAndreasP/Particle-Decoration-Mod Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
October 17, 201213 yr Author What I'm seeing in your source is that you make getStackSizeLimit return 1, but that will make all slots accept only 1 item per stack. What I'm thinking is an inventory where each slot can accept different max sizes.
October 17, 201213 yr That shouldn't be a problem. You can make a variable like public int stackLimit = 64; let it return in getSlotStackLimit: public int getSlotStackLimit() { return this.stackLimit; } and make a constructor like: public SlotCustom(ContainerCustom container, IInventory iinventory, int i, int j, int k, int l) { super(iinventory, i, j, k); field_40442_a = container; this.stackLimit = l; } After all that, when you define the slots in the container, you can do this: addSlotToContainer(new SlotCustom(this, tileentity, 0, 47, 17, 4)); addSlotToContainer(new PD_SlotCustom(this, tileentity, 1, 47, 52, 32)); The first would then take stacks with max. quantity 4, the second would take 32. Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
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.