mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-11 16:07:38 +00:00
Create Recipe Widget; Recipe GUI: Infinity Scroll; Recipe GUI: Max Height Settings (#701)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
1 parent
2ea9ae1eb9
commit
fe0c5d4e50
50 files changed
+4150
-2107
No files matched your search
@@ -114,16 +114,25 @@ public class PositionedStack {
|
||||
return filteredItems.isEmpty() ? items : filteredItems;
|
||||
}
|
||||
|
||||
public boolean setPermutationToRender(ItemStack ingredient) {
|
||||
public int getPermutationIndex(ItemStack stack) {
|
||||
|
||||
for (int index = 0; index < this.items.length; index++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(this.items[index], ingredient)) {
|
||||
setPermutationToRender(index);
|
||||
return true;
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(items[index], stack)) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean setPermutationToRender(ItemStack ingredient) {
|
||||
final int stackIndex = getPermutationIndex(ingredient);
|
||||
|
||||
if (stackIndex >= 0) {
|
||||
setPermutationToRender(stackIndex);
|
||||
}
|
||||
|
||||
return stackIndex >= 0;
|
||||
}
|
||||
|
||||
public void setPermutationToRender(int index) {
|
||||
@@ -136,6 +145,10 @@ public class PositionedStack {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean contains(int mx, int my) {
|
||||
return this.relx <= mx && this.rely <= my && this.relx + 16 >= mx && this.rely + 16 >= my;
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack ingredient) {
|
||||
for (ItemStack item : items) if (NEIServerUtils.areStacksSameTypeCrafting(item, ingredient)) return true;
|
||||
|
||||
|
||||
Reference in new issue
Block a user