@@ -1,82 +1,48 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
/**
|
||||
* Represents an achievement, which may be given to players
|
||||
*/
|
||||
public enum Achievement {
|
||||
OPEN_INVENTORY(0),
|
||||
MINE_WOOD(1),
|
||||
BUILD_WORKBENCH(2),
|
||||
BUILD_PICKAXE(3),
|
||||
BUILD_FURNACE(4),
|
||||
ACQUIRE_IRON(5),
|
||||
BUILD_HOE(6),
|
||||
MAKE_BREAD(7),
|
||||
BAKE_CAKE(8),
|
||||
BUILD_BETTER_PICKAXE(9),
|
||||
COOK_FISH(10),
|
||||
ON_A_RAIL(11),
|
||||
BUILD_SWORD(12),
|
||||
KILL_ENEMY(13),
|
||||
KILL_COW(14),
|
||||
FLY_PIG(15),
|
||||
SNIPE_SKELETON(16),
|
||||
GET_DIAMONDS(17),
|
||||
NETHER_PORTAL(18),
|
||||
GHAST_RETURN(19),
|
||||
GET_BLAZE_ROD(20),
|
||||
BREW_POTION(21),
|
||||
END_PORTAL(22),
|
||||
THE_END(23),
|
||||
ENCHANTMENTS(24),
|
||||
OVERKILL(25),
|
||||
BOOKCASE(26);
|
||||
OPEN_INVENTORY,
|
||||
MINE_WOOD,
|
||||
BUILD_WORKBENCH,
|
||||
BUILD_PICKAXE,
|
||||
BUILD_FURNACE,
|
||||
ACQUIRE_IRON,
|
||||
BUILD_HOE,
|
||||
MAKE_BREAD,
|
||||
BAKE_CAKE,
|
||||
BUILD_BETTER_PICKAXE,
|
||||
COOK_FISH,
|
||||
ON_A_RAIL,
|
||||
BUILD_SWORD,
|
||||
KILL_ENEMY,
|
||||
KILL_COW,
|
||||
FLY_PIG,
|
||||
SNIPE_SKELETON,
|
||||
GET_DIAMONDS,
|
||||
NETHER_PORTAL,
|
||||
GHAST_RETURN,
|
||||
GET_BLAZE_ROD,
|
||||
BREW_POTION,
|
||||
END_PORTAL,
|
||||
THE_END,
|
||||
ENCHANTMENTS,
|
||||
OVERKILL,
|
||||
BOOKCASE,
|
||||
BREED_COW,
|
||||
SPAWN_WITHER,
|
||||
KILL_WITHER,
|
||||
FULL_BEACON,
|
||||
EXPLORE_ALL_BIOMES,
|
||||
DIAMONDS_TO_YOU,
|
||||
;
|
||||
|
||||
/**
|
||||
* The offset used to distinguish Achievements and Statistics
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public final static int STATISTIC_OFFSET = 0x500000;
|
||||
private final static Map<Integer, Achievement> BY_ID = Maps.newHashMap();
|
||||
private final int id;
|
||||
|
||||
private Achievement(int id) {
|
||||
this.id = STATISTIC_OFFSET + id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ID for this achievement.
|
||||
* <p>
|
||||
* Note that this is offset using {@link #STATISTIC_OFFSET}
|
||||
*
|
||||
* @return ID of this achievement
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the achievement associated with the given ID.
|
||||
* <p>
|
||||
* Note that the ID must already be offset using {@link #STATISTIC_OFFSET}
|
||||
*
|
||||
* @param id ID of the achievement to return
|
||||
* @return Achievement with the given ID
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public static Achievement getById(int id) {
|
||||
return BY_ID.get(id);
|
||||
}
|
||||
|
||||
static {
|
||||
for (Achievement achievement : values()) {
|
||||
BY_ID.put(achievement.id, achievement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user