2011-04-21 20:56:19 +01:00
|
|
|
package org.bukkit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a countable statistic, which is collected by the client
|
|
|
|
*/
|
|
|
|
public enum Statistic {
|
2013-11-13 17:53:49 -07:00
|
|
|
DAMAGE_DEALT,
|
|
|
|
DAMAGE_TAKEN,
|
|
|
|
DEATHS,
|
|
|
|
MOB_KILLS,
|
|
|
|
PLAYER_KILLS,
|
|
|
|
FISH_CAUGHT,
|
|
|
|
MINE_BLOCK(true),
|
|
|
|
USE_ITEM(false),
|
|
|
|
BREAK_ITEM(true);
|
2011-04-21 20:56:19 +01:00
|
|
|
|
|
|
|
private final boolean isSubstat;
|
|
|
|
private final boolean isBlock;
|
|
|
|
|
2013-11-13 17:53:49 -07:00
|
|
|
private Statistic() {
|
|
|
|
this(false, false);
|
2011-04-21 20:56:19 +01:00
|
|
|
}
|
2011-05-14 23:22:54 +02:00
|
|
|
|
2013-11-13 17:53:49 -07:00
|
|
|
private Statistic(boolean isBlock) {
|
|
|
|
this(true, isBlock);
|
2011-04-21 20:56:19 +01:00
|
|
|
}
|
|
|
|
|
2013-11-13 17:53:49 -07:00
|
|
|
private Statistic(boolean isSubstat, boolean isBlock) {
|
2011-04-21 20:56:19 +01:00
|
|
|
this.isSubstat = isSubstat;
|
|
|
|
this.isBlock = isBlock;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if this is a substatistic.
|
2013-04-02 00:11:22 -04:00
|
|
|
* <p>
|
2011-04-21 20:56:19 +01:00
|
|
|
* A substatistic exists in mass for each block or item, depending on {@link #isBlock()}
|
|
|
|
*
|
|
|
|
* @return true if this is a substatistic
|
|
|
|
*/
|
|
|
|
public boolean isSubstatistic() {
|
|
|
|
return isSubstat;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if this is a substatistic dealing with blocks (As opposed to items)
|
|
|
|
*
|
|
|
|
* @return true if this deals with blocks, false if with items
|
|
|
|
*/
|
|
|
|
public boolean isBlock() {
|
|
|
|
return isSubstat && isBlock;
|
|
|
|
}
|
|
|
|
}
|