public static net.minecraft.server.Statistic getMaterialStatistic(org.bukkit.Statistic stat, Material material) { try { if (stat == Statistic.MINE_BLOCK) { return StatisticList.MINE_BLOCK_COUNT[material.getId()]; } if (stat == Statistic.CRAFT_ITEM) { return StatisticList.CRAFT_BLOCK_COUNT[material.getId()]; } if (stat == Statistic.USE_ITEM) { return StatisticList.USE_ITEM_COUNT[material.getId()]; } if (stat == Statistic.BREAK_ITEM) { return StatisticList.BREAK_ITEM_COUNT[material.getId()]; } } catch (ArrayIndexOutOfBoundsException e) { return null; } return null; }
@Override public List<String> tabCompleteInternalStatisticOrAchievementName(String token, List<String> completions) { List<String> matches = new ArrayList<String>(); Iterator iterator = StatisticList.stats.iterator(); while (iterator.hasNext()) { String statistic = ((net.minecraft.server.Statistic) iterator.next()).name; if (statistic.startsWith(token)) { matches.add(statistic); } } return matches; }
@BeforeClass public static void setup() { StatisticList.a(); DummyServer.setup(); DummyPotions.setup(); DummyEnchantments.setup(); }
public static net.minecraft.server.Statistic getNMSStatistic(org.bukkit.Statistic statistic) { return StatisticList.getStatistic(statistics.inverse().get(statistic)); }
public static net.minecraft.server.Achievement getNMSAchievement(org.bukkit.Achievement achievement) { return (net.minecraft.server.Achievement) StatisticList.getStatistic(achievements.inverse().get(achievement)); }