summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorCeltic Minstrel <celtic.minstrel.ca@some.place>2012-02-25 17:57:42 -0500
committerEvilSeph <evilseph@gmail.com>2012-02-25 18:06:20 -0500
commit2ba3ab3fb820c07877f50eee967aed2cdeff51da (patch)
tree7213ef0887d968131460b5a528f8c78569416fec /src/main/java
parent1c9d419c27e52347122f2eb43e294a36e0613501 (diff)
downloadbukkit-2ba3ab3fb820c07877f50eee967aed2cdeff51da.tar
bukkit-2ba3ab3fb820c07877f50eee967aed2cdeff51da.tar.gz
bukkit-2ba3ab3fb820c07877f50eee967aed2cdeff51da.tar.lz
bukkit-2ba3ab3fb820c07877f50eee967aed2cdeff51da.tar.xz
bukkit-2ba3ab3fb820c07877f50eee967aed2cdeff51da.zip
[Bleeding] Fixed potion tests.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/potion/Potion.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java
index 9ff0f41c..a66d1f91 100644
--- a/src/main/java/org/bukkit/potion/Potion.java
+++ b/src/main/java/org/bukkit/potion/Potion.java
@@ -14,8 +14,6 @@ import org.bukkit.inventory.ItemStack;
public class Potion {
private boolean extended = false;
private boolean splash = false;
- @Deprecated
- private Tier tier = Tier.ONE;
private int level = 1;
private int name = -1;
private PotionType type;
@@ -194,7 +192,7 @@ public class Potion {
*/
@Deprecated
public Tier getTier() {
- return tier;
+ return level == 2 ? Tier.TWO : Tier.ONE;
}
/**
@@ -267,7 +265,6 @@ public class Potion {
@Deprecated
public void setTier(Tier tier) {
Validate.notNull(tier, "tier cannot be null");
- this.tier = tier;
this.level = (tier == Tier.TWO ? 2 : 1);
}
@@ -292,7 +289,6 @@ public class Potion {
int max = type.getMaxLevel();
Validate.isTrue(level > 0 && level <= max, "Level must be " + (max == 1 ? "" : "between 1 and ") + max + " for this potion");
this.level = level;
- this.tier = level == 2 ? Tier.TWO : Tier.ONE;
}
/**
@@ -309,9 +305,9 @@ public class Potion {
// Without this, mundanePotion.toDamageValue() would return 0
damage = (short) (name == 0 ? 8192 : name);
} else {
- damage = (short) level;
- damage = (short) type.getDamageValue();
- damage |= level << TIER_SHIFT;
+ damage = (short) (level - 1);
+ damage <<= TIER_SHIFT;
+ damage |= (short) type.getDamageValue();
}
if (splash) {
damage |= SPLASH_BIT;