mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
Ammo reinforced modifier support (#140)
This commit is contained in:
3 files changed
+22
-7
No files matched your search
@@ -145,8 +145,12 @@ public class Crossbow extends ProjectileWeapon {
|
||||
tags.setBoolean("Loaded", true);
|
||||
|
||||
// remove loaded item
|
||||
if (ammo.getItem() instanceof IAmmo) ((IAmmo) ammo.getItem()).consumeAmmo(1, ammo);
|
||||
else {
|
||||
if (ammo.getItem() instanceof IAmmo) {
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user