mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
SPIGOT-1638 / SPIGOT-1673: Rework Potions API
This commit is contained in:
1 parent
75286088fe
commit
4a8818c5fd
20 files changed
+622
-121
No files matched your search
@@ -14,19 +14,6 @@ import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.Test;
|
||||
|
||||
public class PotionTest extends AbstractTestingBase {
|
||||
|
||||
@Test
|
||||
public void getEffects() {
|
||||
for (PotionType type : PotionType.values()) {
|
||||
for (PotionEffect effect : new Potion(type).getEffects()) {
|
||||
PotionEffectType potionType = effect.getType();
|
||||
assertThat(effect.getType(), is(sameInstance(PotionEffectType.getById(potionType.getId()))));
|
||||
|
||||
assertNotNull(potionType.getName(), PotionType.getByEffect(potionType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEffectCompleteness() throws Throwable {
|
||||
Map<PotionType, String> effects = new EnumMap(PotionType.class);
|
||||
@@ -43,6 +30,6 @@ public class PotionTest extends AbstractTestingBase {
|
||||
effects.put(enumType, enumType.name());
|
||||
}
|
||||
|
||||
assertEquals(effects.entrySet().size(), PotionType.values().length - /* WATER */ 1);
|
||||
assertEquals(effects.entrySet().size(), PotionType.values().length - /* PotionTypes with no Effects */ 5);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user