Jump to content

Different Stack Limits in an Entity


pro-mole

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.