YKDZ / DailyShop

A SpigotMC shop plugin pursuing ultra customizability and efficiency.
https://www.spigotmc.org/resources/dailyshop-ultra-customizable-shop-plugin.116223/
GNU General Public License v3.0
2 stars 0 forks source link

DailyShop

English | 简体中文

Intro

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

Document

You can find the document here.

Todo

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.