dev.the_fireplace.grandeconomy.events.NetworkEvents Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of GrandEconomy Show documentation
Show all versions of GrandEconomy Show documentation
A server-side economy mod/api for Minecraft.
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