mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Mod Friendly Piercing (Rapier, Arrow & Bolts) (#60)
* Mod Friendly piercing Piercing damage converted to bonus damage equivalent to victim's armor protection (capped at diamond armor). This prevents rapiers from bypassing immunities. * Run SpotlessApply * Delete commented out code
This commit is contained in:
1 parent
450154c15d
commit
7ff7f25f73
4 files changed
+11
-3
No files matched your search
@@ -112,7 +112,11 @@ public class AbilityHelper {
|
||||
}
|
||||
boolean causedDamage = false;
|
||||
boolean isAlive = entity.isEntityAlive();
|
||||
if (tool.pierceArmor() && !broken) {
|
||||
|
||||
if (tool.pierceArmor() && !broken && entity instanceof EntityLivingBase) {
|
||||
int armorValue = Math.min(20, ((EntityLivingBase) entity).getTotalArmorValue());
|
||||
damage = (int) (damage / (1 - (0.04 * armorValue)));
|
||||
|
||||
if (player instanceof EntityPlayer)
|
||||
causedDamage =
|
||||
entity.attackEntityFrom(causePlayerPiercingDamage((EntityPlayer) player), damage);
|
||||
|
||||
Reference in new issue
Block a user