aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features/loot/EndermanTracker.java
blob: 1cc46dbe69d6c6944cbc5725e1e7fdb779b3e84d (plain)
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
package me.Danker.features.loot;

import me.Danker.commands.ToggleCommand;
import me.Danker.handlers.ConfigHandler;
import me.Danker.utils.Utils;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StringUtils;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class EndermanTracker {

    public static int voidglooms;
    public static int nullSpheres;
    public static int TAP;
    public static int TAPDrops;
    public static int endersnakes;
    public static int summoningEyes;
    public static int manaBooks;
    public static int tuners;
    public static int atoms;
    public static int hazmats;
    public static int espressoMachines;
    public static int smartyBooks;
    public static int endRunes;
    public static int chalices;
    public static int dice;
    public static int artifacts;
    public static int skins;
    public static int mergers;
    public static int cores;
    public static int enchantRunes;
    public static int enderBooks;
    public static double time;
    public static int bosses;

    public static int voidgloomsSession = 0;
    public static int nullSpheresSession = 0;
    public static int TAPSession = 0;
    public static int TAPDropsSession = 0;
    public static int endersnakesSession = 0;
    public static int summoningEyesSession = 0;
    public static int manaBooksSession = 0;
    public static int tunersSession = 0;
    public static int atomsSession = 0;
    public static int hazmatsSession = 0;
    public static int espressoMachinesSession = 0;
    public static int smartyBooksSession = 0;
    public static int endRunesSession = 0;
    public static int chalicesSession = 0;
    public static int diceSession = 0;
    public static int artifactsSession = 0;
    public static int skinsSession = 0;
    public static int mergersSession = 0;
    public static int coresSession = 0;
    public static int enchantRunesSession = 0;
    public static int enderBooksSession = 0;
    public static double timeSession = -1;
    public static int bossesSession = -1;

    @SubscribeEvent
    public void onChat(ClientChatReceivedEvent event) {
        String message = StringUtils.stripControlCodes(event.message.getUnformattedText());

        if (!Utils.inSkyblock) return;
        if (event.type == 2) return;
        if (message.contains(":")) return;

        boolean rng = false;

        if (message.contains("   Enderman Slayer LVL ")) {
            voidglooms++;
            voidgloomsSession++;
            if (bosses != -1) {
                bosses++;
            }
            if (bossesSession != -1) {
                bossesSession++;
            }
            ConfigHandler.writeIntConfig("enderman", "voidglooms", voidglooms);
            ConfigHandler.writeIntConfig("enderman", "bossRNG", bosses);
        } else if (message.contains("RARE DROP! (") && message.contains("Twilight Arrow Poison)")) {
            int amount = LootTracker.getAmountfromMessage(message);
            TAP += amount;
            TAPSession += amount;
            TAPDrops++;
            TAPDropsSession++;
            ConfigHandler.writeIntConfig("enderman", "tap", TAP);
            ConfigHandler.writeIntConfig("enderman", "tapDrops", TAPDrops);
        } else if (message.contains("VERY RARE DROP!  (") && message.contains(" Endersnake Rune I)")) {
            endersnakes++;
            endersnakesSession++;
            ConfigHandler.writeIntConfig("enderman", "endersnakes", endersnakes);
        } else if (message.contains("VERY RARE DROP!  (Summoning Eye)")) {
            summoningEyes++;
            summoningEyesSession++;
            ConfigHandler.writeIntConfig("enderman", "summoningEyes", summoningEyes);
        } else if (message.contains("VERY RARE DROP!  (Mana Steal I)")) {
            manaBooks++;
            manaBooksSession++;
            ConfigHandler.writeIntConfig("enderman", "manaBooks", manaBooks);
        } else if (message.contains("VERY RARE DROP!  (Transmission Tuner)")) {
            tuners++;
            tunersSession++;
            ConfigHandler.writeIntConfig("enderman", "tuners", tuners);
        } else if (message.contains("VERY RARE DROP!  (Null Atom)")) {
            atoms++;
            atomsSession++;
            ConfigHandler.writeIntConfig("enderman", "atoms", atoms);
        } else if (message.contains("VERY RARE DROP!  (Hazmat Enderman)")) {
            hazmats++;
            hazmatsSession++;
            ConfigHandler.writeIntConfig("enderman", "hazmats", hazmats);
        } else if (message.contains("CRAZY RARE DROP!  (Pocket Espresso Machine)")) {
            rng = true;
            espressoMachines++;
            espressoMachinesSession++;
            ConfigHandler.writeIntConfig("enderman", "espressoMachines", espressoMachines);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "POCKET ESPRESSO MACHINE!", 3);
        } else if (message.contains("VERY RARE DROP!  (Smarty Pants I)")) {
            smartyBooks++;
            smartyBooksSession++;
            ConfigHandler.writeIntConfig("enderman", "smartyBooks", smartyBooks);
        } else if (message.contains("VERY RARE DROP!  (") && message.contains(" End Rune I)")) {
            endRunes++;
            endRunesSession++;
            ConfigHandler.writeIntConfig("enderman", "endRunes", endRunes);
        } else if (message.contains("CRAZY RARE DROP!  (Handy Blood Chalice)")) {
            rng = true;
            chalices++;
            chalicesSession++;
            ConfigHandler.writeIntConfig("enderman", "chalices", chalices);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "HANDY BLOOD CHALICE!", 3);
        } else if (message.contains("VERY RARE DROP!  (Sinful Dice)")) {
            dice++;
            diceSession++;
            ConfigHandler.writeIntConfig("enderman", "dice", dice);
        } else if (message.contains("CRAZY RARE DROP!  (Exceedingly Rare Ender Artifact Upgrader)")) {
            rng = true;
            artifacts++;
            artifactsSession++;
            ConfigHandler.writeIntConfig("enderman", "artifacts", artifacts);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDER ARTIFACT UPGRADER!", 3);
        } else if (message.contains("CRAZY RARE DROP!  (Void Conqueror Enderman Skin)")) {
            rng = true;
            skins++;
            skinsSession++;
            ConfigHandler.writeIntConfig("enderman", "skins", skins);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDERMAN SKIN!", 3);
        } else if (message.contains("VERY RARE DROP!  (Etherwarp Merger)")) {
            mergers++;
            mergersSession++;
            ConfigHandler.writeIntConfig("enderman", "mergers", mergers);
        } else if (message.contains("CRAZY RARE DROP!  (Judgement Core)")) {
            rng = true;
            cores++;
            coresSession++;
            ConfigHandler.writeIntConfig("enderman", "cores", cores);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "JUDGEMENT CORE!", 5);
        } else if (message.contains("CRAZY RARE DROP!  (") && message.contains(" Enchant Rune I)")) {
            rng = true;
            enchantRunes++;
            enchantRunesSession++;
            ConfigHandler.writeIntConfig("enderman", "enchantRunes", enchantRunes);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GRAY + "ENCHANT RUNE!", 3);
        } else if (message.contains("INSANE DROP!  (Ender Slayer VII)") || message.contains("CRAZY RARE DROP!  (Ender Slayer VII)")) {
            rng = true;
            enderBooks++;
            enderBooksSession++;
            ConfigHandler.writeIntConfig("enderman", "enderBooks", enderBooks);
            if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "ENDER SLAYER VII!", 3);
        }

        if (rng) {
            time = System.currentTimeMillis() / 1000;
            bosses = 0;
            timeSession = System.currentTimeMillis() / 1000;
            bossesSession = 0;
            ConfigHandler.writeDoubleConfig("enderman", "timeRNG", time);
            ConfigHandler.writeIntConfig("enderman", "bossRNG", 0);
        }
    }

}