[Bleeding] Fix Achievement and Statistic API. Fixes BUKKIT-5305
By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -1,49 +1,69 @@
|
||||
package org.bukkit;
|
||||
|
||||
/**
|
||||
* Represents an achievement, which may be given to players
|
||||
* Represents an achievement, which may be given to players.
|
||||
*/
|
||||
public enum Achievement {
|
||||
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,
|
||||
MINE_WOOD (OPEN_INVENTORY),
|
||||
BUILD_WORKBENCH (MINE_WOOD),
|
||||
BUILD_PICKAXE (BUILD_WORKBENCH),
|
||||
BUILD_FURNACE (BUILD_PICKAXE),
|
||||
ACQUIRE_IRON (BUILD_FURNACE),
|
||||
BUILD_HOE (BUILD_WORKBENCH),
|
||||
MAKE_BREAD (BUILD_HOE),
|
||||
BAKE_CAKE (BUILD_HOE),
|
||||
BUILD_BETTER_PICKAXE (BUILD_PICKAXE),
|
||||
COOK_FISH (BUILD_FURNACE),
|
||||
ON_A_RAIL (ACQUIRE_IRON),
|
||||
BUILD_SWORD (BUILD_WORKBENCH),
|
||||
KILL_ENEMY (BUILD_SWORD),
|
||||
KILL_COW (BUILD_SWORD),
|
||||
FLY_PIG (KILL_COW),
|
||||
SNIPE_SKELETON (KILL_ENEMY),
|
||||
GET_DIAMONDS (ACQUIRE_IRON),
|
||||
NETHER_PORTAL (GET_DIAMONDS),
|
||||
GHAST_RETURN (NETHER_PORTAL),
|
||||
GET_BLAZE_ROD (NETHER_PORTAL),
|
||||
BREW_POTION (GET_BLAZE_ROD),
|
||||
END_PORTAL (GET_BLAZE_ROD),
|
||||
THE_END (END_PORTAL),
|
||||
ENCHANTMENTS (GET_DIAMONDS),
|
||||
OVERKILL (ENCHANTMENTS),
|
||||
BOOKCASE (ENCHANTMENTS),
|
||||
EXPLORE_ALL_BIOMES (END_PORTAL),
|
||||
SPAWN_WITHER (THE_END),
|
||||
KILL_WITHER (SPAWN_WITHER),
|
||||
FULL_BEACON (KILL_WITHER),
|
||||
BREED_COW (KILL_COW),
|
||||
DIAMONDS_TO_YOU (GET_DIAMONDS),
|
||||
;
|
||||
|
||||
private final Achievement parent;
|
||||
|
||||
private Achievement() {
|
||||
parent = null;
|
||||
}
|
||||
|
||||
private Achievement(Achievement parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* The offset used to distinguish Achievements and Statistics.
|
||||
*
|
||||
* @deprecated Magic value
|
||||
* Returns whether or not this achievement has a parent achievement.
|
||||
*
|
||||
* @return whether the achievement has a parent achievement
|
||||
*/
|
||||
@Deprecated
|
||||
public final static int STATISTIC_OFFSET = 0x500000;
|
||||
public boolean hasParent() {
|
||||
return parent != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parent achievement of this achievement, or null if none.
|
||||
*
|
||||
* @return the parent achievement or null
|
||||
*/
|
||||
public Achievement getParent() {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user