mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
fix: consume vanilla arrows instead of duplicating them (#212)
This commit is contained in:
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user