diff options
author | md_5 <git@md-5.net> | 2016-03-01 08:32:46 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-01 09:32:45 +1100 |
commit | aa008dff0f9bedbe88e1fe79831776b0a52eb90a (patch) | |
tree | cb520e0f4cc5d683fb9b7fb95de37480a7443dfb /src/test/java/org/bukkit/potion/PotionTest.java | |
parent | e1ebe524a78e27f6a2829ed4574fded3779094e1 (diff) | |
download | craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.gz craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.lz craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.xz craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.zip |
Update to Minecraft 1.9
Diffstat (limited to 'src/test/java/org/bukkit/potion/PotionTest.java')
-rw-r--r-- | src/test/java/org/bukkit/potion/PotionTest.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java index a9df7d19..691c3e50 100644 --- a/src/test/java/org/bukkit/potion/PotionTest.java +++ b/src/test/java/org/bukkit/potion/PotionTest.java @@ -4,10 +4,13 @@ import static org.junit.Assert.*; import static org.hamcrest.Matchers.*; import java.util.EnumMap; +import java.util.List; import java.util.Map; +import net.minecraft.server.MobEffect; +import net.minecraft.server.MobEffectList; +import net.minecraft.server.PotionRegistry; import org.bukkit.support.AbstractTestingBase; -import org.bukkit.support.Util; import org.junit.Test; public class PotionTest extends AbstractTestingBase { @@ -26,20 +29,20 @@ public class PotionTest extends AbstractTestingBase { @Test public void testEffectCompleteness() throws Throwable { - Map<Integer, ?> effectDurations = Util.getInternalState(net.minecraft.server.PotionBrewer.class, null, "effectDurations"); - Map<PotionType, String> effects = new EnumMap(PotionType.class); - for (int id : effectDurations.keySet()) { + for (PotionRegistry reg : PotionRegistry.a) { + List<MobEffect> eff = reg.a(); + if (eff.size() != 1) continue; + int id = MobEffectList.getId(eff.get(0).getMobEffect()); PotionEffectType type = PotionEffectType.getById(id); assertNotNull(String.valueOf(id), PotionEffectType.getById(id)); PotionType enumType = PotionType.getByEffect(type); assertNotNull(type.getName(), enumType); - assertThat(enumType.name(), effects.put(enumType, enumType.name()), is(nullValue())); + effects.put(enumType, enumType.name()); } - assertThat(effects.entrySet(), hasSize(effectDurations.size())); - assertThat(effectDurations.entrySet(), hasSize(PotionType.values().length - /* WATER */ 1)); + assertEquals(effects.entrySet().size(), PotionType.values().length - /* WATER */ 1); } } |