forked from ReikaKalseki/DragonAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDragonOptions.java
More file actions
124 lines (102 loc) · 3.17 KB
/
DragonOptions.java
File metadata and controls
124 lines (102 loc) · 3.17 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
120
121
122
123
124
/*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2015
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.DragonAPI;
import Reika.DragonAPI.Interfaces.Configuration.BooleanConfig;
import Reika.DragonAPI.Interfaces.Configuration.IntegerConfig;
public enum DragonOptions implements IntegerConfig, BooleanConfig {
LOGLOADING("Console Loading Info", true),
FILELOG("Log Loading Info To Separate File", false),
DEBUGMODE("Debug Mode", false),
SYNCPACKET("Sync Packet ID", 182),
NORENDERS("Disable Renders For Debug", false),
TABNBT("Show TileEntity NBT when using TAB", false),
SOUNDCHANNELS("Increase sound channel count", true),
UNNERFOBSIDIAN("Restore Obsidian Blast Resistance", true),
CHATERRORS("Log errors to chat", true),
SORTCREATIVE("Sort Creative Tabs Alphabetically", true),
CUSTOMRENDER("Custom/Donator Renders", true),
OPONLYUPDATE("Only show update notice to Ops or SSP", false),
PACKONLYUPDATE("Only show update notice to pack creator", false),
GREGORES("Force Gregtech Ore Compatibility", true),
LOGSYNCCME("Log Sync Packet CME Avoidance", true),
SLOWSYNC("Slow Sync Packets - Only use this as a last resort", false),
NONULLITEMS("Disallow Null-Item ItemStacks to Prevent Crashes", true),
LAGWARNING("Minimum Delay (ms) for 'Can't Keep Up!' Log Warning", 0),
CHECKSANITY("Check Environment Sanity", true),
FIXSANITY("Attempt to Repair Environment Sanity", false),
//RECURSE("Recursion Limit Override", -1),
;//COMPOUNDSYNC("Compound Sync Packet System - Use at own risk", false);
private String label;
private boolean defaultState;
private int defaultValue;
private String defaultString;
private Class type;
private boolean enforcing = false;
public static final DragonOptions[] optionList = values();
private DragonOptions(String l, boolean d) {
label = l;
defaultState = d;
type = boolean.class;
}
private DragonOptions(String l, boolean d, boolean tag) {
this(l, d);
enforcing = true;
}
private DragonOptions(String l, int d) {
label = l;
defaultValue = d;
type = int.class;
}
private DragonOptions(String l, String s) {
label = l;
defaultString = s;
type = String.class;
}
public boolean isBoolean() {
return type == boolean.class;
}
public boolean isNumeric() {
return type == int.class;
}
public boolean isString() {
return type == String.class;
}
public Class getPropertyType() {
return type;
}
public String getLabel() {
return label;
}
public boolean getState() {
return (Boolean)DragonAPIInit.config.getControl(this.ordinal());
}
public int getValue() {
return (Integer)DragonAPIInit.config.getControl(this.ordinal());
}
public boolean isDummiedOut() {
return type == null;
}
@Override
public boolean getDefaultState() {
return defaultState;
}
@Override
public int getDefaultValue() {
return defaultValue;
}
@Override
public boolean isEnforcingDefaults() {
return enforcing;
}
@Override
public boolean shouldLoad() {
return true;
}
}