MCPcopy Create free account
hub / github.com/PaperMC/Paper / WorldType

Enum WorldType

paper-api/src/main/java/org/bukkit/WorldType.java:12–51  ·  view source on GitHub ↗

Represents various types of worlds that may exist

Source from the content-addressed store, hash-verified

10 * Represents various types of worlds that may exist
11 */
12public enum WorldType {
13 NORMAL("DEFAULT"),
14 FLAT("FLAT"),
15 LARGE_BIOMES("LARGEBIOMES"),
16 AMPLIFIED("AMPLIFIED");
17
18 private static final Map<String, WorldType> BY_NAME = Maps.newHashMap();
19 private final String name;
20
21 private WorldType(/*@NotNull*/ String name) {
22 this.name = name;
23 }
24
25 /**
26 * Gets the name of this WorldType
27 *
28 * @return Name of this type
29 */
30 @NotNull
31 public String getName() {
32 return name;
33 }
34
35 /**
36 * Gets a WorldType by its name
37 *
38 * @param name Name of the WorldType to get
39 * @return Requested WorldType, or null if not found
40 */
41 @Nullable
42 public static WorldType getByName(@NotNull String name) {
43 return BY_NAME.get(name.toUpperCase(Locale.ROOT));
44 }
45
46 static {
47 for (WorldType type : values()) {
48 BY_NAME.put(type.name, type);
49 }
50 }
51}

Callers

nothing calls this directly

Calls 3

newHashMapMethod · 0.80
valuesMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected