-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Updated Simplified Chinese localization (#315) | ||
- fix restock amount also displaying in stacks in JEI (#318) | ||
- add stow hotkey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/de/mari_023/ae2wtlib/hotkeys/StowHotkeyAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package de.mari_023.ae2wtlib.hotkeys; | ||
|
||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.entity.player.Player; | ||
|
||
import appeng.api.config.Actionable; | ||
import appeng.api.features.HotkeyAction; | ||
import appeng.api.stacks.AEItemKey; | ||
import appeng.me.helpers.PlayerSource; | ||
|
||
import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; | ||
|
||
public class StowHotkeyAction implements HotkeyAction { | ||
@Override | ||
public boolean run(Player player) { | ||
var handler = CraftingTerminalHandler.getCraftingTerminalHandler(player); | ||
if (!handler.inRange()) | ||
return false; | ||
var stack = player.getItemInHand(InteractionHand.MAIN_HAND); | ||
if (stack.isEmpty()) | ||
return false; | ||
if (handler.getTargetGrid() == null) | ||
return false; | ||
if (stack.isNotReplaceableByPickAction(player, player.getInventory().selected)) | ||
return false; | ||
|
||
stack.setCount(stack.getCount() - (int) handler.getTargetGrid().getStorageService().getInventory() | ||
.insert(AEItemKey.of(stack), stack.getCount(), Actionable.MODULATE, new PlayerSource(player))); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters