Fixed AchievementTest.java

This commit is contained in:
feildmaster 2012-02-29 21:44:11 -06:00 committed by EvilSeph
parent 33ba9f0a2f
commit c73adc9533

View File

@ -6,8 +6,8 @@ import static org.junit.Assert.assertThat;
import java.util.List; import java.util.List;
import net.minecraft.server.AchievementList;
import net.minecraft.server.Statistic; import net.minecraft.server.Statistic;
import net.minecraft.server.StatisticList;
import org.bukkit.support.Util; import org.bukkit.support.Util;
import org.junit.Test; import org.junit.Test;
@ -20,12 +20,8 @@ public class AchievementTest {
public void verifyMapping() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException { public void verifyMapping() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
List<Achievement> achievements = Lists.newArrayList(Achievement.values()); List<Achievement> achievements = Lists.newArrayList(Achievement.values());
for (Statistic statistic : (List<Statistic>) StatisticList.b) { for (net.minecraft.server.Achievement statistic : (List<net.minecraft.server.Achievement>) AchievementList.e) {
int id = statistic.e; int id = statistic.e;
String hash = statistic.g;
if ((id & Achievement.STATISTIC_OFFSET) != Achievement.STATISTIC_OFFSET) continue;
if (hash == null) continue;
String name = Util.getInternalState(Statistic.class, statistic, "a"); 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); String message = String.format("org.bukkit.Achievement is missing id: %d named: '%s'", id - Achievement.STATISTIC_OFFSET, name);