Java 类net.minecraft.server.AchievementList 实例源码

项目:CraftBukkit    文件:StatisticsAndAchievementsTest.java   
@Test
@SuppressWarnings("unchecked")
public void verifyAchievementMapping() throws Throwable {
    List<Achievement> achievements = Lists.newArrayList(Achievement.values());
    for (net.minecraft.server.Achievement achievement : (List<net.minecraft.server.Achievement>) AchievementList.e) {
        String name = achievement.name;

        String message = String.format("org.bukkit.Achievement is missing: '%s'", name);

        Achievement subject = CraftStatistic.getBukkitAchievement(achievement);
        assertThat(message, subject, is(not(nullValue())));

        assertThat(name, achievements.remove(subject), is(true));
    }

    assertThat("org.bukkit.Achievement has too many achievements", achievements, is(empty()));
}
项目:Craftbukkit    文件:StatisticsAndAchievementsTest.java   
@Test
@SuppressWarnings("unchecked")
public void verifyAchievementMapping() throws Throwable {
    List<Achievement> achievements = Lists.newArrayList(Achievement.values());
    for (net.minecraft.server.Achievement achievement : (List<net.minecraft.server.Achievement>) AchievementList.e) {
        String name = achievement.name;

        String message = String.format("org.bukkit.Achievement is missing: '%s'", name);

        Achievement subject = CraftStatistic.getBukkitAchievement(achievement);
        assertThat(message, subject, is(not(nullValue())));

        assertThat(name, achievements.remove(subject), is(true));
    }

    assertThat("org.bukkit.Achievement has too many achievements", achievements, is(empty()));
}
项目:Almura-Server    文件:AchievementTest.java   
@Test
@SuppressWarnings("unchecked")
public void verifyMapping() throws Throwable {
    List<Achievement> achievements = Lists.newArrayList(Achievement.values());

    for (net.minecraft.server.Achievement statistic : (List<net.minecraft.server.Achievement>) AchievementList.e) {
        int id = statistic.e;

        String name = Util.getInternalState(Statistic.class, statistic, "a");
        String message = String.format("org.bukkit.Achievement is missing id: %d named: '%s'", id - Achievement.STATISTIC_OFFSET, name);

        Achievement subject = Achievement.getById(id);
        assertNotNull(message, subject);

        assertTrue(name, achievements.remove(subject));
    }

    assertThat("org.bukkit.Achievement has too many achievements", achievements, is(Collections.EMPTY_LIST));
}
项目:Tweakkit-Server    文件:StatisticsAndAchievementsTest.java   
@Test
@SuppressWarnings("unchecked")
public void verifyAchievementMapping() throws Throwable {
    List<Achievement> achievements = Lists.newArrayList(Achievement.values());
    for (net.minecraft.server.Achievement achievement : (List<net.minecraft.server.Achievement>) AchievementList.e) {
        String name = achievement.name;

        String message = String.format("org.bukkit.Achievement is missing: '%s'", name);

        Achievement subject = CraftStatistic.getBukkitAchievement(achievement);
        assertThat(message, subject, is(not(nullValue())));

        assertThat(name, achievements.remove(subject), is(true));
    }

    assertThat("org.bukkit.Achievement has too many achievements", achievements, is(empty()));
}
项目:SpigotSource    文件:StatisticsAndAchievementsTest.java   
@Test
@SuppressWarnings("unchecked")
public void verifyAchievementMapping() throws Throwable {
    List<Achievement> achievements = Lists.newArrayList(Achievement.values());
    for (net.minecraft.server.Achievement achievement : (List<net.minecraft.server.Achievement>) AchievementList.e) {
        String name = achievement.name;

        String message = String.format("org.bukkit.Achievement is missing: '%s'", name);

        Achievement subject = CraftStatistic.getBukkitAchievement(achievement);
        assertThat(message, subject, is(not(nullValue())));

        assertThat(name, achievements.remove(subject), is(true));
    }

    assertThat("org.bukkit.Achievement has too many achievements", achievements, is(empty()));
}
项目:Craft-city    文件:AchievementTest.java   
@Test
@SuppressWarnings("unchecked")
public void verifyMapping() throws Throwable {
    List<Achievement> achievements = Lists.newArrayList(Achievement.values());

    for (net.minecraft.server.Achievement statistic : (List<net.minecraft.server.Achievement>) AchievementList.e) {
        int id = statistic.e;

        String name = Util.getInternalState(Statistic.class, statistic, "a");
        String message = String.format("org.bukkit.Achievement is missing id: %d named: '%s'", id - Achievement.STATISTIC_OFFSET, name);

        Achievement subject = Achievement.getById(id);
        assertNotNull(message, subject);

        assertTrue(name, achievements.remove(subject));
    }

    assertThat("org.bukkit.Achievement has too many achievements", achievements, is(Collections.EMPTY_LIST));
}