Skip to content

Commit 9f5da73

Browse files
committed
fix offhand duplication
1 parent 434f0df commit 9f5da73

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/main/java/lol/hyper/toolstats/events/PlayerFish.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ public void onFish(PlayerFishEvent event) {
7474
boolean isOffHand = inventory.getItemInOffHand().getType() == Material.FISHING_ROD;
7575
if (isMain) {
7676
inventory.getItemInMainHand().setItemMeta(newFishingRod);
77-
}
78-
if (isOffHand) {
77+
} else if (isOffHand) {
7978
inventory.getItemInOffHand().setItemMeta(newFishingRod);
8079
}
8180
}

src/main/java/lol/hyper/toolstats/events/SheepShear.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ public void onShear(PlayerInteractEntityEvent event) {
7272
boolean isOffHand = inventory.getItemInOffHand().getType() == Material.SHEARS;
7373
if (isMain) {
7474
inventory.getItemInMainHand().setItemMeta(newItem);
75-
}
76-
if (isOffHand) {
75+
} else if (isOffHand) {
7776
inventory.getItemInOffHand().setItemMeta(newItem);
7877
}
7978
}

src/main/java/lol/hyper/toolstats/events/ShootBow.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public void onShoot(EntityShootBowEvent event) {
6363
boolean isOffHand = inventory.getItemInOffHand().getType() == Material.BOW || inventory.getItemInOffHand().getType() == Material.CROSSBOW;
6464
if (isMain) {
6565
inventory.getItemInMainHand().setItemMeta(newItem);
66-
}
67-
if (isOffHand) {
66+
} else if (isOffHand) {
6867
inventory.getItemInOffHand().setItemMeta(newItem);
6968
}
7069
}

0 commit comments

Comments
 (0)