Skip to content

YKDZ/DailyShop

Repository files navigation

DailyShop

English | 简体中文

Intro

A SpigotMC plugin inspired by DailyShop. Pursuing ultra customizability and efficiency.

Document

You can find the document here.

Todo

  • Dynamic pricing based on market feedback
  • BE GUI
  • Total market volume
  • Transaction log
  • SQL Support
  • Random amount and amount based price
  • List product by condition
  • Discount
  • Manually specifying restock results
  • Transition limit
  • Cart
  • Merchant
  • Buy more
  • More gui type
  • Cart Collection & Order again
  • Gui icon condition

API

Maven

<repositories>
    <repository>
        <id>jitpack</id>
        <url>https://jitpack.io/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>cn.encmys</groupId>
        <artifactId>DailyShop</artifactId>
        <version>{VERSION}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Gradle (Kotlin)

repositories {
    maven("https://jitpack.io/")
}
dependencies {
    compileOnly("cn.encmys:DailyShop:{VERSION}")
}

Example Usage

public class MyPlugin extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        // Get a shop instance by shop id
        Shop shop = DailyShop.SHOP_FACTORY.getShop("black_market");
        // Restock a shop
        shop.getShopStocker().stock();
        // Modify balance of shop in merchant mode
        if (shop.getShopCashier().isMerchant()) {
            // Increase balance by 100
            shop.getShopCashier().modifyBalance(100);
        }

        // Get a product by product id
        Product product = DailyShop.PRODUCT_FACTORY.getProduct("DIAMOND_ORE");
        // Restock a product
        product.getProductStock().stock();
    }
}

Thanks to

that make this plugin possible.