funt1memax

create me an minecraft plugin like shelfshops but it allows players to use all the custom currencies i have and when they place the item in one of the slots it asks them for the price and currency

Kodari AI
KodariJul 12 at 9:00 pm 11
CurrencyShelfShops
CurrencyShelfShops is a player-run Minecraft shop plugin that lets players create personal shelf-style shops and sell item stacks through an interactive inventory. Shop owners place items into available slots, enter a price through chat, and select any configured currency. The plugin supports Vault economies, PlayerPoints, command-based custom currencies, persistent shop storage, clickable purchases, inventory space checks, configurable shop titles, currency symbols, permissions, and reloadable settings.
funt1memax

make it compatible for 1.21.1

Kodari AI
KodariJul 12 at 9:02 pm 6
  1. Update the Gradle API/toolchain targets to Minecraft 1.21.1.

  2. Check the plugin source for 1.8-era API usage that will fail against the newer API.

  3. Patch only the compatibility blockers and manifest metadata.

Updated the plugin for Minecraft 1.21.1:

  • Changed the Spigot API dependency to 1.21.1-R0.1-SNAPSHOT

  • Updated Java compatibility to Java 21

  • Added api-version: '1.21' to plugin.yml

  • Updated the plugin version to 1.0.1

  • Preserved Vault, PlayerPoints, XSeries, and existing custom-currency functionality

The local environment does not have Gradle installed, so compilation could not be run here. Use Java 21 and run:

Shell
./gradlew clean build
funt1memax

how does the persistent storage work?

Kodari AI
KodariJul 12 at 9:04 pm 5

Persistent storage uses a YAML file:

Plain Text
plugins/CurrencyShelfShops/shops.yml

What gets saved

Each player’s shop is stored by their UUID, including:

  • Shop title

  • Listing slot

  • ItemStack, including item metadata and NBT supported by Bukkit serialization

  • Price

  • Currency ID

Example structure:

YAML
shops:
  550e8400-e29b-41d4-a716-446655440000:
    title: "Player's Shop"
    listings:
      0:
        item: <serialized ItemStack>
        price: 100.5
        currency: vault
      5:
        item: <serialized ItemStack>
        price: 50.0
        currency: tokens

Loading

When the plugin starts:

  1. ShopRepository creates or accesses shops.yml.

  2. It loads the YAML configuration.

  3. It reconstructs each Shop.

  4. It reconstructs each Listing and places it in its saved slot.

  5. The shops remain in memory while the plugin is running.

Saving

The entire shops map is rewritten to shops.yml whenever:

  • A player finishes creating a listing

  • A player removes a listing

  • A customer purchases an item

The file is rewritten as a whole rather than updated one listing at a time.

Current limitation

There is no automatic shutdown save or periodic backup. Since normal shop changes are saved immediately, most data is safe, but a server crash or unexpected shutdown could lose changes that happened after the last save. Adding an onDisable() save and optional periodic saving would make the storage safer.

funt1memax

use this "``ExodusCurrenciesAPI api = ExodusCurrenciesProvider.get();

BigDecimal price = new BigDecimal("500");

if (!api.hasBalance(buyer.getUniqueId(), "gems", price)) { buyer.sendMessage("You do not have enough Gems."); return; }

CurrencyResult takeResult = api.withdraw(buyer.getUniqueId(), "gems", price); if (!takeResult.isSuccess()) { buyer.sendMessage("Purchase failed."); return; }

api.deposit(seller.getUniqueId(), "gems", price);``

Use ExodusCurrenciesProvider.get(), then use getBalance, hasBalance, withdraw, and deposit.

For selling items, use deposit(uuid, currencyId, amount).

For buying items, use hasBalance then withdraw." for the currencie

Kodari AI
KodariJul 12 at 9:05 pm 3
  1. Replace the existing currency transaction logic with ExodusCurrenciesAPI calls.

  2. Preserve configured currency IDs and apply hasBalance/withdraw for purchases and deposit for sellers.

  3. Update dependencies/imports only where required and remove incompatible currency integrations.

Please provide the ExodusCurrencies API package/imports and dependency coordinate. The snippet does not include them, and I need the exact classes to compile against:

Java
import ...ExodusCurrenciesAPI;
import ...ExodusCurrenciesProvider;
import ...CurrencyResult;

Also provide the API’s Gradle dependency or plugin JAR name if it is not already available to the project. Once supplied, I’ll replace Vault, PlayerPoints, and command-based transactions with:

  • ExodusCurrenciesProvider.get()

  • getBalance(...)

  • hasBalance(...)

  • withdraw(...)

  • deposit(...)

with the configured currency key passed as currencyId.

funt1memax

exoduscurrencie is the jar name

Kodari AI
KodariJul 12 at 9:08 pm 17
  1. Configure exoduscurrencie as the external dependency.

  2. Remove the old Vault/PlayerPoints/command currency paths.

  3. Route purchases through Exodus balance checks, withdrawal, and seller deposit.

ExodusCurrencies support is now wired in:

  • Uses the exoduscurrencie plugin JAR as a required dependency.

  • Uses ExodusCurrenciesProvider.get().

  • Supports getBalance, hasBalance, withdraw, and deposit.

  • Buyers are checked with hasBalance, then charged with withdraw.

  • Sellers receive payment through deposit(uuid, currencyId, amount).

  • Removed Vault, PlayerPoints, and command-based currency handling.

  • Configured currencies now use Exodus currency IDs directly, for example:

YAML
currencies:
  gems:
    display-name: 'Gems'
    symbol: '✦'

  coins:
    display-name: 'Coins'
    symbol: '◉'

  tokens:
    display-name: 'Tokens'
    symbol: 'T'

The plugin now requires exoduscurrencie to be installed and enabled before CurrencyShelfShops starts.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
16 1,223
src/main/java/com/kodari/currencyshelfshops/CurrencyShelfShops.java
package com.kodari.currencyshelfshops;

import com.kodari.currencyshelfshops.command.ShelfShopCommand;
import com.kodari.currencyshelfshops.currency.CurrencyManager;
import com.kodari.currencyshelfshops.data.ShopRepository;
import com.kodari.currencyshelfshops.listener.ShopListener;
import com.kodari.currencyshelfshops.shop.ShopManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class CurrencyShelfShops extends JavaPlugin {
    private ShopRepository shopRepository;
    private CurrencyManager currencyManager;
    private ShopManager shopManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.shopRepository = new ShopRepository(this);
        this.currencyManager = new CurrencyManager(this);
        this.shopManager = new ShopManager(this, shopRepository, currencyManager);

        Bukkit.getPluginManager().registerEvents(new ShopListener(shopManager), this);

        ShelfShopCommand command = new ShelfShopCommand(this, shopManager);
        getCommand("shelfshop").setExecutor(command);
        getCommand("shelfshop").setTabCompleter(command);
    }

    public ShopRepository getShopRepository() {
        return shopRepository;
    }

    public CurrencyManager getCurrencyManager() {
        return currencyManager;
    }

    public ShopManager getShopManager() {
        return shopManager;
    }
}