Skip to content

Commit

Permalink
Fixed TODO: "Is main hand always the correct slot?"
Browse files Browse the repository at this point in the history
Co-authored-by: mastercoms <mastercoms@tutanota.de>
  • Loading branch information
fionera and mastercoms committed May 21, 2018
1 parent 9747d77 commit db9e671
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/net/glowstone/block/itemtype/ItemBow.java
Expand Up @@ -103,8 +103,12 @@ public void endUse(GlowPlayer player, ItemStack bow) {
if (ThreadLocalRandom.current().nextDouble() < 0.2) {
launchedArrow.setCritical(true);
}
// TODO: Is main hand always the correct slot?
player.setItemInHand(InventoryUtil.damageItem(player, bow));

if (player.getItemInHand().getType() == Material.BOW) {
player.setItemInHand(InventoryUtil.damageItem(player, bow));
} else {
player.getInventory().setItemInOffHand(InventoryUtil.damageItem(player, bow));
}
}
player.setUsageItem(null);
player.setUsageTime(0);
Expand Down

0 comments on commit db9e671

Please sign in to comment.