-
Notifications
You must be signed in to change notification settings - Fork 14
Auto refill from shulker boxes in inventory #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Searches shulker inventory and replaces items if they appear in a shulker box Probably wouldn't hurt to have a setting to toggle - outside the scope of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So uh, I guess 1.16 now makes it so you can open shulker boxes right within your inventory? Basically I'm trying to figure out why these now need to be treated differently than any other block inventory.
| int bestMatchSlot = -1; | ||
| int bestMatchShulkerSlot = -1; | ||
| int bestMatchStackSize = Integer.MAX_VALUE; | ||
| boolean bestMatchShulker = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indents look... off. Are you using tabs perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to change the default in IDE... will fix
| if(im.getBlockState() instanceof ShulkerBox) { | ||
| ShulkerBox shulker = (ShulkerBox) im.getBlockState(); | ||
|
|
||
| for(int j = 0; j < 27; j++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better, clearer, and more future-proof to use a foreach loop instead.
|
So no, I haven't had time to follow 1.16 - so if you wouldn't mind filling me in what changed with shulker boxes? (Yes, am 2 lazy to look it up myself rn) |
|
Nothing changed with shulker boxes, I just thought, in the spirit of making inventory management more automatic it would be a nice added feature. It may be worth adding some permissions so people can enable it as desired. |
|
Ooooooooooooooh I get it now. You're using shulker boxes in the player's inventory as an extension of their inventory. In that case I'd strongly suggest, at the minimum, a config option for this that defaults to false - since IMO I'd be confused if my items were being replaced by items I weren't aware we're being pulled from the shulker box (and yes this would definitely be in scope of this PR). |
|
If anything you may also want to break this out (which would make it easier to add a config option for, too) into its own helper method(s) so you aren't directly modifying the replacement method |
|
Good ideas all around - I'll take a crack at adding permission 'n stuff |
Searches shulker inventory and replaces items if they appear in a shulker box Probably wouldn't hurt to have a setting to toggle - outside the scope of this PR
|
The easiest is a config option, but you can go the permissions route if you wish. You'd have to document it though, else the admin would never know how to enable access. Or you could go further and also add a command for players to toggle it. |
Searches shulker inventory and replaces items if they appear in a shulker box
Probably wouldn't hurt to have a setting to toggle - outside the scope of this PR