cache some Loader.isModLoaded calls (#72)

This commit is contained in:
Alexdoru authored and GitHub committed 2023-02-08 21:11:39 +01:00
1 parent 131cdd6e6b
commit 531e33765e
3 files changed
+10 -12

No files matched your search

@@ -146,11 +146,7 @@ public class Crossbow extends ProjectileWeapon {
// remove loaded item
if (ammo.getItem() instanceof IAmmo) ((IAmmo) ammo.getItem()).consumeAmmo(1, ammo);
else {
if (Loader.isModLoaded("battlegear2")) {
player.inventory.consumeInventoryItem(ammo.getItem());
} else {
player.inventory.consumeInventoryItem(ammo.getItem());
}
player.inventory.consumeInventoryItem(ammo.getItem());
}
playReloadSound(world, player, weapon, ammo);