Update Update Bukkit to 1.7.2

By: mbax <matt@phozop.net>
This commit is contained in:
Bukkit/Spigot
2013-11-13 17:53:49 -07:00
parent 1945a3b7ea
commit aa66c8025a
19 changed files with 327 additions and 205 deletions

View File

@@ -1,53 +1,35 @@
package org.bukkit;
import java.util.Map;
import com.google.common.collect.Maps;
/**
* Represents a countable statistic, which is collected by the client
*/
public enum Statistic {
DAMAGE_DEALT(2020),
DAMAGE_TAKEN(2021),
DEATHS(2022),
MOB_KILLS(2023),
PLAYER_KILLS(2024),
FISH_CAUGHT(2025),
MINE_BLOCK(16777216, true),
USE_ITEM(6908288, false),
BREAK_ITEM(16973824, true);
DAMAGE_DEALT,
DAMAGE_TAKEN,
DEATHS,
MOB_KILLS,
PLAYER_KILLS,
FISH_CAUGHT,
MINE_BLOCK(true),
USE_ITEM(false),
BREAK_ITEM(true);
private final static Map<Integer, Statistic> BY_ID = Maps.newHashMap();
private final int id;
private final boolean isSubstat;
private final boolean isBlock;
private Statistic(int id) {
this(id, false, false);
private Statistic() {
this(false, false);
}
private Statistic(int id, boolean isBlock) {
this(id, true, isBlock);
private Statistic(boolean isBlock) {
this(true, isBlock);
}
private Statistic(int id, boolean isSubstat, boolean isBlock) {
this.id = id;
private Statistic(boolean isSubstat, boolean isBlock) {
this.isSubstat = isSubstat;
this.isBlock = isBlock;
}
/**
* Gets the ID for this statistic.
*
* @return ID of this statistic
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
/**
* Checks if this is a substatistic.
* <p>
@@ -67,22 +49,4 @@ public enum Statistic {
public boolean isBlock() {
return isSubstat && isBlock;
}
/**
* Gets the statistic associated with the given ID.
*
* @param id ID of the statistic to return
* @return statistic with the given ID
* @deprecated Magic value
*/
@Deprecated
public static Statistic getById(int id) {
return BY_ID.get(id);
}
static {
for (Statistic statistic : values()) {
BY_ID.put(statistic.id, statistic);
}
}
}