Conversation
…into inventory-system
inventory-system Conflicts: dough-tags/pom.xml
|
Kudos, SonarCloud Quality Gate passed! |
dough-inventories/src/main/java/io/github/bakedlibs/dough/inventory/Menu.java
Show resolved
Hide resolved
...inventories/src/main/java/io/github/bakedlibs/dough/inventory/builders/SlotGroupBuilder.java
Outdated
Show resolved
Hide resolved
| item.setAmount(amount - maxStackSize); | ||
| itemInSlot.setAmount(maxStackSize); | ||
| } else { | ||
| itemInSlot.setAmount(Math.min(amount, maxStackSize)); |
There was a problem hiding this comment.
You can forget about the Math#min here for a slight gain in speed and just set to "amount": you have already checked that "amount" is at most maxStackSize so worst case scenario is the two are equal and Math.min will set exactly "amount" anyway, otherwise "amount" is the lower so it would again be the chosen one
| if (holder instanceof Menu) { | ||
| Menu inv = (Menu) holder; | ||
|
|
||
| try { |
There was a problem hiding this comment.
Wouldn't this fail to stop shift-clicking into filled slots? Let's say I have an "apples" group which is not interactable and filled with itemtype APPLE and I shift click a stack of apples in my inventories, the if clause is false so the event is never checked and apples get stacked into the first "apples" slots in the menu
There was a problem hiding this comment.
Might be a good idea to add something of the sort to TestMenuClicking too, just in case
md5sha256
left a comment
There was a problem hiding this comment.
Just these two and what Sfiguz has brought up, otherwise LGTM.
dough-inventories/src/main/java/io/github/bakedlibs/dough/inventory/SlotGroupIterator.java
Show resolved
Hide resolved
dough-inventories/src/main/java/io/github/bakedlibs/dough/inventory/json/LayoutShape.java
Show resolved
Hide resolved
|
LGTM bar the comments left by Sfiguz. I'll approve once those are resolved I suppose |
…ntory/builders/SlotGroupBuilder.java Co-authored-by: Sfiguz7 <37039432+Sfiguz7@users.noreply.github.com>
Resolves #29
Rewriting the inventory system.