All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.the_fireplace.grandeconomy.events.NetworkEvents Maven / Gradle / Ivy

There is a newer version: 4.1.0+1.16.5
Show newest version
package dev.the_fireplace.grandeconomy.events;

import dev.the_fireplace.grandeconomy.GrandEconomy;
import dev.the_fireplace.grandeconomy.api.CurrencyAPI;
import dev.the_fireplace.grandeconomy.command.CommonTranslationKeys;
import dev.the_fireplace.grandeconomy.config.ModConfig;
import dev.the_fireplace.grandeconomy.logintracker.LoginTracker;
import net.minecraft.class_2561;
import net.minecraft.class_3222;

public class NetworkEvents {
    public static void onPlayerJoinServer(class_3222 player) {
        LoginTracker.get(player.method_5667()).addLogin();
        if (ModConfig.getData().isShowBalanceOnJoin()) {
            class_2561 joinMessage = GrandEconomy.getTranslator().getTextForTarget(
                player.method_5667(),
                CommonTranslationKeys.BALANCE,
                CurrencyAPI.getInstance().getFormattedBalance(player.method_5667(), true)
            );
            player.method_9203(joinMessage);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy