Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Achievement.java
1 package org.bukkit;
2 
3 /**
4  * Represents an achievement, which may be given to players.
5  */
6 public enum Achievement {
7  OPEN_INVENTORY,
8  MINE_WOOD (OPEN_INVENTORY),
9  BUILD_WORKBENCH (MINE_WOOD),
10  BUILD_PICKAXE (BUILD_WORKBENCH),
11  BUILD_FURNACE (BUILD_PICKAXE),
12  ACQUIRE_IRON (BUILD_FURNACE),
13  BUILD_HOE (BUILD_WORKBENCH),
14  MAKE_BREAD (BUILD_HOE),
15  BAKE_CAKE (BUILD_HOE),
16  BUILD_BETTER_PICKAXE (BUILD_PICKAXE),
17  COOK_FISH (BUILD_FURNACE),
18  ON_A_RAIL (ACQUIRE_IRON),
19  BUILD_SWORD (BUILD_WORKBENCH),
20  KILL_ENEMY (BUILD_SWORD),
21  KILL_COW (BUILD_SWORD),
22  FLY_PIG (KILL_COW),
23  SNIPE_SKELETON (KILL_ENEMY),
24  GET_DIAMONDS (ACQUIRE_IRON),
25  NETHER_PORTAL (GET_DIAMONDS),
26  GHAST_RETURN (NETHER_PORTAL),
27  GET_BLAZE_ROD (NETHER_PORTAL),
28  BREW_POTION (GET_BLAZE_ROD),
29  END_PORTAL (GET_BLAZE_ROD),
30  THE_END (END_PORTAL),
31  ENCHANTMENTS (GET_DIAMONDS),
32  OVERKILL (ENCHANTMENTS),
33  BOOKCASE (ENCHANTMENTS),
34  EXPLORE_ALL_BIOMES (END_PORTAL),
35  SPAWN_WITHER (THE_END),
36  KILL_WITHER (SPAWN_WITHER),
37  FULL_BEACON (KILL_WITHER),
38  BREED_COW (KILL_COW),
39  DIAMONDS_TO_YOU (GET_DIAMONDS),
40  ;
41 
42  private final Achievement parent;
43 
44  private Achievement() {
45  parent = null;
46  }
47 
48  private Achievement(Achievement parent) {
49  this.parent = parent;
50  }
51 
52  /**
53  * Returns whether or not this achievement has a parent achievement.
54  *
55  * @return whether the achievement has a parent achievement
56  */
57  public boolean hasParent() {
58  return parent != null;
59  }
60 
61  /**
62  * Returns the parent achievement of this achievement, or null if none.
63  *
64  * @return the parent achievement or null
65  */
67  return parent;
68  }
69 }
Achievement getParent()