Search in sources :

Example 1 with HypixelGetCoinsEvent

use of cc.hyperium.event.network.server.hypixel.HypixelGetCoinsEvent in project Hyperium by HyperiumClient.

the class GeneralStatisticsTracking method onChat.

@InvokeEvent
public void onChat(ChatEvent event) {
    // Check how much the time has changed since the last use.
    checkTimes();
    String line = event.getChat().getUnformattedText();
    if (line.startsWith("+") && line.contains("coins")) {
        int coins = Integer.parseInt(line.split("\\+")[1].split(" coins")[0]);
        // Increment coin counters.
        EventBus.INSTANCE.post(new HypixelGetCoinsEvent(coins));
        lifetimeCoins += coins;
        monthlyCoins += coins;
        dailyCoins += coins;
    }
}
Also used : HypixelGetCoinsEvent(cc.hyperium.event.network.server.hypixel.HypixelGetCoinsEvent) InvokeEvent(cc.hyperium.event.InvokeEvent)

Aggregations

InvokeEvent (cc.hyperium.event.InvokeEvent)1 HypixelGetCoinsEvent (cc.hyperium.event.network.server.hypixel.HypixelGetCoinsEvent)1