mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
commit
0983f48ca0
3 changed files with 973 additions and 954 deletions
|
@ -12,7 +12,6 @@ import com.projectkorra.projectkorra.waterbending.WaterArms;
|
|||
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
||||
import com.projectkorra.rpg.RPGMethods;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,22 +1,47 @@
|
|||
package com.projectkorra.projectkorra.configuration;
|
||||
|
||||
/**
|
||||
* Enum representing different types of Configurations.
|
||||
*
|
||||
* @author Jacklin213
|
||||
*
|
||||
*/
|
||||
public enum ConfigType {
|
||||
/**
|
||||
* Default Configuration represented by config.yml
|
||||
*/
|
||||
DEFAULT,
|
||||
/**
|
||||
* Death Message configuration represented by deathmessages.yml
|
||||
*/
|
||||
DEATH_MESSAGE,
|
||||
/**
|
||||
* Preset configuration represented by presets.yml
|
||||
*/
|
||||
PRESETS;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigType {
|
||||
|
||||
public static final ConfigType DEFAULT = new ConfigType("Default");
|
||||
public static final ConfigType PRESETS = new ConfigType("Presets");
|
||||
public static final ConfigType DEATH_MESSAGE = new ConfigType("DeathMessage");
|
||||
public static final ConfigType[] CORE_TYPES = {DEFAULT, PRESETS, DEATH_MESSAGE};
|
||||
|
||||
private static HashMap<String, ConfigType> allTypes = new HashMap<>();
|
||||
private static List<ConfigType> addonTypes = new ArrayList<>();
|
||||
|
||||
private String string;
|
||||
|
||||
public ConfigType(String string) {
|
||||
this.string = string;
|
||||
allTypes.put(string, this);
|
||||
if (!Arrays.asList(CORE_TYPES).contains(this)) {
|
||||
addonTypes.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<ConfigType> addonValues() {
|
||||
return addonTypes;
|
||||
}
|
||||
|
||||
public static ConfigType[] coreValues() {
|
||||
return CORE_TYPES;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
public static List<ConfigType> values() {
|
||||
List<ConfigType> values = new ArrayList<>();
|
||||
for (String key : allTypes.keySet()) {
|
||||
values.add(allTypes.get(key));
|
||||
}
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue