001 package org.bukkit; 002 003 /** 004 * Represents an achievement, which may be given to players. 005 */ 006 public enum Achievement { 007 OPEN_INVENTORY, 008 MINE_WOOD (OPEN_INVENTORY), 009 BUILD_WORKBENCH (MINE_WOOD), 010 BUILD_PICKAXE (BUILD_WORKBENCH), 011 BUILD_FURNACE (BUILD_PICKAXE), 012 ACQUIRE_IRON (BUILD_FURNACE), 013 BUILD_HOE (BUILD_WORKBENCH), 014 MAKE_BREAD (BUILD_HOE), 015 BAKE_CAKE (BUILD_HOE), 016 BUILD_BETTER_PICKAXE (BUILD_PICKAXE), 017 COOK_FISH (BUILD_FURNACE), 018 ON_A_RAIL (ACQUIRE_IRON), 019 BUILD_SWORD (BUILD_WORKBENCH), 020 KILL_ENEMY (BUILD_SWORD), 021 KILL_COW (BUILD_SWORD), 022 FLY_PIG (KILL_COW), 023 SNIPE_SKELETON (KILL_ENEMY), 024 GET_DIAMONDS (ACQUIRE_IRON), 025 NETHER_PORTAL (GET_DIAMONDS), 026 GHAST_RETURN (NETHER_PORTAL), 027 GET_BLAZE_ROD (NETHER_PORTAL), 028 BREW_POTION (GET_BLAZE_ROD), 029 END_PORTAL (GET_BLAZE_ROD), 030 THE_END (END_PORTAL), 031 ENCHANTMENTS (GET_DIAMONDS), 032 OVERKILL (ENCHANTMENTS), 033 BOOKCASE (ENCHANTMENTS), 034 EXPLORE_ALL_BIOMES (END_PORTAL), 035 SPAWN_WITHER (THE_END), 036 KILL_WITHER (SPAWN_WITHER), 037 FULL_BEACON (KILL_WITHER), 038 BREED_COW (KILL_COW), 039 DIAMONDS_TO_YOU (GET_DIAMONDS), 040 ; 041 042 private final Achievement parent; 043 044 private Achievement() { 045 parent = null; 046 } 047 048 private Achievement(Achievement parent) { 049 this.parent = parent; 050 } 051 052 /** 053 * Returns whether or not this achievement has a parent achievement. 054 * 055 * @return whether the achievement has a parent achievement 056 */ 057 public boolean hasParent() { 058 return parent != null; 059 } 060 061 /** 062 * Returns the parent achievement of this achievement, or null if none. 063 * 064 * @return the parent achievement or null 065 */ 066 public Achievement getParent() { 067 return parent; 068 } 069 }