Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
WorldType.java
1 package org.bukkit;
2 
3 import com.google.common.collect.Maps;
4 import java.util.Map;
5 
6 /**
7  * Represents various types of worlds that may exist
8  */
9 public enum WorldType {
10  NORMAL("DEFAULT"),
11  FLAT("FLAT"),
12  VERSION_1_1("DEFAULT_1_1"),
13  LARGE_BIOMES("LARGEBIOMES"),
14  AMPLIFIED("AMPLIFIED");
15 
16  private final static Map<String, WorldType> BY_NAME = Maps.newHashMap();
17  private final String name;
18 
19  private WorldType(String name) {
20  this.name = name;
21  }
22 
23  /**
24  * Gets the name of this WorldType
25  *
26  * @return Name of this type
27  */
28  public String getName() {
29  return name;
30  }
31 
32  /**
33  * Gets a Worldtype by its name
34  *
35  * @param name Name of the WorldType to get
36  * @return Requested WorldType, or null if not found
37  */
38  public static WorldType getByName(String name) {
39  return BY_NAME.get(name.toUpperCase());
40  }
41 
42  static {
43  for (WorldType type : values()) {
44  BY_NAME.put(type.name, type);
45  }
46  }
47 }
static WorldType getByName(String name)
Definition: WorldType.java:38