[Bleeding] Added Potions API. Fixes BUKKIT-389

This commit is contained in:
fullwall
2012-01-09 15:51:32 +08:00
committed by EvilSeph
parent 63b9ed9ab4
commit f52665348e
8 changed files with 227 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
package org.bukkit.potion;
import static org.junit.Assert.*;
import org.bukkit.craftbukkit.potion.CraftPotionBrewer;
import org.junit.BeforeClass;
import org.junit.Test;
import net.minecraft.server.MobEffectList;
public class PotionTest {
@BeforeClass
public static void setUp() {
Potion.setPotionBrewer(new CraftPotionBrewer());
MobEffectList.BLINDNESS.getClass();
PotionEffectType.stopAcceptingRegistrations();
}
@Test
public void getEffects() {
for (PotionType type : PotionType.values()) {
for (PotionEffect effect : new Potion(type).getEffects()) {
assertTrue(effect.getType() == PotionEffectType.getById(effect.getType().getId()));
}
}
}
}