From 1f44cedfdb1612fa80f5edef0ba0c8e5762a2143 Mon Sep 17 00:00:00 2001 From: Blank038 Date: Thu, 14 Dec 2023 21:18:30 +0800 Subject: [PATCH] style: Update market default style --- .../internal/data/DataContainer.java | 5 +- src/main/resources/market/example.yml | 21 ++- src/main/resources/market/exampleLegacy.yml | 143 ++++++++++++++++++ 3 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/market/exampleLegacy.yml diff --git a/src/main/java/com/blank038/servermarket/internal/data/DataContainer.java b/src/main/java/com/blank038/servermarket/internal/data/DataContainer.java index 4aef0bc..a281237 100644 --- a/src/main/java/com/blank038/servermarket/internal/data/DataContainer.java +++ b/src/main/java/com/blank038/servermarket/internal/data/DataContainer.java @@ -63,8 +63,9 @@ public static void loadData() { File file = new File(ServerMarket.getInstance().getDataFolder(), "market"); if (!file.exists()) { file.mkdir(); - // 输出 - ServerMarket.getInstance().saveResource("market/example.yml", "market/example.yml"); + // output default market files + String sourceFile = MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_13_R1) ? "market/example.yml" : "market/exampleLegacy.yml"; + ServerMarket.getInstance().saveResource(sourceFile, "market/example.yml"); } MARKET_DATA.clear(); Arrays.stream(file.listFiles()).iterator().forEachRemaining(MarketData::new); diff --git a/src/main/resources/market/example.yml b/src/main/resources/market/example.yml index 6c81813..0bdcecc 100644 --- a/src/main/resources/market/example.yml +++ b/src/main/resources/market/example.yml @@ -81,7 +81,7 @@ size: 54 # - 数字(小)-数字(大) 例子: 0-44 # - 数字 例子: 0 sale-item-slots: "0-44" -sale-name: "%name%" +sale-name: "&b%name%" # 物品信息 sale-info: - " " @@ -90,6 +90,13 @@ sale-info: - "&a上架时间: &f%time%" # 界面物品设定 items: + panel: + type: BLACK_STAINED_GLASS_PANE + amount: 1 + data: 0 + name: " " + slot: 46,47,51,52 + lore: [ ] up: type: paper amount: 1 @@ -111,11 +118,21 @@ items: amount: 1 data: 0 name: "&b切换分类" - slot: 46 + slot: 48 action: "type" lore: - "&f" - "&f当前: &7%saleType%" + changeSort: + type: BOOK + amount: 1 + data: 0 + name: "&b切换排序方式" + slot: 50 + action: "sort" + lore: + - "&f" + - "&f当前: &7%sortType%" store: type: chest amount: 1 diff --git a/src/main/resources/market/exampleLegacy.yml b/src/main/resources/market/exampleLegacy.yml new file mode 100644 index 0000000..c45fe02 --- /dev/null +++ b/src/main/resources/market/exampleLegacy.yml @@ -0,0 +1,143 @@ +#################### +# 这是一个市场样例 # +#################### +# 市场源编号, 设定后请勿修改 +source_id: "example" +# 支持的货币类型 +# 类型: Vault, PlayerPoints, NyEconomy货币名 +vault-type: "Vault" +# 市场权限, 有权限才能 查看和上架 +permission: "market.example" +# 市场展示名 +display-name: "&c奥利给给" +# 货币展示名 +economy-name: "金币" +# 价格范围设定 +# 价格范围 +price: + min: 1 + max: 2000000 +# 特定物品价格设定(判断: 物品类型、物品昵称、物品描述) +extra-price: + DIAMOND: 1000-10000 + "道具": 20000-30000 +# 上架物品是否公告 +sale-broadcast: true +# 是否开启商品额外信息 +show-sale-info: true +# 短写命令打开市场, 留空则表示不设定 +short-command: "exmarket" +# 玩家售出物品后的税率, 1% = 0.01 +# 权限: header.node(例如: servermarket.tax.default) +# 默认玩家拥有 default 节点权限 +tax: + header: "servermarket.tax.sell" + node: + default: 0.1 + vip: 0.05 +# 玩家上架物品后的税率, 1% = 0.01 +# 权限: header.node(例如: servermarket.tax.default) +# 默认玩家拥有 default 节点权限 +shout-tax: + header: "servermarket.tax.shout" + node: + default: 0.1 + vip: 0.05 +# 玩家上架物品数量限制(当前市场) +# 权限: header.node(例如: servermarket.limit.count.default) +# 默认玩家拥有 default 节点权限 +limit-count: + header: "servermarket.limit.count" + node: + default: 3 + vip: 10 +# 日期格式 +simple-date-format: "yyyy/MM/dd HH:mm:ss" +# 价格格式 +price-format: "%,.0f" +# 商品超时时间, 单位: 秒 +effective_time: 259200 +# 物品上架黑名单 +black-list: + type: + - "STONE" + lore: + - "&f禁止上架" +# 分类 +types: + - "all" + - "道具" +###################### +# +# 全球市场界面配置文件 +# +###################### +# 界面标题 +title: "&8全球市场面板" +# 界面大小 +size: 54 +# 显示商品的槽位 +# 支持格式: +# - 数字(小)-数字(大) 例子: 0-44 +# - 数字 例子: 0 +sale-item-slots: "0-44" +sale-name: "&b%name%" +# 物品信息 +sale-info: + - " " + - "&a售卖者: &f%seller%" + - "&a价格: &f%price%金币" + - "&a上架时间: &f%time%" +# 界面物品设定 +items: + panel: + type: STAINED_GLASS_PANE + amount: 1 + data: 15 + name: " " + slot: 46,47,51,52 + lore: [ ] + up: + type: paper + amount: 1 + data: 0 + name: "&f上一页" + slot: 45 + action: up + lore: [ ] + down: + type: paper + amount: 1 + data: 0 + name: "&f下一页" + slot: 53 + action: down + lore: [ ] + changeType: + type: STRING + amount: 1 + data: 0 + name: "&b切换分类" + slot: 48 + action: "type" + lore: + - "&f" + - "&f当前: &7%saleType%" + changeSort: + type: BOOK + amount: 1 + data: 0 + name: "&b切换排序方式" + slot: 50 + action: "sort" + lore: + - "&f" + - "&f当前: &7%sortType%" + store: + type: chest + amount: 1 + data: 0 + name: "&e个人仓库" + slot: 49 + action: store + lore: [ ] \ No newline at end of file