-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOptCarpetSettings.java
More file actions
272 lines (227 loc) · 9.21 KB
/
OptCarpetSettings.java
File metadata and controls
272 lines (227 loc) · 9.21 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
package io.github.optijava.opt_carpet_addition;
//#if MC >= 11900
//$$ import carpet.api.settings.RuleCategory;
//#else
import carpet.settings.RuleCategory;
//#endif
import carpet.settings.Rule;
import io.github.optijava.opt_carpet_addition.utils.config_bean.CommandLoggerConfigBean;
import io.github.optijava.opt_carpet_addition.utils.config_bean.TpLimitConfigBean;
import io.github.optijava.opt_carpet_addition.utils.validator.CustomItemDiscardTimeValidator;
import io.github.optijava.opt_carpet_addition.utils.validator.PlayerTpRateLimitTimeValidator;
import net.fabricmc.loader.api.FabricLoader;
import java.nio.file.Path;
//#if MC >= 11900
//$$ @SuppressWarnings("all")
//#endif
public class OptCarpetSettings {
public static final String OCA = "OCA";
public static final String FALSE = "false";
public static Path configDirectory = FabricLoader.getInstance().getConfigDir().resolve("opt-carpet-addition");
// Tp command rules =======================================================================
@Rule(
desc = "Enables [/player xxx tp] to teleport to fake player",
category = {RuleCategory.COMMAND,OCA},
options = {"true", "false", "ops"}
)
public static String commandTpToFakePlayer = FALSE;
@Rule(
desc = "Enables [/player xxx tp] to teleport to real player",
category = {RuleCategory.COMMAND,OCA},
options = {"true", "false", "ops"}
)
public static String allowTpToRealPlayer = FALSE;
@Rule(
desc = "Enables [/player xxx tp] to teleport to fake player",
category = {RuleCategory.COMMAND,OCA},
options = {"true", "false", "ops"}
)
public static String commandTpHereFakePlayer = FALSE;
@Rule(
desc = "Enables [/player xxx tp] to teleport to real player",
category = {RuleCategory.COMMAND,OCA},
options = {"true", "false", "ops"}
)
public static String allowTpHereRealPlayer = FALSE;
// Force fake player gamemode rule =========================================================
@Rule(
desc = "Force fake player gamemode",
category = {RuleCategory.FEATURE,OCA},
options = {"survival", "creative", "adventure", "false"}
)
public static String forceFakePlayerGameMode = FALSE;
// Fix bugs ================================================================================
@Rule(
desc = "Refresh xp level when player change world",
category = {RuleCategory.BUGFIX,OCA}
)
public static boolean fixXpLevelBug = false;
// Tp whitelist/blacklist ====================================================================
public static TpLimitConfigBean tpLimitConfigBean;
public static CommandLoggerConfigBean commandLoggerConfigBean;
@Rule(
desc = "Enable tp prefix blacklist",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean enableTpPrefixBlacklist = false;
@Rule(
desc = "Enable tp prefix whitelist",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean enableTpPrefixWhitelist = false;
@Rule(
desc = "Enable tp here prefix blacklist",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean enableTpHerePrefixBlacklist = false;
@Rule(
desc = "Enable tp here prefix whitelist",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean enableTpHerePrefixWhitelist = false;
@Rule(
desc = "Disable chicken lays eggs",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean disabledLayEggs = false;
@Rule(
desc = "Disable enderman pickup block goal",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean disabledEnderManPickupGoal = false;
@Rule(
desc = "Disable enderman place block goal",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean disabledEnderManPlaceBlockGoal = false;
@Rule(
desc = "Disable zombified piglin spawn in nether portal",
category = {RuleCategory.OPTIMIZATION, RuleCategory.FEATURE,OCA}
)
public static boolean disabledNetherPortalSpawn = false;
@Rule(
desc = "Disable entity tick(contains all entity and BlockEntity)",
category = {RuleCategory.EXPERIMENTAL,OCA}
)
public static boolean disabledEntityTick = false;
//#if MC < 11900
@Rule(
desc = "Disable error stack when update suppression.",
category = {RuleCategory.BUGFIX,OCA}
)
public static boolean disabledUpdateSuppressionErrorStackTrace = false;
//#endif
@Rule(
desc = "Unescape chat message. \\u4e2d -> 中",
category = {RuleCategory.FEATURE, RuleCategory.CLIENT,OCA}
)
public static boolean unescapeChatMessage = false;
//#if MC < 11900
@Rule(
desc = "Handle player connect in a new thread to reduce the lag.",
category = {RuleCategory.OPTIMIZATION, RuleCategory.EXPERIMENTAL,OCA}
)
public static boolean optimizePlayerConnect = false;
//#endif
//#if MC < 11900
@Rule(
desc = "Handle player teleport in a new thread to reduce the lag.",
category = {RuleCategory.OPTIMIZATION, RuleCategory.EXPERIMENTAL,OCA}
)
public static boolean optimizeTeleport = false;
//#endif
@Rule(
desc = "Print info log when players submit command",
category = {RuleCategory.COMMAND, RuleCategory.FEATURE,OCA}
)
public static boolean commandLogger = false;
//#if MC < 11900
@Rule(
desc = "Dropper crash fix",
category = {RuleCategory.BUGFIX,OCA}
)
public static boolean dropperCrashFix = false;
//#endif
@Rule(
desc = "Always spawn offline fake player to reduce lagging",
category = {RuleCategory.OPTIMIZATION,OCA}
)
public static boolean optimizeFakePlayerSpawn = false;
//#if MC < 12100
@Rule(
desc = "Fix CCE Suppression crashes",
category = {RuleCategory.BUGFIX, RuleCategory.EXPERIMENTAL,OCA}
)
public static boolean cceSuppressionCrashFix = false;
//#endif
@Rule(
desc = "Remove every armour which has `curse of binding` enchantment when player dead in wall (keepInventory must be true).",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean removeAllCurseOfBindingArmorWhenPlayerDeadInWall = false;
@Rule(
desc = "Modify item disappeared time, default value -1 (unit: tick)",
category = {RuleCategory.FEATURE,OCA},
options = {"-1", "6000"},
strict = false,
validate = CustomItemDiscardTimeValidator.class
)
public static int customItemDiscardTime = -1;
//#if MC >= 12000
//$$ @Rule(
//$$ desc = "Disallow redstone wire connects to open trapdoor(in version >= 1.20)",
//$$ category = {RuleCategory.FEATURE,OCA}
//$$ )
//$$ public static boolean disallowRedstoneWireConnectsToOpenTrapdoor = false;
//#endif
@Rule(
desc = "Don't enable this rule unless you need blockUpdate logger! Enabling this rule may cause performance issues, so this rule was false by default. Before you set this rule to true, everyone can not use blockUpdate logger.",
category = {RuleCategory.FEATURE, RuleCategory.OPTIMIZATION,OCA}
)
public static boolean allowBlockUpdateLogger = false;
@Rule(
desc = "Don't spawn bats!",
category = {RuleCategory.FEATURE,OCA}
)
public static boolean removeBats = false;
@Rule(
desc = "The rate limit of `/player xxx tp` command. Default: permit 1 request per 2 seconds per player.",
category = {RuleCategory.FEATURE, RuleCategory.COMMAND,OCA},
validate = PlayerTpRateLimitTimeValidator.class,
strict = false,
options = {"2"}
)
public static int playerTpRateLimitTime = 2;
@Rule(
desc = "If enabled, command logger will broadcast commands to those players.",
category = {RuleCategory.COMMAND, RuleCategory.FEATURE,OCA},
options = {"true", "false", "ops"}
)
public static String commandLoggerBroadcastToPlayer = FALSE;
@Rule(
desc = "allow spectator tp to any player!",
category = {RuleCategory.FEATURE, RuleCategory.COMMAND,OCA},
options = {"true", "false"}
)
public static boolean allowSpectatorTpToAnyPlayer = false;
@Rule(
desc = "enableLoggerCommand",
category = {RuleCategory.COMMAND , OCA}
)
public static boolean enableLoggerCommand = true;
@Rule(
desc = "enableCrashCommand",
category = {RuleCategory.COMMAND , OCA}
)
public static boolean enableCrashCommand = true;
@Rule(
desc = "enableListAdvanceCommand",
category = {RuleCategory.COMMAND , OCA}
)
public static boolean enableListAdvanceCommand = true;
@Rule(
desc = "enableTpmanagerCommand",
category = {RuleCategory.COMMAND , OCA}
)
public static boolean enableTpmanagerCommand = true;
}