Fixed not being able to use JEI R and U keys on Grid with tabs, fixes #1499
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
### 1.5.22
|
||||
- Added oredict, blocking, processing, ore inputs access to OpenComputers API (raoulvdberge)
|
||||
- The Crafter can now only store 1 stack size pattern per slot (raoulvdberge)
|
||||
- Fixed not being able to use JEI R and U keys on Grid with tabs (raoulvdberge)
|
||||
|
||||
### 1.5.21
|
||||
- Updated Portuguese (Brazilian) translation (Pinz714)
|
||||
|
@@ -335,6 +335,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
return inBounds(7, 19 + getTabHeight(), 162, 18 * getVisibleRows(), mouseX, mouseY);
|
||||
}
|
||||
|
||||
public int getSlotNumber() {
|
||||
return slotNumber;
|
||||
}
|
||||
|
||||
private boolean isOverClear(int mouseX, int mouseY) {
|
||||
int y = getTabHeight() + getHeader() + (getVisibleRows() * 18) + 4;
|
||||
|
||||
@@ -400,7 +404,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
|
||||
drawItem(otx + 6, ty + 9 - (!selected ? 3 : 0), tab.getIcon());
|
||||
|
||||
if (inBounds(tx, ty, ContainerGrid.TAB_WIDTH, ContainerGrid.TAB_HEIGHT, mouseX, mouseY)) {
|
||||
if (inBounds(tx, ty, ContainerGrid.TAB_WIDTH, ContainerGrid.TAB_HEIGHT - (selected ? 2 : 7), mouseX, mouseY)) {
|
||||
tabHovering = index;
|
||||
}
|
||||
}
|
||||
|
@@ -26,17 +26,7 @@ public class GuiHandlerGrid implements IAdvancedGuiHandler<GuiGrid> {
|
||||
mouseY -= gui.getGuiTop();
|
||||
|
||||
if (gui.getScrollbar() != null && !gui.getSearchField().isFocused() && gui.isOverSlotArea(mouseX, mouseY)) {
|
||||
mouseX -= 7;
|
||||
mouseY -= 19;
|
||||
|
||||
int x = mouseX / 18;
|
||||
int y = mouseY / 18;
|
||||
|
||||
y += gui.getScrollbar().getOffset();
|
||||
|
||||
int slot = y * 9 + x;
|
||||
|
||||
return slot >= 0 && slot < GuiGrid.STACKS.size() ? GuiGrid.STACKS.get(slot).getIngredient() : null;
|
||||
return gui.getSlotNumber() >= 0 && gui.getSlotNumber() < GuiGrid.STACKS.size() ? GuiGrid.STACKS.get(gui.getSlotNumber()).getIngredient() : null;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user