Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PistonMoveReaction.java
1 package org.bukkit.block;
2 
3 import java.util.HashMap;
4 import java.util.Map;
5 
6 public enum PistonMoveReaction {
7 
8  /**
9  * Indicates that the block can be pushed or pulled.
10  */
11  MOVE(0),
12  /**
13  * Indicates the block is fragile and will break if pushed on.
14  */
15  BREAK(1),
16  /**
17  * Indicates that the block will resist being pushed or pulled.
18  */
19  BLOCK(2);
20 
21  private int id;
22  private static Map<Integer, PistonMoveReaction> byId = new HashMap<Integer, PistonMoveReaction>();
23  static {
24  for (PistonMoveReaction reaction : PistonMoveReaction.values()) {
25  byId.put(reaction.id, reaction);
26  }
27  }
28 
29  private PistonMoveReaction(int id) {
30  this.id = id;
31  }
32 
33  /**
34  * @return The ID of the move reaction
35  * @deprecated Magic value
36  */
37  @Deprecated
38  public int getId() {
39  return this.id;
40  }
41 
42  /**
43  * @param id An ID
44  * @return The move reaction with that ID
45  * @deprecated Magic value
46  */
47  @Deprecated
48  public static PistonMoveReaction getById(int id) {
49  return byId.get(id);
50  }
51 }
static PistonMoveReaction getById(int id)