|
| 1 | +package me.skymc.taboolib.bookformatter; |
| 2 | + |
| 3 | +import org.bukkit.Achievement; |
| 4 | + |
| 5 | +import java.util.HashMap; |
| 6 | + |
| 7 | +import static org.bukkit.Achievement.*; |
| 8 | + |
| 9 | +@SuppressWarnings("deprecation") |
| 10 | +public final class BookAchievement { |
| 11 | + |
| 12 | + private static final HashMap<Achievement, String> achievements = new HashMap<>(); |
| 13 | + |
| 14 | + static { |
| 15 | + achievements.put(OPEN_INVENTORY, "openInventory"); |
| 16 | + achievements.put(MINE_WOOD, "mineWood"); |
| 17 | + achievements.put(BUILD_WORKBENCH, "buildWorkBench"); |
| 18 | + achievements.put(BUILD_PICKAXE, "buildPickaxe"); |
| 19 | + achievements.put(BUILD_FURNACE, "buildFurnace"); |
| 20 | + achievements.put(ACQUIRE_IRON, "aquireIron"); |
| 21 | + achievements.put(BUILD_HOE, "buildHoe"); |
| 22 | + achievements.put(MAKE_BREAD, "makeBread"); |
| 23 | + achievements.put(BAKE_CAKE,"bakeCake"); |
| 24 | + achievements.put(BUILD_BETTER_PICKAXE,"buildBetterPickaxe"); |
| 25 | + achievements.put(COOK_FISH,"cookFish"); |
| 26 | + achievements.put(ON_A_RAIL,"onARail"); |
| 27 | + achievements.put(BUILD_SWORD,"buildSword"); |
| 28 | + achievements.put(KILL_ENEMY,"killEnemy"); |
| 29 | + achievements.put(KILL_COW,"killCow"); |
| 30 | + achievements.put(FLY_PIG,"flyPig"); |
| 31 | + achievements.put(SNIPE_SKELETON,"snipeSkeleton"); |
| 32 | + achievements.put(GET_DIAMONDS,"diamonds"); |
| 33 | + achievements.put(NETHER_PORTAL,"portal"); |
| 34 | + achievements.put(GHAST_RETURN,"ghast"); |
| 35 | + achievements.put(GET_BLAZE_ROD,"blazerod"); |
| 36 | + achievements.put(BREW_POTION,"potion"); |
| 37 | + achievements.put(END_PORTAL,"thEnd"); |
| 38 | + achievements.put(THE_END,"theEnd2"); |
| 39 | + achievements.put(ENCHANTMENTS,"enchantments"); |
| 40 | + achievements.put(OVERKILL,"overkill"); |
| 41 | + achievements.put(BOOKCASE,"bookacase"); |
| 42 | + achievements.put(EXPLORE_ALL_BIOMES,"exploreAllBiomes"); |
| 43 | + achievements.put(SPAWN_WITHER,"spawnWither"); |
| 44 | + achievements.put(KILL_WITHER,"killWither"); |
| 45 | + achievements.put(FULL_BEACON,"fullBeacon"); |
| 46 | + achievements.put(BREED_COW,"breedCow"); |
| 47 | + achievements.put(DIAMONDS_TO_YOU,"diamondsToYou"); |
| 48 | + achievements.put(OVERPOWERED, "overpowered"); |
| 49 | + } |
| 50 | + |
| 51 | + /** |
| 52 | + * Gets the json id from the bukkit achievement passed as argument |
| 53 | + * @param achievement the achievement |
| 54 | + * @return the achievement's id or null if not found |
| 55 | + */ |
| 56 | + public static String toId(Achievement achievement) { |
| 57 | + return achievements.get(achievement); |
| 58 | + } |
| 59 | + |
| 60 | + private BookAchievement(){ |
| 61 | + |
| 62 | + } |
| 63 | +} |
0 commit comments