Example #1
0
/** Represents a property of {@link org.spout.vanilla.plugin.inventory.window.WindowType#FURNACE} */
public enum FurnaceProperty implements WindowProperty {
  /** The value of the progress arrow on the furnace. */
  PROGRESS_ARROW(0),
  /** The value of the fire icon on the furnace. */
  FIRE_ICON(1);
  private final int id;
  private static final TIntObjectMap<FurnaceProperty> idMap =
      new TIntObjectHashMap<FurnaceProperty>(FurnaceProperty.values().length);

  private FurnaceProperty(int id) {
    this.id = id;
  }

  @Override
  public int getId() {
    return id;
  }

  static {
    for (FurnaceProperty prop : FurnaceProperty.values()) {
      idMap.put(prop.getId(), prop);
    }
  }

  /**
   * Returns the property from the specified id.
   *
   * @param id of property
   * @return property with specified id
   */
  public static FurnaceProperty get(int id) {
    return idMap.get(id);
  }
}
Example #2
0
 static {
   for (FurnaceProperty prop : FurnaceProperty.values()) {
     idMap.put(prop.getId(), prop);
   }
 }