Updated HandSwapContext

Members better reflect what they're for.
This commit is contained in:
Daniel E 2019-11-19 15:24:53 -07:00
parent ef066e8753
commit 82296cd221
1 changed files with 10 additions and 10 deletions

View File

@ -228,25 +228,25 @@ public final class ObsidianReplaceModule extends Module {
}
private void processHandSwap(final HandSwapContext context, final boolean restore, final Minecraft minecraft) {
minecraft.player.inventory.currentItem = restore ? context.getGameSlot() : context.getObsidianSlot();
minecraft.player.inventory.currentItem = restore ? context.getOldSlot() : context.getNewSlot();
minecraft.playerController.updateController();
}
private static final class HandSwapContext {
private final int gameSlot;
private final int obsidianSlot;
private final int oldSlot;
private final int newSlot;
HandSwapContext(int gameSlot, int obsidianSlot) {
this.gameSlot = gameSlot;
this.obsidianSlot = obsidianSlot;
HandSwapContext(int oldSlot, int newSlot) {
this.oldSlot = oldSlot;
this.newSlot = newSlot;
}
int getGameSlot() {
return gameSlot;
int getOldSlot() {
return oldSlot;
}
int getObsidianSlot() {
return obsidianSlot;
int getNewSlot() {
return newSlot;
}
}