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