use of org.spongepowered.api.service.economy.account.UniqueAccount in project Almura by AlmuraDev.
the class ServerHeadUpDisplayManager method onEconomyTransaction.
@Listener(order = Order.LAST)
public void onEconomyTransaction(EconomyTransactionEvent event) {
final TransactionResult result = event.getTransactionResult();
final Account account = result.getAccount();
if (account instanceof UniqueAccount) {
Sponge.getServer().getPlayer(((UniqueAccount) account).getUniqueId()).ifPresent(player -> Task.builder().delayTicks(1).execute(() -> {
final ClientboundPlayerCurrencyPacket packet = this.createPlayerCurrencyPacket(player);
if (packet != null) {
this.network.sendTo(player, packet);
}
}).submit(this.container));
}
}
Aggregations