Skip to content

BankManager

Wenox edited this page Oct 9, 2025 · 1 revision

BankManager

Overview

The BankManager class manages player bank accounts, loans, merits, and transaction histories within the SkyblockCore plugin. It provides static methods to add, reduce, and retrieve bank money and loans, manage loan merits, and track transaction logs.

Key Features

  • Manage player bank money balance.
  • Handle loan amounts and loan merits.
  • Track loan time and interest tasks.
  • Maintain transaction history for deposits, withdrawals, loans, and repayments.
  • Automatically schedule interest tasks for players with bank money.

Usage from Other Plugins

To use BankManager from another plugin:

  1. Add dependency in your plugin.yml:

    depend: [SkyblockCore]
    
  2. Import the class:

    use Biswajit\Core\Managers\BankManager;
    use Biswajit\Core\Player;
  3. Call static methods directly, passing Player instances.

Important Notes

  • Player instances must be of type Biswajit\Core\Player.
  • Interest tasks are scheduled automatically when bank money is added.
  • Transactions are stored as JSON-encoded arrays in player economy data.
  • Recovering loans currently resets bank and economy money to zero; player punishment is a TODO.

Method Examples

// Get bank money
$balance = BankManager::getBankMoney($player);

// Add money to bank
BankManager::addBankMoney($player, 100.0);

// Reduce bank money
BankManager::reduceBankMoney($player, 50.0);

// Get loan amount
$loan = BankManager::getLoan($player);

// Add loan
BankManager::addLoan($player, 200.0);

// Pay loan
BankManager::reduceLoan($player, 100.0);

// Get transaction history
$transactions = BankManager::getTransactions($player);

Version Information

  • Package: Biswajit\Core\Managers
  • Author: Biswajit
  • Version: 1.0.0

Clone this wiki locally