Skip to content

Commit

Permalink
fix offhand being used when placing mainhand blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed Jan 17, 2025
1 parent c819fb1 commit 8017460
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import xonin.backhand.api.core.BackhandUtils;
import xonin.backhand.api.core.IBackhandPlayer;
import xonin.backhand.api.core.IOffhandInventory;
import xonin.backhand.client.utils.BackhandRenderHelper;
import xonin.backhand.utils.BackhandConfig;

Expand Down Expand Up @@ -116,7 +115,7 @@ private void func_147121_ag() {
z,
objectMouseOver.sideHit,
objectMouseOver.hitVec)) {
useMainhand = false;
useMainhand = useOffhand = false;
thePlayer.swingItem();
} else if (offhandItem != null) {
PlayerInteractEvent event = new PlayerInteractEvent(
Expand Down Expand Up @@ -155,8 +154,7 @@ private void func_147121_ag() {

if (offhandItem != null) {
if (offhandItem.stackSize == 0) {
thePlayer.inventory
.setInventorySlotContents(IOffhandInventory.OFFHAND_HOTBAR_SLOT, null);
BackhandUtils.setPlayerOffhandItem(thePlayer, null);
} else if (offhandItem.stackSize != offhandOriginalSize
|| playerController.isInCreativeMode()) {
BackhandRenderHelper.itemRenderer.resetEquippedProgress();
Expand Down

0 comments on commit 8017460

Please sign in to comment.