-
Notifications
You must be signed in to change notification settings - Fork 25
/
ReactorConfig.java
59 lines (46 loc) · 2 KB
/
ReactorConfig.java
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
/*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2017
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.ReactorCraft;
import java.util.ArrayList;
import java.util.HashSet;
import Reika.DragonAPI.Base.DragonAPIMod;
import Reika.DragonAPI.Instantiable.IO.ControlledConfig;
import Reika.DragonAPI.Interfaces.Configuration.ConfigList;
import Reika.DragonAPI.Interfaces.Registry.IDRegistry;
import Reika.DragonAPI.Libraries.Java.ReikaJavaLibrary;
import Reika.ReactorCraft.Registry.ReactorAchievements;
public class ReactorConfig extends ControlledConfig {
private DataElement<Integer> potionID;
private static final ArrayList<String> entries = ReikaJavaLibrary.getEnumEntriesWithoutInitializing(ReactorAchievements.class);
public DataElement<Integer>[] achievementIDs = new DataElement[entries.size()];
private DataElement<int[]> heavyWaterDimensions;
private HashSet<Integer> heavyWaterDimensionSet;
public ReactorConfig(DragonAPIMod mod, ConfigList[] option, IDRegistry[] id) {
super(mod, option, id);
potionID = this.registerAdditionalOption("Other", "Radiation Effect ID", 140);
for (int i = 0; i < entries.size(); i++) {
String name = entries.get(i);
achievementIDs[i] = this.registerAdditionalOption("Achievement IDs", name, 72000+i);
}
heavyWaterDimensions = this.registerAdditionalOption("Other Options", "Heavy Water Dimensions (Empty for All)", new int[0]);
}
public boolean isDimensionValidForHeavyWater(int dim) {
if (heavyWaterDimensionSet == null) {
heavyWaterDimensionSet = new HashSet();
for (int val : heavyWaterDimensions.getData()) {
heavyWaterDimensionSet.add(val);
}
}
return heavyWaterDimensionSet.isEmpty() || heavyWaterDimensionSet.contains(dim);
}
public int getRadiationPotionID() {
return potionID.getData();
}
}