-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathConfig.java
More file actions
988 lines (898 loc) · 43.5 KB
/
Config.java
File metadata and controls
988 lines (898 loc) · 43.5 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
package com.zenith.util.config;
import com.google.common.collect.Lists;
import com.google.gson.annotations.SerializedName;
import com.zenith.feature.chatschema.ChatSchema;
import com.zenith.feature.tasks.Task;
import com.zenith.feature.waypoints.Waypoint;
import com.zenith.feature.whitelist.PlayerEntry;
import com.zenith.mc.item.ItemRegistry;
import com.zenith.module.impl.ActiveHours.ActiveTime;
import it.unimi.dsi.fastutil.ints.IntArraySet;
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
import lombok.Getter;
import org.geysermc.mcprotocollib.network.ProxyInfo;
import org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.*;
@NullMarked
public final class Config {
public final String warning = "DO NOT EDIT THIS FILE MANUALLY. Use commands to configure settings";
public final Authentication authentication = new Authentication();
public final Client client = new Client();
public final Debug debug = new Debug();
public final Server server = new Server();
public final Plugins plugins = new Plugins();
public final InteractiveTerminal interactiveTerminal = new InteractiveTerminal();
public final InGameCommands inGameCommands = new InGameCommands();
public final Theme theme = new Theme();
public final Discord discord = new Discord();
public final Database database = new Database();
public final AutoUpdater autoUpdater = new AutoUpdater();
public static final class Authentication {
public AccountType accountType = AccountType.DEVICE_CODE;
// only used for MSA
public String email = "not@set.com";
public String password = "abc123";
// updated on successful login
public String username = "Unknown";
public boolean prio = false;
public boolean authTokenRefresh = true;
public int msaLoginAttemptsBeforeCacheWipe = 2;
public boolean openBrowserOnLogin = true;
public boolean alwaysRefreshOnLogin = false;
public int maxRefreshIntervalMins = 360; // 6 hrs
public boolean useClientConnectionProxy = false;
public enum AccountType {
@SerializedName("msa") MSA,
@SerializedName("device_code") DEVICE_CODE,
@SerializedName("device_code_without_device_token") DEVICE_CODE_WITHOUT_DEVICE_TOKEN,
@SerializedName("prism") PRISM,
@SerializedName("offline") OFFLINE
}
}
public static final class Theme {
public ConfigColor primary = ConfigColor.CYAN;
public ConfigColor success = ConfigColor.MEDIUM_SEA_GREEN;
public ConfigColor error = ConfigColor.RUBY;
public ConfigColor inQueue = ConfigColor.MOON_YELLOW;
}
public static final class Client {
public final Server server = new Server();
public final ConnectionProxy connectionProxy = new ConnectionProxy();
public int compressionLevel = -1;
public boolean autoConnect = false; // auto-connect proxy on process start
public final ClientViaVersion viaversion = new ClientViaVersion();
public String bindAddress = "0.0.0.0";
public boolean maxPlaytimeReconnect = false;
public long maxPlaytimeReconnectMins = 1440;
public int defaultClientRenderDistance = 25;
public final ClientTimeout timeout = new ClientTimeout();
public final Ping ping = new Ping();
public final ChatSigning chatSigning = new ChatSigning();
public final Extra extra = new Extra();
public final Inventory inventory = new Inventory();
public final ChatSchemas chatSchemas = new ChatSchemas();
public final KeepAliveHandling keepAliveHandling = new KeepAliveHandling();
public static final class KeepAliveHandling {
public KeepAliveMode keepAliveMode = KeepAliveMode.PASSTHROUGH;
public int keepAliveQueueTimeoutMs = 2000;
public enum KeepAliveMode {
PASSTHROUGH,
INDEPENDENT
}
}
public static final class ChatSchemas {
public LinkedHashMap<String, ChatSchema> serverSchemas = new LinkedHashMap<>();
}
public static final class Inventory {
public int actionDelayTicks = 5;
public boolean autoCloseOpenContainers = true;
public int autoCloseOpenContainerAfterSeconds = 60;
public boolean ncpStrict = false;
}
public static final class ChatSigning {
public boolean enabled = true;
public boolean force = false;
public boolean signCommands = true;
}
public static final class ClientViaVersion {
public boolean enabled = false;
public boolean disableOn2b2t = true;
public boolean autoProtocolVersion = true;
public int protocolVersion = 765;
}
public static final class ClientTimeout {
public boolean enable = true;
public int seconds = 60;
}
public static final class Ping {
public int pingIntervalSeconds = 5;
public int pingQueueTimeoutMs = 2000;
}
public static final class Extra {
public final AntiAFK antiafk = new AntiAFK();
public final Spook spook = new Spook();
public final Utility utility = new Utility();
public final AutoReconnect autoReconnect = new AutoReconnect();
public final AutoRespawn autoRespawn = new AutoRespawn();
public final Spammer spammer = new Spammer();
public final AutoReply autoReply = new AutoReply();
public final Stalk stalk = new Stalk();
public final AutoEat autoEat = new AutoEat();
public final AutoFish autoFish = new AutoFish();
public final KillAura killAura = new KillAura();
public final AutoTotem autoTotem = new AutoTotem();
public final AntiLeak antiLeak = new AntiLeak();
public final Chat chat = new Chat();
public final AntiKick antiKick = new AntiKick();
public final ReplayMod replayMod = new ReplayMod();
public final ArrayList<PlayerEntry> friendsList = new ArrayList<>();
public boolean autoConnectOnLogin = true;
public boolean prioStatusChangeMention = true;
public boolean killMessage = true;
public boolean logChatMessages = true;
public boolean logOnlyQueuePositionUpdates = true;
public boolean reconfiguringNotification = true;
public final CoordObfuscation coordObfuscation = new CoordObfuscation();
public final ActionLimiter actionLimiter = new ActionLimiter();
public final VisualRange visualRange = new VisualRange();
public final AutoArmor autoArmor = new AutoArmor();
public final AutoMend autoMend = new AutoMend();
public final QueueWarning queueWarning = new QueueWarning();
public final Click click = new Click();
public final SessionTimeLimit sessionTimeLimit = new SessionTimeLimit();
public final AutoOmen autoOmen = new AutoOmen();
public final Pathfinder pathfinder = new Pathfinder();
public final SpawnPatrol spawnPatrol = new SpawnPatrol();
public final PearlLoader pearlLoader = new PearlLoader();
public final Waypoints waypoints = new Waypoints();
public final AutoDrop autoDrop = new AutoDrop();
public final AutoGap autoGap = new AutoGap();
public String whisperCommand = "msg";
public int tpsBufferSize = 20;
public final Tasks tasks = new Tasks();
public static final class Tasks {
public boolean enabled = true;
public final LinkedHashMap<String, Task> tasks = new LinkedHashMap<>();
public boolean logCommandActionOutput = true;
public boolean taskCommandExecutedNotification = true;
}
public static final class Waypoints {
public ArrayList<Waypoint> waypoints = new ArrayList<>();
}
public static final class PearlLoader {
public ArrayList<Pearl> pearls = new ArrayList<>();
public boolean returnToStartPos = true;
/**
* @param id player name or some other unique identifier
* @param x the position of the block we need to interact with to load the pearl
*/
public record Pearl(String id, int x, int y, int z) { }
}
public static final class Pathfinder {
public @Nullable Integer priority = null;
public boolean allowBreak = true;
public boolean allowSprint = false;
public boolean allowPlace = true;
public boolean allowInventory = true;
public boolean allowDownward = true;
public boolean allowParkour = false;
public boolean allowParkourPlace = false;
public boolean allowParkourAscend = false;
public boolean allowDiagonalDescend = false;
public boolean allowDiagonalAscend = false;
public boolean diagonalCentering = false;
public boolean traverseCentering = false;
public double blockPlacementPenalty = 20.0;
public double blockBreakAdditionalCost = 2;
public double jumpPenalty = 2.0;
public double lavaWalkCost = 200;
public int maxFallHeightNoWater = 3;
public boolean allowLongFall = false;
public double longFallCostLogMultiplier = 50;
public double longFallCostAddCost = 100;
public int followRadius = 2;
public int teleportDelayMs = 500;
public boolean renderPath = true;
public int pathRenderIntervalTicks = 10;
public boolean renderPathDetailed = false;
public int primaryTimeoutMs = 500;
public int failureTimeoutMs = 2000;
public int planAheadPrimaryTimeoutMs = 4000;
public int planAheadFailureTimeoutMs = 5000;
public int failedPathSearchCooldownMs = 1000;
public boolean getToBlockExploreForBlocks = true;
public boolean getToBlockBlacklistClosestOnFailure = false;
public boolean simplifyUnloadedYGoal = false;
public boolean placeBlockVerifyAbleToPlace = true;
public int interactWithProcessMaxPathTries = 5;
public boolean avoidUpdatingFallingBlocks = true;
public boolean pauseMiningForFallingBlocks = true;
public boolean autoTool = true;
public boolean assumeExternalAutoTool = false;
public boolean itemSaver = false;
public int itemSaverThreshold = 5;
public boolean preferSilkTouch = false;
public final Set<String> acceptableThrowawayItems = new ObjectArraySet<>(new String[]{
ItemRegistry.DIRT.name(),
ItemRegistry.COBBLESTONE.name(),
ItemRegistry.NETHERRACK.name(),
ItemRegistry.STONE.name(),
ItemRegistry.OBSIDIAN.name(),
ItemRegistry.CRYING_OBSIDIAN.name(),
ItemRegistry.BIRCH_PLANKS.name(),
ItemRegistry.JUNGLE_PLANKS.name(),
ItemRegistry.SPRUCE_PLANKS.name(),
ItemRegistry.DARK_OAK_PLANKS.name(),
ItemRegistry.ACACIA_PLANKS.name(),
ItemRegistry.WARPED_PLANKS.name(),
ItemRegistry.CHERRY_PLANKS.name(),
ItemRegistry.OAK_PLANKS.name()
});
public final Set<String> allowBreakAnyway = new ObjectArraySet<>();
}
public static class SessionTimeLimit {
public boolean enabled = true;
public IntArraySet ingameNotificationPositions = IntArraySet.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
public IntArraySet discordNotificationPositions = new IntArraySet();
public IntArraySet discordMentionPositions = new IntArraySet();
public boolean dynamic2b2tSessionTimeLimit = true;
}
public static class Click {
public @Nullable Integer priority = null;
public boolean enabled = true;
public boolean holdLeftClick = false;
public boolean holdRightClick = false;
public boolean hasRotation = false;
public boolean holdSneak = false;
public float rotationYaw = 0;
public float rotationPitch = 0;
public HoldRightClickMode holdRightClickMode = HoldRightClickMode.MAIN_HAND;
public HoldClickTarget holdClickTarget = HoldClickTarget.ANY;
public int holdRightClickInterval = 5;
public int holdLeftClickInterval = 0;
public float additionalBlockReach = 0;
public float additionalEntityReach = 0;
public enum HoldRightClickMode {
MAIN_HAND,
OFF_HAND,
ALTERNATE_HANDS
}
public enum HoldClickTarget {
ANY,
NONE,
ENTITY,
BLOCK
}
}
public static class SpawnPatrol {
public @Nullable Integer priority = null;
public boolean enabled = false;
public boolean ignoreFriends = true;
public boolean targetOnlyNakeds = true;
public boolean targetOnlyBedrock = false;
public boolean targetAttackers = true;
public boolean stickyTargeting = true;
public boolean nether = true;
public boolean stuckKill = true;
public int stuckKillSeconds = 60;
public int stuckKillMinDist = 10;
public boolean stuckKillAntiStuck = true;
public int goalX = 0;
public int goalY = 120;
public int goalZ = 0;
public int maxPatrolRange = 500;
public final ArrayList<PlayerEntry> ignoreList = new ArrayList<>();
}
public static final class QueueWarning {
public boolean enabled = true;
public IntArraySet warningPositions = IntArraySet.of(1, 2, 3, 10);
public IntArraySet mentionPositions = new IntArraySet();
}
public static class AutoMend {
public @Nullable Integer priority = null;
public boolean enabled = false;
}
public static class VisualRange {
public boolean enabled = true;
public boolean ignoreFriends = false;
public boolean enterAlert = true;
public boolean enterAlertMention = true;
public boolean leaveAlert = true;
public boolean logoutAlert = true;
public boolean enterWhisper = false;
public String enterWhisperMessage = "Hello, I am using ZenithProxy! I have alerted my owner that you are here!";
public int enterWhisperCooldownSeconds = 30;
public boolean enterWhisperWhilePlayerConnected = false;
public boolean replayRecording = false;
public ReplayRecordingMode replayRecordingMode = ReplayRecordingMode.ENEMY;
public int replayRecordingCooldownMins = 5;
public enum ReplayRecordingMode {
ENEMY,
ALL
}
}
public static class AutoArmor {
public @Nullable Integer priority = null;
public boolean enabled = false;
}
public static class AntiKick {
public boolean enabled = false;
public int playerInactivityKickMins = 15;
public int minWalkDistance = 2;
}
public static final class Chat {
public boolean enabled = true;
public final ArrayList<PlayerEntry> ignoreList = new ArrayList<>();
public boolean hideChat = false;
public boolean hideWhispers = false;
public boolean hideDeathMessages = false;
public boolean showConnectionMessages = false;
public boolean insertClickableLinks = false;
public boolean hide2b2tActionBarText = false;
public boolean replace2b2tChatCommands = false;
public boolean ignoreReplace2b2tChatCommandWhileDatabaseOn = true;
public boolean prefixChats = false;
public String prefix = ">";
public boolean suffixChats = false;
public String suffix = "| Sent from my ZenithProxy";
public boolean randomSuffix = false;
}
public static final class AutoTotem {
public @Nullable Integer priority = null;
public boolean enabled = true;
public boolean inGame = false;
public int healthThreshold = 20;
public boolean noTotemsAlert = false;
public boolean noTotemsAlertMention = false;
public boolean totemPopAlert = false;
public boolean totemPopAlertMention = false;
}
public static final class AntiLeak {
public boolean enabled = true;
// checks if numbers in chat are within a range from your coords
public boolean rangeCheck = true;
// the factor to divide and multiply your coords by to get the range
public double rangeFactor = 10.0;
}
public static final class KillAura {
public @Nullable Integer actionPriority = null;
public boolean enabled = false;
public boolean targetPlayers = false;
public boolean targetHostileMobs = true;
public boolean targetNeutralMobs = false;
public boolean targetCustom = false;
public boolean onlyNeutralAggressive = false;
public boolean onlyHostileAggressive = false;
public boolean switchWeapon = true;
public boolean targetArmorStands = false; // soft deprecated
public int attackDelayTicks = 10;
// When enabled, adjusts attackDelayTicks by current server TPS
// so attack rate stays consistent.
public boolean tpsSync = false;
public boolean raycast = false;
public final ArrayList<EntityType> customTargets = new ArrayList<>();
public Priority priority = Priority.NONE;
public WeaponType weaponType = WeaponType.ANY;
public WeaponMaterial weaponMaterial = WeaponMaterial.ANY;
public enum Priority {
NONE,
NEAREST
}
public enum WeaponType {
ANY,
SWORD,
AXE
}
public enum WeaponMaterial {
ANY,
NETHERITE,
DIAMOND
}
}
public static final class AutoEat {
public @Nullable Integer priority = null;
public boolean enabled = true;
public int healthThreshold = 10;
public int hungerThreshold = 10;
public boolean warning = true;
public boolean warningMention = false;
public boolean allowUnsafeFood = false;
public Mode mode = Mode.ALL;
public enum Mode {
ALL,
BLACKLIST,
WHITELIST
}
public HashSet<String> foods = new HashSet<>();
}
public static final class AutoGap {
public @Nullable Integer priority = null;
public boolean enabled = false;
public int healthThreshold = 10;
public boolean onFire = false;
}
public static final class AutoOmen {
public @Nullable Integer priority = null;
public boolean enabled = false;
public boolean whileRaidActive = false;
public boolean whileOmenActive = false;
public int raidCooldownMs = 1000;
public int omenCooldownMs = 1000;
}
public static final class Stalk {
public boolean enabled = false;
public final ArrayList<PlayerEntry> stalking = new ArrayList<>();
}
public static final class AutoFish {
public @Nullable Integer priority = null;
public boolean enabled = false;
public float yaw = 0.0f;
public float pitch = 0.0f;
}
public static final class AntiAFK {
public @Nullable Integer priority = null;
public Actions actions = new Actions();
public boolean enabled = true;
public static final class Actions {
public boolean walk = true;
// we only need about 5-6 blocks in reality but adding a few extra here to be safe
// this isn't dependent on chunks loading but is more based on distance
public int walkDistance = 8;
// avoid going off ledges even when falls are non-fatal
public boolean safeWalk = true;
public long walkDelayTicks = 400;
public boolean swingHand = true;
public long swingDelayTicks = 3000;
public boolean rotate = true;
public long rotateDelayTicks = 300L;
public boolean jump = false;
public boolean jumpOnlyInWater = true;
public long jumpDelayTicks = 1L;
public boolean sneak = false;
public long sneakDelayTicks = 200L;
}
}
public static final class Spook {
public @Nullable Integer priority = null;
public boolean enabled = false;
public TargetingMode spookTargetingMode = TargetingMode.VISUAL_RANGE;
public enum TargetingMode {
NEAREST,
VISUAL_RANGE
}
}
public static final class ReplayMod {
public boolean sendRecordingsToDiscord = false;
public int maxRecordingTimeMins = 0;
public AutoRecordMode autoRecordMode = AutoRecordMode.NONE;
public int replayRecordingHealthThreshold = 5;
public boolean fileIOUploadIfTooLarge = true;
public boolean featureFlags = true;
@Getter
public enum AutoRecordMode {
NONE("off"),
PROXY_CONNECTED("proxyConnected"),
PLAYER_CONNECTED("playerConnected"),
HEALTH("health");
private final String name;
AutoRecordMode(String name) {
this.name = name;
}
public static String[] names() {
return Arrays.stream(AutoRecordMode.values()).map(AutoRecordMode::getName).toArray(String[]::new);
}
}
}
public static final class Utility {
public final Actions actions = new Actions();
public static final class Actions {
public final AutoDisconnect autoDisconnect = new AutoDisconnect();
public final ActiveHours activeHours = new ActiveHours();
}
public static final class AutoDisconnect {
public boolean enabled = false;
public boolean healthDisconnect = true;
public boolean whilePlayerConnected = false;
public boolean autoClientDisconnect = false;
public int health = 5;
public boolean thunder = false;
public boolean cancelAutoReconnect = true;
// checks friends list, whitelist, and spectator whitelist
public boolean onUnknownPlayerInVisualRange = false;
public boolean mentionOnDisconnect = false;
public boolean onTotemPop = false;
public int minTotemsRemaining = 50;
}
public static final class ActiveHours {
public boolean enabled = false;
public boolean forceReconnect = false;
public boolean queueEtaCalc = true;
public boolean fullSessionUntilNextDisconnect = true;
public String timeZoneId = "Universal";
public final ArrayList<ActiveTime> activeTimes = new ArrayList<>();
}
}
public static final class AutoReconnect {
public boolean enabled = true;
public int delaySeconds = 5;
public int maxAttempts = 200;
}
public static final class AutoRespawn {
public boolean enabled = true;
public int delayMillis = 100;
}
public static final class Spammer {
public boolean enabled = false;
public boolean whilePlayerConnected = false;
public boolean whisper = false;
public long delayTicks = 200;
public boolean randomOrder = false;
public boolean appendRandom = false;
public final ArrayList<String> messages = Lists.newArrayList(
"ZenithProxy on top!",
"I just skipped queue thanks to ZenithProxy!",
"Download ZenithProxy on GitHub today! It's free!"
);
}
public static final class AutoReply {
public boolean enabled = false;
public int cooldownSeconds = 15;
public String message = "I am currently AFK, check back later or message me on discord.";
}
public static final class CoordObfuscation {
// all offsets in chunk coords
public boolean enabled = false;
public boolean validateSetup = true;
public boolean exemptProxyAccount = false;
public ObfuscationMode mode = ObfuscationMode.RANDOM_OFFSET;
public boolean obfuscateBedrock = true;
public boolean obfuscateChunkHeightmap = true;
public boolean obfuscateChunkLighting = true;
public boolean obfuscateBiomes = false;
public String obfuscateBiomesKey = "plains";
public int teleportOffsetRegenerateDistanceMin = 64; // minimum distance to regenerate coords at
public int randomMinDistanceFromSelf = 100_000;
public int randomMinDistanceFromSpawn = 100_000;
public int randomMaxDistanceFromSpawn = 29_000_000;
public int constantOffsetX = 0;
public int constantOffsetZ = 0;
public boolean constantOffsetNetherTranslate = true;
public int constantOffsetMinSpawnDistance = 100000; // min distance to spawn the actual coords are before player is disconnected
public int atLocationX = 0;
public int atLocationZ = 0;
public int delayPlayerLoginsAfterTpMs = 1000;
public boolean disconnectWhileEyeOfEnderPresent = true;
public boolean debugPacketLog = false;
public boolean disconnectWhileNearOffsetBlocks = true;
public enum ObfuscationMode {
RANDOM_OFFSET,
CONSTANT_OFFSET,
AT_LOCATION
}
}
public static class ActionLimiter {
public boolean enabled = false;
// be careful with this, auto respawn will still respawn after they disconnect
// there is a position check at login so it should be ok, but the respawn will still go through
public boolean allowRespawn = true;
public boolean allowMovement = true;
public int movementDistance = 1000; // distance from home coords
public int movementHomeX = 0;
public int movementHomeZ = 0;
public int movementMinY = -64;
public boolean allowEnderChest = true;
public boolean allowBlockBreaking = true;
// todo: dunno how to block this but still allow other interactions
// public boolean allowBlockPlacing = true;
public boolean allowInventory = true;
public boolean allowUseItem = true;
public boolean allowBookSigning = true;
public boolean allowInteract = true;
public boolean allowChat = true; // outbound chats
public boolean allowServerCommands = true; // includes whispers
public boolean exemptProxyAccount = false;
public boolean itemsBlacklistEnabled = false;
public final HashSet<String> itemsBlacklist = new HashSet<>();
}
}
public static final class Server {
public String address = "connect.2b2t.org";
public int port = 25565;
}
public static final class ConnectionProxy {
public boolean enabled = false;
public ProxyInfo.Type type = ProxyInfo.Type.SOCKS5;
public String host = "127.0.0.1";
public int port = 7890;
public String user = "";
public String password = "";
}
public static final class AutoDrop {
public @Nullable Integer priority = null;
public boolean enabled = false;
public Mode mode = Mode.WHITELIST;
public enum Mode {
ALL,
BLACKLIST,
WHITELIST
}
public ArrayList<String> items = new ArrayList<>();
public int delayTicks = 10;
public boolean dropStack = true;
public boolean requiresRotation = false;
public float yaw = 0.0f;
public float pitch = 0.0f;
}
}
public static final class Debug {
public final PacketLog packetLog = new PacketLog();
public final Server server = new Server();
public boolean clearOldLogs = false;
public boolean kickDisconnect = false;
public boolean debugLogs = false;
public boolean terminalDebugLogs = false;
public boolean inventorySyncOnLogin = false;
public boolean lockFile = true;
public boolean passthroughResourcePacks = true;
public boolean inputManagerDebugLogs = false;
public boolean botPitchPrecisionClamping = true;
public boolean botRotateBeforeInteract = true;
public boolean inventoryRequestServerSyncOnAction = false;
public boolean chainBreakSpeed2b2tFix = true;
public static final class PacketLog {
public boolean enabled = false;
public boolean logLevelDebug = true;
public PacketLogConfig clientPacketLog = new PacketLogConfig();
public PacketLogConfig serverPacketLog = new PacketLogConfig();
// todo: could be more flexible, but this can cover the most basic use cases
public String packetFilter = "";
public static final class PacketLogConfig {
public boolean received = false;
public boolean receivedBody = false;
public boolean preSent = false;
public boolean preSentBody = false;
public boolean postSent = false;
public boolean postSentBody = false;
}
}
public static final class Server {
public final Cache cache = new Cache();
public static final class Cache {
public boolean fullbrightChunkSkylight = true;
public boolean fullbrightChunkBlocklight = false;
// each map is 16kb, so 128 maps = ~2MB
public int maxCachedMaps = 128;
}
}
}
public static final class Server {
public final Bind bind = new Bind();
public int compressionThreshold = 256;
public int compressionLevel = -1;
public boolean enabled = true;
public final Extra extra = new Extra();
public final Ping ping = new Ping();
public final ServerViaVersion viaversion = new ServerViaVersion();
public boolean verifyUsers = true;
public boolean enforceMatchingConnectingAddress = false;
public boolean acceptTransfers = true;
public boolean onlyZenithTransfers = true;
public String proxyIP = "localhost";
public int queueStatusRefreshMinutes = 5; // how often to refresh queue lengths
public boolean dynamicQueueEtaEquation = true;
public boolean queueStatusRefreshWhileNotOn2b2t = true;
public boolean healthCheck = true;
public long playerListsRefreshIntervalMins = 1440L; // one day as default
public final Spectator spectator = new Spectator();
public final LoginRateLimiter loginRateLimiter = new LoginRateLimiter();
public boolean connectionTestOnStart = true;
public final PacketRateLimiter packetRateLimiter = new PacketRateLimiter();
public boolean upnp = false;
public boolean injectTablistFooter = true;
public boolean welcomeMessages = true;
public boolean updateServerIcon = true;
public boolean preferLoginAsController = true;
public final ChatSigning chatSigning = new ChatSigning();
public static final class ChatSigning {
public ChatSigningMode mode = ChatSigningMode.DISGUISED;
public enum ChatSigningMode {
PASSTHROUGH,
DISGUISED,
SYSTEM
}
}
public static final class PacketRateLimiter {
public boolean enabled = true;
public double intervalSeconds = 7.0;
public int maxPacketsPerInterval = 500;
public boolean logRate = false;
}
public static final class LoginRateLimiter {
public boolean enabled = true;
public int rateLimitSeconds = 2;
}
public static final class Spectator {
public boolean allowSpectator = true;
public String spectatorEntity = "cat";
public boolean spectatorPublicChatEnabled = true;
public boolean fullCommandsEnabled = true;
public boolean fullCommandsAcceptSlashCommands = true;
public boolean fullCommandsRequireRegularWhitelist = true;
public boolean playerCamOnJoin = false;
public boolean whitelistEnabled = true;
public ArrayList<PlayerEntry> whitelist = new ArrayList<>();
}
public static final class Bind {
public String address = "0.0.0.0";
public int port = 25565;
}
public static final class Extra {
public final ServerTimeout timeout = new ServerTimeout();
public final Whitelist whitelist = new Whitelist();
public final ChatHistory chatHistory = new ChatHistory();
public final ServerSwitcher serverSwitcher = new ServerSwitcher();
public static class ServerSwitcher {
public ArrayList<ServerSwitcherServer> servers = new ArrayList<>();
public record ServerSwitcherServer(String name, String address, int port) { }
}
public static class ChatHistory {
public boolean enable = false;
public int seconds = 30;
public int maxCount = 10;
public boolean spectators = true;
}
public static final class Whitelist {
public boolean enable = true;
public final ArrayList<PlayerEntry> whitelist = new ArrayList<>();
public String kickmsg = "no whitelist?";
// Automatically adds the proxy client account to the whitelist if not present
// does not remove any entries
public boolean autoAddClient = true;
// only checked when whitelist is disabled
public final ArrayList<PlayerEntry> blacklist = new ArrayList<>();
}
public static final class ServerTimeout {
public boolean enable = true;
public int seconds = 30;
}
}
public static final class Ping {
public boolean enabled = true;
public boolean onlinePlayers = false;
public boolean onlinePlayerCount = true;
public int maxPlayers = Integer.MAX_VALUE;
public boolean lanBroadcast = true;
public boolean responseCaching = true;
// could probably be increased 2-3x without issue
public int responseCacheSeconds = 10;
public boolean logPings = true;
}
public static final class ServerViaVersion {
public boolean enabled = true;
public boolean autoRemoveFromPipeline = true;
}
public String getProxyAddress() {
// if the proxy IP is not a DNS name and port is not present, append the port
if (!this.proxyIP.contains(":")
&& (this.proxyIP.matches("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+") || this.proxyIP.startsWith("localhost"))) // IP address
return this.proxyIP + ":" + this.bind.port;
else
return this.proxyIP;
}
public String getProxyAddressForTransfer() {
// get only the IP/address part. no port
if (this.proxyIP.contains(":")) {
return this.proxyIP.split(":")[0];
} else {
return this.proxyIP;
}
}
public int getProxyPortForTransfer() {
// get only the port part. no IP/address
if (this.proxyIP.contains(":")) {
return Integer.parseInt(this.proxyIP.split(":")[1]);
} else {
return this.bind.port;
}
}
}
public static class Plugins {
public boolean enabled = true;
public boolean blockCommandsUntilLoaded = false;
}
public static final class InteractiveTerminal {
public boolean enable = true;
public boolean logToDiscord = true;
public boolean allowDumbTerminal = true;
public boolean alwaysOnCompletions = true;
}
public static final class InGameCommands {
public boolean enable = true;
public boolean slashCommands = true;
public boolean slashCommandsReplacesServerCommands = false;
public boolean suggestions = true;
public String prefix = "!";
public boolean logToDiscord = true;
public boolean allowWhitelistedToUseAccountOwnerCommands = false;
}
public static final class Discord {
public boolean enable = false;
public String token = "";
public String channelId = "";
public String accountOwnerRoleId = "";
public String notificationMentionRoleId = "";
public String prefix = ".";
public boolean ignoreOtherBots = true;
public boolean reportCoords = true;
public boolean mentionRoleOnConnect = false;
public boolean mentionRoleOnPlayerOnline = false;
public boolean mentionRoleOnDisconnect = false;
public boolean mentionRoleOnStartQueue = false;
public boolean mentionRoleOnDeath = false;
public boolean mentionRoleOnServerRestart = false;
public boolean mentionRoleOnLoginFailed = false;
public boolean clientConnectionMessages = true;
public boolean mentionOnClientConnected = false;
public boolean mcVersionMismatchWarning = true;
public boolean mentionOnSpectatorConnected = false;
public boolean mentionOnClientDisconnected = false;
public boolean mentionOnNonWhitelistedClientConnected = false;
public boolean mentionOnSpectatorDisconnected = false;
public boolean mentionRoleOnPrioUpdate = true;
public boolean mentionRoleOnDeviceCodeAuth = true;
public boolean manageProfileImage = true;
public boolean manageNickname = true;
public boolean manageDescription = true;
public boolean managePresence = true;
public boolean showNonWhitelistLoginIP = true;
public boolean isUpdating = false; // internal use for update command state persistence
public final ChatRelay chatRelay = new ChatRelay();
public static class ChatRelay {
public boolean enable = false;
public boolean ignoreQueue = true;
public boolean mentionRoleOnWhisper = true;
public boolean mentionRoleOnNameMention = true;
public boolean mentionWhileConnected = false;
public boolean connectionMessages = false;
public boolean publicChats = true;
public boolean whispers = true;
public boolean serverMessages = true;
public boolean deathMessages = true;
public boolean sendMessages = true;
public String channelId = "";
public ArrayList<String> ignoreRegex = new ArrayList<>();
}
}
public static final class Database {
public boolean enabled = false;
public String host = "";
public int port = 5432;
public String username = "";
public String password = "";
public boolean queueWaitEnabled = true;
public boolean connectionsEnabled = true;
public boolean chatsEnabled = true;
public boolean deathsEnabled = true;
public boolean unknownDeathDiscordMsg = true;
public boolean queueLengthEnabled = true;
public boolean restartsEnabled = true;
public boolean playerCountEnabled = true;
public boolean tablistEnabled = true;
public boolean playtimeEnabled = true;
public boolean timeEnabled = true;
public final Lock lock = new Lock();
public static final class Lock {
// use "rediss://" for SSL connection
public String redisAddress = "redis://localhost:7181";
public String redisUsername = "";
public String redisPassword = "";
}
}
public static final class AutoUpdater {
public int autoUpdateCheckIntervalSeconds = 300;
// internal config, don't set this manually
public boolean shouldReconnectAfterAutoUpdate = false;
}
}