Potions are not armor.

This commit is contained in:
LexManos 2012-01-28 07:34:39 +00:00
parent 7a6193e8f5
commit 61dc035977
2 changed files with 4 additions and 8 deletions

View file

@ -93,12 +93,11 @@
public boolean canHarvestBlock(Block block) public boolean canHarvestBlock(Block block)
{ {
return inventory.canHarvestBlock(block); return inventory.canHarvestBlock(block);
@@ -768,8 +824,26 @@ @@ -768,7 +824,25 @@
{ {
i = 1 + i >> 1; i = 1 + i >> 1;
} }
- i = applyArmorCalculations(damagesource, i); - i = applyArmorCalculations(damagesource, i);
- i = applyPotionDamageCalculations(damagesource, i);
+ +
+ boolean doRegularComputation = true; + boolean doRegularComputation = true;
+ int initialDamage = i; + int initialDamage = i;
@ -117,11 +116,10 @@
+ if (doRegularComputation) + if (doRegularComputation)
+ { + {
+ i = applyArmorCalculations(damagesource, i); + i = applyArmorCalculations(damagesource, i);
+ i = applyPotionDamageCalculations(damagesource, i);
+ } + }
i = applyPotionDamageCalculations(damagesource, i);
addExhaustion(damagesource.getHungerDamage()); addExhaustion(damagesource.getHungerDamage());
health -= i; health -= i;
}
@@ -815,7 +889,9 @@ @@ -815,7 +889,9 @@
public void destroyCurrentEquippedItem() public void destroyCurrentEquippedItem()

View file

@ -103,12 +103,11 @@
public boolean canHarvestBlock(Block block) public boolean canHarvestBlock(Block block)
{ {
return inventory.canHarvestBlock(block); return inventory.canHarvestBlock(block);
@@ -711,8 +770,26 @@ @@ -711,7 +770,25 @@
{ {
i = 1 + i >> 1; i = 1 + i >> 1;
} }
- i = applyArmorCalculations(damagesource, i); - i = applyArmorCalculations(damagesource, i);
- i = applyPotionDamageCalculations(damagesource, i);
+ +
+ boolean doRegularComputation = true; + boolean doRegularComputation = true;
+ int initialDamage = i; + int initialDamage = i;
@ -127,11 +126,10 @@
+ if (doRegularComputation) + if (doRegularComputation)
+ { + {
+ i = applyArmorCalculations(damagesource, i); + i = applyArmorCalculations(damagesource, i);
+ i = applyPotionDamageCalculations(damagesource, i);
+ } + }
i = applyPotionDamageCalculations(damagesource, i);
addExhaustion(damagesource.getHungerDamage()); addExhaustion(damagesource.getHungerDamage());
health -= i; health -= i;
}
@@ -758,7 +835,9 @@ @@ -758,7 +835,9 @@
public void destroyCurrentEquippedItem() public void destroyCurrentEquippedItem()