forked from Civcraft/Citadel
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCitadelConfigManager.java
More file actions
119 lines (93 loc) · 3.52 KB
/
Copy pathCitadelConfigManager.java
File metadata and controls
119 lines (93 loc) · 3.52 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package vg.civcraft.mc.citadel;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
public class CitadelConfigManager {
private static FileConfiguration config;
public CitadelConfigManager(FileConfiguration con){
config = con;
}
public static List<String> getReinforcementTypes(){
List<String> reinforcementTypes = new ArrayList<String>();
for (String sect: config.getConfigurationSection("reinforcements").getKeys(false))
reinforcementTypes.add(sect);
return reinforcementTypes;
}
public static List<String> getNaturalReinforcementTypes(){
List<String> naturalReinforcementTypes = new ArrayList<String>();
if (config.getConfigurationSection("natural_reinforcements") == null)
return naturalReinforcementTypes;
for (String sect: config.getConfigurationSection
("natural_reinforcements").getKeys(false))
naturalReinforcementTypes.add(sect);
return naturalReinforcementTypes;
}
public static List<String> getNonReinforceableTypes(){
List<String> nonReinforcementTypes = new ArrayList<String>();
if (config.getStringList("non_reinforceables") == null){
return nonReinforcementTypes;
}
for (String sect: config.getStringList("non_reinforceables"))
nonReinforcementTypes.add(sect);
return nonReinforcementTypes;
}
public static int getRequireMents(String type){
return config.getInt("reinforcements." + type + ".requirements");
}
public static int getReturns(String type){
return config.getInt("reinforcements." + type + ".return");
}
public static Material getMaterial(String type){
return Material.getMaterial(config.getString("reinforcements." + type + ".material"));
}
public static int getPercentReturn(String type){
return config.getInt("reinforcements." + type + ".percent_chance");
}
public static int getHitPoints(String type){
return config.getInt("reinforcements." + type + ".hit_points");
}
public static int getMaturationTime(String type){
return config.getInt("reinforcements." + type + ".mature_time");
}
public static int getAcidTime(String type) {
return config.getInt("reinforcements." + type + ".acid_time", getMaturationTime(type));
}
public static int getMaturationScale(String type){
return config.getInt("reinforcements." + type + ".scale_amount");
}
public static List<String> getLoreValues(String type){
return config.getStringList("reinforcements." + type + ".lore");
}
public static Material getNaturalReinforcementMaterial(String type){
return Material.valueOf(config.getString("natural_reinforcements." +
type + ".material"));
}
public static int getNaturalReinforcementHitPoints(String type){
return config.getInt("natural_reinforcements." + type + ".hit_points");
}
public static int getPlayerStateReset(){
return config.getInt("reset_player_state");
}
public static boolean isMaturationEnabled(){
return config.getBoolean("enable_maturation");
}
public static int getMaxCacheSize(){
return config.getInt("max_cache_size");
}
public static long getMaxCacheMinutes(){
return config.getLong("max_cache_load_time");
}
public static int getMaxRedstoneDistance(){
return config.getInt("redstone_distance");
}
public static Material getAcidBlock(){
return Material.valueOf(config.getString("acidblock_material"));
}
public static boolean shouldDropReinforcedBlock(){
return config.getBoolean("drop_reinforced_block");
}
public static int getTickRepeatingSave(){
return config.getInt("save_interval_ticks", 500);
}
}