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
|
package me.Danker.features.loot;
import me.Danker.events.ChestSlotClickedEvent;
import me.Danker.handlers.ConfigHandler;
import me.Danker.handlers.ScoreboardHandler;
import me.Danker.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StringUtils;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.List;
public class CatacombsTracker {
// Catacombs Dungeons
public static int recombobulators;
public static int fumingPotatoBooks;
// F1
public static int f1SPlus;
public static int bonzoStaffs;
public static double f1CoinsSpent;
public static double f1TimeSpent;
// F2
public static int f2SPlus;
public static int scarfStudies;
public static int adaptiveSwords;
public static double f2CoinsSpent;
public static double f2TimeSpent;
// F3
public static int f3SPlus;
public static int adaptiveHelms;
public static int adaptiveChests;
public static int adaptiveLegs;
public static int adaptiveBoots;
public static double f3CoinsSpent;
public static double f3TimeSpent;
// F4
public static int f4SPlus;
public static int spiritWings;
public static int spiritBones;
public static int spiritBoots;
public static int spiritSwords;
public static int spiritBows;
public static int epicSpiritPets;
public static int legSpiritPets;
public static double f4CoinsSpent;
public static double f4TimeSpent;
// F5
public static int f5SPlus;
public static int warpedStones;
public static int shadowAssHelms;
public static int shadowAssChests;
public static int shadowAssLegs;
public static int shadowAssBoots;
public static int lastBreaths;
public static int lividDaggers;
public static int shadowFurys;
public static double f5CoinsSpent;
public static double f5TimeSpent;
// F6
public static int f6SPlus;
public static int ancientRoses;
public static int precursorEyes;
public static int giantsSwords;
public static int necroLordHelms;
public static int necroLordChests;
public static int necroLordLegs;
public static int necroLordBoots;
public static int necroSwords;
public static int f6Rerolls;
public static double f6CoinsSpent;
public static double f6TimeSpent;
// F7
public static int f7SPlus;
public static int witherBloods;
public static int witherCloaks;
public static int implosions;
public static int witherShields;
public static int shadowWarps;
public static int necronsHandles;
public static int autoRecombs;
public static int witherHelms;
public static int witherChests;
public static int witherLegs;
public static int witherBoots;
public static int f7Rerolls;
public static double f7CoinsSpent;
public static double f7TimeSpent;
// MM
public static int m1S;
public static int m1SPlus;
public static int m2S;
public static int m2SPlus;
public static int m3S;
public static int m3SPlus;
public static int m4S;
public static int m4SPlus;
public static int m5S;
public static int m5SPlus;
public static int m6S;
public static int m6SPlus;
public static int m7S;
public static int m7SPlus;
public static int firstStars;
public static int secondStars;
public static int thirdStars;
public static int fourthStars;
public static int fifthStars;
public static int necronDyes;
public static int darkClaymores;
public static int masterRerolls;
public static double masterCoinsSpent;
public static double masterTimeSpent;
// Catacombs Dungeons
public static int recombobulatorsSession = 0;
public static int fumingPotatoBooksSession = 0;
// F1
public static int f1SPlusSession = 0;
public static int bonzoStaffsSession = 0;
public static double f1CoinsSpentSession = 0;
public static double f1TimeSpentSession = 0;
// F2
public static int f2SPlusSession = 0;
public static int scarfStudiesSession = 0;
public static int adaptiveSwordsSession = 0;
public static double f2CoinsSpentSession = 0;
public static double f2TimeSpentSession = 0;
// F3
public static int f3SPlusSession = 0;
public static int adaptiveHelmsSession = 0;
public static int adaptiveChestsSession = 0;
public static int adaptiveLegsSession = 0;
public static int adaptiveBootsSession = 0;
public static double f3CoinsSpentSession = 0;
public static double f3TimeSpentSession = 0;
// F4
public static int f4SPlusSession = 0;
public static int spiritWingsSession = 0;
public static int spiritBonesSession = 0;
public static int spiritBootsSession = 0;
public static int spiritSwordsSession = 0;
public static int spiritBowsSession = 0;
public static int epicSpiritPetsSession = 0;
public static int legSpiritPetsSession = 0;
public static double f4CoinsSpentSession = 0;
public static double f4TimeSpentSession = 0;
// F5
public static int f5SPlusSession = 0;
public static int warpedStonesSession = 0;
public static int shadowAssHelmsSession = 0;
public static int shadowAssChestsSession = 0;
public static int shadowAssLegsSession = 0;
public static int shadowAssBootsSession = 0;
public static int lastBreathsSession = 0;
public static int lividDaggersSession = 0;
public static int shadowFurysSession = 0;
public static double f5CoinsSpentSession = 0;
public static double f5TimeSpentSession = 0;
// F6
public static int f6SPlusSession = 0;
public static int ancientRosesSession = 0;
public static int precursorEyesSession = 0;
public static int giantsSwordsSession = 0;
public static int necroLordHelmsSession = 0;
public static int necroLordChestsSession = 0;
public static int necroLordLegsSession = 0;
public static int necroLordBootsSession = 0;
public static int necroSwordsSession = 0;
public static int f6RerollsSession = 0;
public static double f6CoinsSpentSession = 0;
public static double f6TimeSpentSession = 0;
// F7
public static int f7SPlusSession = 0;
public static int witherBloodsSession = 0;
public static int witherCloaksSession = 0;
public static int implosionsSession = 0;
public static int witherShieldsSession = 0;
public static int shadowWarpsSession = 0;
public static int necronsHandlesSession = 0;
public static int autoRecombsSession = 0;
public static int witherHelmsSession = 0;
public static int witherChestsSession = 0;
public static int witherLegsSession = 0;
public static int witherBootsSession = 0;
public static int f7RerollsSession = 0;
public static double f7CoinsSpentSession = 0;
public static double f7TimeSpentSession = 0;
// MM
public static int m1SSession = 0;
public static int m1SPlusSession = 0;
public static int m2SSession = 0;
public static int m2SPlusSession = 0;
public static int m3SSession = 0;
public static int m3SPlusSession = 0;
public static int m4SSession = 0;
public static int m4SPlusSession = 0;
public static int m5SSession = 0;
public static int m5SPlusSession = 0;
public static int m6SSession = 0;
public static int m6SPlusSession = 0;
public static int m7SSession = 0;
public static int m7SPlusSession = 0;
public static int firstStarsSession = 0;
public static int secondStarsSession = 0;
public static int thirdStarsSession = 0;
public static int fourthStarsSession = 0;
public static int fifthStarsSession = 0;
public static int necronDyesSession = 0;
public static int darkClaymoresSession = 0;
public static int masterRerollsSession = 0;
public static double masterCoinsSpentSession = 0;
public static double masterTimeSpentSession = 0;
@SubscribeEvent
public void onChat(ClientChatReceivedEvent event) {
String message = StringUtils.stripControlCodes(event.message.getUnformattedText());
if (!Utils.inDungeons) return;
if (event.type == 2) return;
if (message.contains(" Team Score: ")) {
if (message.contains("(S+)")) {
switch (Utils.currentFloor) {
case F1:
f1SPlus++;
f1SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus);
break;
case F2:
f2SPlus++;
f2SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus);
break;
case F3:
f3SPlus++;
f3SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus);
break;
case F4:
f4SPlus++;
f4SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus);
break;
case F5:
f5SPlus++;
f5SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus);
break;
case F6:
f6SPlus++;
f6SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus);
break;
case F7:
f7SPlus++;
f7SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus);
break;
case M1:
m1S++;
m1SPlus++;
m1SSession++;
m1SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterOneS", m1S);
ConfigHandler.writeIntConfig("catacombs", "masterOneSPlus", m1SPlus);
break;
case M2:
m2S++;
m2SPlus++;
m2SSession++;
m2SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterTwoS", m2S);
ConfigHandler.writeIntConfig("catacombs", "masterTwoSPlus", m2SPlus);
break;
case M3:
m3S++;
m3SPlus++;
m3SSession++;
m3SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterThreeS", m3S);
ConfigHandler.writeIntConfig("catacombs", "masterThreeSPlus", m3SPlus);
break;
case M4:
m4S++;
m4SPlus++;
m4SSession++;
m4SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterFourS", m4S);
ConfigHandler.writeIntConfig("catacombs", "masterFourSPlus", m4SPlus);
break;
case M5:
m5S++;
m5SPlus++;
m5SSession++;
m5SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterFiveS", m5S);
ConfigHandler.writeIntConfig("catacombs", "masterFiveSPlus", m5SPlus);
break;
case M6:
m6S++;
m6SPlus++;
m6SSession++;
m6SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterSixS", m6S);
ConfigHandler.writeIntConfig("catacombs", "masterSixSPlus", m6SPlus);
break;
case M7:
m7S++;
m7SPlus++;
m7SSession++;
m7SPlusSession++;
ConfigHandler.writeIntConfig("catacombs", "masterSevenS", m7S);
ConfigHandler.writeIntConfig("catacombs", "masterSevenSPlus", m7SPlus);
break;
}
} else if (message.contains("(S)")) {
switch (Utils.currentFloor) {
case M1:
m1S++;
m1SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterOneS", m1S);
break;
case M2:
m2S++;
m2SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterTwoS", m2S);
break;
case M3:
m3S++;
m3SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterThreeS", m3S);
break;
case M4:
m4S++;
m4SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterFourS", m4S);
break;
case M5:
m5S++;
m5SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterFiveS", m5S);
break;
case M6:
m6S++;
m6SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterSixS", m6S);
break;
case M7:
m7S++;
m7SSession++;
ConfigHandler.writeIntConfig("catacombs", "masterSevenS", m7S);
break;
}
}
}
if (message.contains(":")) return;
if (message.contains(" ")) {
if (message.contains("Recombobulator 3000")) {
recombobulators++;
recombobulatorsSession++;
ConfigHandler.writeIntConfig("catacombs", "recombobulator", recombobulators);
} else if (message.contains("Fuming Potato Book")) {
fumingPotatoBooks++;
fumingPotatoBooksSession++;
ConfigHandler.writeIntConfig("catacombs", "fumingBooks", fumingPotatoBooks);
} else if (message.contains("Bonzo's Staff")) { // F1
bonzoStaffs++;
bonzoStaffsSession++;
ConfigHandler.writeIntConfig("catacombs", "bonzoStaff", bonzoStaffs);
} else if (message.contains("Scarf's Studies")) { // F2
scarfStudies++;
scarfStudiesSession++;
ConfigHandler.writeIntConfig("catacombs", "scarfStudies", scarfStudies);
} else if (message.contains("Adaptive Helmet")) { // F3
adaptiveHelms++;
adaptiveHelmsSession++;
ConfigHandler.writeIntConfig("catacombs", "adaptiveHelm", adaptiveHelms);
} else if (message.contains("Adaptive Chestplate")) {
adaptiveChests++;
adaptiveChestsSession++;
ConfigHandler.writeIntConfig("catacombs", "adaptiveChest", adaptiveChests);
} else if (message.contains("Adaptive Leggings")) {
adaptiveLegs++;
adaptiveLegsSession++;
ConfigHandler.writeIntConfig("catacombs", "adaptiveLegging", adaptiveLegs);
} else if (message.contains("Adaptive Boots")) {
adaptiveBoots++;
adaptiveBootsSession++;
ConfigHandler.writeIntConfig("catacombs", "adaptiveBoot", adaptiveBoots);
} else if (message.contains("Adaptive Blade")) {
adaptiveSwords++;
adaptiveSwordsSession++;
ConfigHandler.writeIntConfig("catacombs", "adaptiveSword", adaptiveSwords);
} else if (message.contains("Spirit Wing")) { // F4
spiritWings++;
spiritWingsSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritWing", spiritWings);
} else if (message.contains("Spirit Bone")) {
spiritBones++;
spiritBonesSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritBone", spiritBones);
} else if (message.contains("Spirit Boots")) {
spiritBoots++;
spiritBootsSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritBoot", spiritBoots);
} else if (message.contains("[Lvl 1] Spirit")) {
String formattedMessage = event.message.getFormattedText();
// Unicode colour code messes up here, just gonna remove the symbols
if (formattedMessage.contains("5Spirit")) {
epicSpiritPets++;
epicSpiritPetsSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritPetEpic", epicSpiritPets);
} else if (formattedMessage.contains("6Spirit")) {
legSpiritPets++;
legSpiritPetsSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritPetLeg", legSpiritPets);
}
} else if (message.contains("Spirit Sword")) {
spiritSwords++;
spiritSwordsSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritSword", spiritSwords);
} else if (message.contains("Spirit Bow")) {
spiritBows++;
spiritBowsSession++;
ConfigHandler.writeIntConfig("catacombs", "spiritBow", spiritBows);
} else if (message.contains("Warped Stone")) { // F5
warpedStones++;
warpedStonesSession++;
ConfigHandler.writeIntConfig("catacombs", "warpedStone", warpedStones);
} else if (message.contains("Shadow Assassin Helmet")) {
shadowAssHelms++;
shadowAssHelmsSession++;
ConfigHandler.writeIntConfig("catacombs", "shadowAssassinHelm", shadowAssHelms);
} else if (message.contains("Shadow Assassin Chestplate")) {
shadowAssChests++;
shadowAssChestsSession++;
ConfigHandler.writeIntConfig("catacombs", "shadowAssassinChest", shadowAssChests);
} else if (message.contains("Shadow Assassin Leggings")) {
shadowAssLegs++;
shadowAssLegsSession++;
ConfigHandler.writeIntConfig("catacombs", "shadowAssassinLegging", shadowAssLegs);
} else if (message.contains("Shadow Assassin Boots")) {
shadowAssBoots++;
shadowAssBootsSession++;
ConfigHandler.writeIntConfig("catacombs", "shadowAssassinBoot", shadowAssBoots);
} else if (message.contains("Livid Dagger")) {
lividDaggers++;
lividDaggersSession++;
ConfigHandler.writeIntConfig("catacombs", "lividDagger", lividDaggers);
} else if (message.contains("Shadow Fury")) {
shadowFurys++;
shadowFurysSession++;
ConfigHandler.writeIntConfig("catacombs", "shadowFury", shadowFurys);
} else if (message.contains("Ancient Rose")) { // F6
ancientRoses++;
ancientRosesSession++;
ConfigHandler.writeIntConfig("catacombs", "ancientRose", ancientRoses);
} else if (message.contains("Precursor Eye")) {
precursorEyes++;
precursorEyesSession++;
ConfigHandler.writeIntConfig("catacombs", "precursorEye", precursorEyes);
} else if (message.contains("Giant's Sword")) {
giantsSwords++;
giantsSwordsSession++;
ConfigHandler.writeIntConfig("catacombs", "giantsSword", giantsSwords);
} else if (message.contains("Necromancer Lord Helmet")) {
necroLordHelms++;
necroLordHelmsSession++;
ConfigHandler.writeIntConfig("catacombs", "necroLordHelm", necroLordHelms);
} else if (message.contains("Necromancer Lord Chestplate")) {
necroLordChests++;
necroLordChestsSession++;
ConfigHandler.writeIntConfig("catacombs", "necroLordChest", necroLordChests);
} else if (message.contains("Necromancer Lord Leggings")) {
necroLordLegs++;
necroLordLegsSession++;
ConfigHandler.writeIntConfig("catacombs", "necroLordLegging", necroLordLegs);
} else if (message.contains("Necromancer Lord Boots")) {
necroLordBoots++;
necroLordBootsSession++;
ConfigHandler.writeIntConfig("catacombs", "necroLordBoot", necroLordBoots);
} else if (message.contains("Necromancer Sword")) {
necroSwords++;
necroSwordsSession++;
ConfigHandler.writeIntConfig("catacombs", "necroSword", necroSwords);
} else if (message.contains("Wither Blood")) { // F7
witherBloods++;
witherBloodsSession++;
ConfigHandler.writeIntConfig("catacombs", "witherBlood", witherBloods);
} else if (message.contains("Wither Cloak")) {
witherCloaks++;
witherCloaksSession++;
ConfigHandler.writeIntConfig("catacombs", "witherCloak", witherCloaks);
} else if (message.contains("Implosion")) {
implosions++;
implosionsSession++;
ConfigHandler.writeIntConfig("catacombs", "implosion", implosions);
} else if (message.contains("Wither Shield")) {
witherShields++;
witherShieldsSession++;
ConfigHandler.writeIntConfig("catacombs", "witherShield", witherShields);
} else if (message.contains("Shadow Warp")) {
shadowWarps++;
shadowWarpsSession++;
ConfigHandler.writeIntConfig("catacombs", "shadowWarp", shadowWarps);
} else if (message.contains("Necron's Handle")) {
necronsHandles++;
necronsHandlesSession++;
ConfigHandler.writeIntConfig("catacombs", "necronsHandle", necronsHandles);
} else if (message.contains("Auto Recombobulator")) {
autoRecombs++;
autoRecombsSession++;
ConfigHandler.writeIntConfig("catacombs", "autoRecomb", autoRecombs);
} else if (message.contains("Wither Helmet")) {
witherHelms++;
witherHelmsSession++;
ConfigHandler.writeIntConfig("catacombs", "witherHelm", witherHelms);
} else if (message.contains("Wither Chestplate")) {
witherChests++;
witherChestsSession++;
ConfigHandler.writeIntConfig("catacombs", "witherChest", witherChests);
} else if (message.contains("Wither Leggings")) {
witherLegs++;
witherLegsSession++;
ConfigHandler.writeIntConfig("catacombs", "witherLegging", witherLegs);
} else if (message.contains("Wither Boots")) {
witherBoots++;
witherBootsSession++;
ConfigHandler.writeIntConfig("catacombs", "witherBoot", witherBoots);
} else if (message.contains("First Master Star")) {
firstStars++;
firstStarsSession++;
ConfigHandler.writeIntConfig("catacombs", "firstStar", firstStars);
} else if (message.contains("Second Master Star")) {
secondStars++;
secondStarsSession++;
ConfigHandler.writeIntConfig("catacombs", "secondStar", secondStars);
} else if (message.contains("Third Master Star")) {
thirdStars++;
thirdStarsSession++;
ConfigHandler.writeIntConfig("catacombs", "thirdStar", thirdStars);
} else if (message.contains("Fourth Master Star")) {
fourthStars++;
fourthStarsSession++;
ConfigHandler.writeIntConfig("catacombs", "fourthStar", fourthStars);
} else if (message.contains("Fifth Master Star")) {
fifthStars++;
fifthStarsSession++;
ConfigHandler.writeIntConfig("catacombs", "fifthStar", fifthStars);
} else if (message.contains("Dark Claymore")) {
darkClaymores++;
darkClaymoresSession++;
ConfigHandler.writeIntConfig("catacombs", "darkClaymore", darkClaymores);
} else if (message.contains("Necron Dye")) {
necronDyes++;
necronDyesSession++;
ConfigHandler.writeIntConfig("catacombs", "necronDye", necronDyes);
}
}
if (message.contains("EXTRA STATS ")) {
List<String> scoreboard = ScoreboardHandler.getSidebarLines();
for (String s : scoreboard) {
String sCleaned = ScoreboardHandler.cleanSB(s);
if (sCleaned.contains("Time Elapsed:")) {
// Get floor time
String time = sCleaned.substring(sCleaned.indexOf(":") + 2);
time = time.replaceAll("\\s", "");
int minutes = Integer.parseInt(time.substring(0, time.indexOf("m")));
int seconds = Integer.parseInt(time.substring(time.indexOf("m") + 1, time.indexOf("s")));
int timeToAdd = (minutes * 60) + seconds;
// Add time to floor
switch (Utils.currentFloor) {
case F1:
f1TimeSpent = Math.floor(f1TimeSpent + timeToAdd);
f1TimeSpentSession = Math.floor(f1TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorOneTime", f1TimeSpent);
break;
case F2:
f2TimeSpent = Math.floor(f2TimeSpent + timeToAdd);
f2TimeSpentSession = Math.floor(f2TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorTwoTime", f2TimeSpent);
break;
case F3:
f3TimeSpent = Math.floor(f3TimeSpent + timeToAdd);
f3TimeSpentSession = Math.floor(f3TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorThreeTime", f3TimeSpent);
break;
case F4:
f4TimeSpent = Math.floor(f4TimeSpent + timeToAdd);
f4TimeSpentSession = Math.floor(f4TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorFourTime", f4TimeSpent);
break;
case F5:
f5TimeSpent = Math.floor(f5TimeSpent + timeToAdd);
f5TimeSpentSession = Math.floor(f5TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorFiveTime", f5TimeSpent);
break;
case F6:
f6TimeSpent = Math.floor(f6TimeSpent + timeToAdd);
f6TimeSpentSession = Math.floor(f6TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorSixTime", f6TimeSpent);
break;
case F7:
f7TimeSpent = Math.floor(f7TimeSpent + timeToAdd);
f7TimeSpentSession = Math.floor(f7TimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "floorSevenTime", f7TimeSpent);
break;
case M1:
case M2:
case M3:
case M4:
case M5:
case M6:
case M7:
masterTimeSpent = Math.floor(masterTimeSpent + timeToAdd);
masterTimeSpentSession = Math.floor(masterTimeSpentSession + timeToAdd);
ConfigHandler.writeDoubleConfig("catacombs", "masterTime", masterTimeSpent);
break;
}
}
}
}
}
@SubscribeEvent
public void onSlotClick(ChestSlotClickedEvent event) {
if (!Utils.inDungeons) return;
ItemStack item = event.item;
if (event.inventoryName.endsWith(" Chest") && item != null) {
if (item.getDisplayName().contains("Open Reward Chest")) {
List<String> tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, false);
for (String lineUnclean : tooltip) {
String line = StringUtils.stripControlCodes(lineUnclean);
if (line.contains(" Coins") && !line.contains("NOTE:")) {
int coinsSpent = Integer.parseInt(line.replaceAll("[^\\d]", ""));
switch (Utils.currentFloor) {
case F1:
f1CoinsSpent += coinsSpent;
f1CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent);
break;
case F2:
f2CoinsSpent += coinsSpent;
f2CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent);
break;
case F3:
f3CoinsSpent += coinsSpent;
f3CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent);
break;
case F4:
f4CoinsSpent += coinsSpent;
f4CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent);
break;
case F5:
f5CoinsSpent += coinsSpent;
f5CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent);
break;
case F6:
f6CoinsSpent += coinsSpent;
f6CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent);
break;
case F7:
f7CoinsSpent += coinsSpent;
f7CoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent);
break;
case M1:
case M2:
case M3:
case M4:
case M5:
case M6:
case M7:
masterCoinsSpent += coinsSpent;
masterCoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "masterCoins", masterCoinsSpent);
break;
}
break;
}
}
} else if (item.getDisplayName().contains("Reroll Chest")) {
switch (Utils.currentFloor) {
case F6:
f6Rerolls++;
f6RerollsSession++;
ConfigHandler.writeDoubleConfig("catacombs", "floorSixRerolls", f6Rerolls);
break;
case F7:
f7Rerolls++;
f7RerollsSession++;
ConfigHandler.writeDoubleConfig("catacombs", "floorSevenRerolls", f7Rerolls);
break;
case M1:
case M2:
case M3:
case M4:
case M5:
case M6:
case M7:
masterRerolls++;
masterRerollsSession++;
ConfigHandler.writeDoubleConfig("catacombs", "masterRerolls", masterRerolls);
break;
}
}
}
}
}
|