fix: consume vanilla arrows instead of duplicating them (#212)

This commit is contained in:
Jordan Rey authored and GitHub committed 2025-09-20 06:36:51 +00:00
1 parent 0b8aa377b9
commit d996648b00
1 file changed
+4
@@ -200,10 +200,14 @@ public abstract class ProjectileWeapon extends ToolCore implements IBattlegearWe
// use up ammo
if (!player.capabilities.isCreativeMode && !world.isRemote) {
if (ammo.getItem() instanceof IAmmo) {
// if we're dealing with tinkers ammo, handle their custom logic
if (ammo.hasTagCompound()) {
int ammoReinforced = ammo.getTagCompound().getCompoundTag("InfiTool").getInteger("Unbreaking");
if (random.nextInt(10) < 10 - ammoReinforced) ((IAmmo) ammo.getItem()).consumeAmmo(1, ammo);
} else player.inventory.consumeInventoryItem(ammo.getItem());
} else {
// for non-custom IAmmo types (like vanilla arrows), simply consume them like in vanilla
player.inventory.consumeInventoryItem(ammo.getItem());
}
}