/FileExtraction/Java_unseen/Wind-Development_WindSpigot/WindSpigot-API/src/main/java/org/bukkit/WorldType.java
package org.bukkit;

import java.util.Map;

import com.google.common.collect.Maps;

/**
 * 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"),
	CUSTOMIZED("CUSTOMIZED");

	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);
		}
	}
}
