Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Statistic.java
1 package org.bukkit;
2 
3 /**
4  * Represents a countable statistic, which is tracked by the server.
5  */
6 public enum Statistic {
7  DAMAGE_DEALT,
8  DAMAGE_TAKEN,
9  DEATHS,
10  MOB_KILLS,
11  PLAYER_KILLS,
12  FISH_CAUGHT,
13  ANIMALS_BRED,
14  TREASURE_FISHED,
15  JUNK_FISHED,
16  LEAVE_GAME,
17  JUMP,
18  DROP,
19  PLAY_ONE_TICK,
20  WALK_ONE_CM,
21  SWIM_ONE_CM,
22  FALL_ONE_CM,
23  CLIMB_ONE_CM,
24  FLY_ONE_CM,
25  DIVE_ONE_CM,
26  MINECART_ONE_CM,
27  BOAT_ONE_CM,
28  PIG_ONE_CM,
29  HORSE_ONE_CM,
30  MINE_BLOCK(Type.BLOCK),
31  USE_ITEM(Type.ITEM),
32  BREAK_ITEM(Type.ITEM),
33  CRAFT_ITEM(Type.ITEM),
34  KILL_ENTITY(Type.ENTITY),
35  ENTITY_KILLED_BY(Type.ENTITY);
36 
37  private final Type type;
38 
39  private Statistic() {
40  this(Type.UNTYPED);
41  }
42 
43  private Statistic(Type type) {
44  this.type = type;
45  }
46 
47  /**
48  * Gets the type of this statistic.
49  *
50  * @return the type of this statistic
51  */
52  public Type getType() {
53  return type;
54  }
55 
56  /**
57  * Checks if this is a substatistic.
58  * <p>
59  * A substatistic exists en masse for each block, item, or entitytype, depending on
60  * {@link #getType()}.
61  * <p>
62  * This is a redundant method and equivalent to checking
63  * <code>getType() != Type.UNTYPED</code>
64  *
65  * @return true if this is a substatistic
66  */
67  public boolean isSubstatistic() {
68  return type != Type.UNTYPED;
69  }
70 
71  /**
72  * Checks if this is a substatistic dealing with blocks.
73  * <p>
74  * This is a redundant method and equivalent to checking
75  * <code>getType() == Type.BLOCK</code>
76  *
77  * @return true if this deals with blocks
78  */
79  public boolean isBlock() {
80  return type == Type.BLOCK;
81  }
82 
83  /**
84  * The type of statistic.
85  *
86  */
87  public enum Type {
88  /**
89  * Statistics of this type do not require a qualifier.
90  */
92 
93  /**
94  * Statistics of this type require an Item Material qualifier.
95  */
97 
98  /**
99  * Statistics of this type require a Block Material qualifier.
100  */
102 
103  /**
104  * Statistics of this type require an EntityType qualifier.
105  */
107  }
108 }
boolean isSubstatistic()
Definition: Statistic.java:67