Skip to content

Commit

Permalink
Slight refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Dec 7, 2024
1 parent d00c9dc commit b79d383
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/main/java/appeng/client/gui/AEBaseScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ && getEmptyingAction(slot, menu.getCarried()) != null) {
InventoryAction action;
if (hasShiftDown()) {
action = InventoryAction.CRAFT_SHIFT;
} else if (InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_KEY_SPACE)) {
} else if (InputConstants.isKeyDown(getMinecraft().getWindow().getWindow(), GLFW.GLFW_KEY_SPACE)) {
action = InventoryAction.CRAFT_ALL;
} else {
// Craft stack on right-click, craft single on left-click
Expand All @@ -674,8 +674,7 @@ && getEmptyingAction(slot, menu.getCarried()) != null) {
return;
}

if (slot != null &&
InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_KEY_SPACE)) {
if (slot != null && InputConstants.isKeyDown(getMinecraft().getWindow().getWindow(), GLFW.GLFW_KEY_SPACE)) {
int slotNum = slot.index;
final InventoryActionPacket p = new InventoryActionPacket(InventoryAction.MOVE_REGION, slotNum, 0);
PacketDistributor.sendToServer(p);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/appeng/menu/AEBaseMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,13 @@ public void doAction(ServerPlayer player, InventoryAction action, int slot, long
}
var s = this.getSlot(slot);

if (s instanceof CraftingTermSlot) {
if (s instanceof CraftingTermSlot craftingTermSlot) {
switch (action) {
case CRAFT_SHIFT:
case CRAFT_ALL:
case CRAFT_ITEM:
case CRAFT_STACK:
((CraftingTermSlot) s).doClick(action, player);
craftingTermSlot.doClick(action, player);
default:
}
}
Expand Down

0 comments on commit b79d383

Please sign in to comment.