Skip to content

Commit

Permalink
更新默认商店配置
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Jan 27, 2024
1 parent 67b19ef commit 0ea41c7
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 311 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lanink.crystalwars.supplier;

import cn.lanink.crystalwars.CrystalWars;
import cn.lanink.gamecore.utils.ZipUtils;
import cn.nukkit.item.Item;
import lombok.Getter;

Expand Down Expand Up @@ -37,20 +38,16 @@ public static void loadAllSupplyConfig() {
File dir = new File(CRYSTAL_WARS.getDataFolder(), "/Supply/");
if(!dir.exists()) {
dir.mkdirs();
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/items/goldenApple.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/items/swordDiamond.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/items/swordIron.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/items/swordIronKnockback.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/items/swordStone.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/items/wool.yml");

CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageBlock.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageQuickBuy.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageProp.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageTool.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageWeapon.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageFood.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply/pages/pageArmor.yml");
CRYSTAL_WARS.saveResource("Supply/DefaultSupply.data", true);
try {
ZipUtils.unzip(dir + "/DefaultSupply.data", dir.getAbsolutePath());
File file = new File(dir, "/DefaultSupply.data");
if(file.exists()) {
file.delete();
}
} catch (Exception e) {
CRYSTAL_WARS.getLogger().error(CrystalWars.getInstance().getLang().translateString("supply_createDefaultSupplyError"), e);
}
}
final File[] files = dir.listFiles();
if(files == null) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/Resources/Language/en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ buyItem_notInRoom=§c[Warning] You're not in a game room!
buyItem_success=Success!
buyItem_ReturnToMainPage=Return to Main Page
themeManager_loadTemplate=%1% templates loaded
supply_createDefaultSupplyError=Default store configuration creation failed! Please try unzip the plugin configuration file manually!
supply_loadShopConfig=%1% shops loaded!
supply_loadItemsFailed="Item:%s% load failed, please check your config!
supply_undefinedItemCost=Item:%1% 's cost is undefined! Player can buy it for free!
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/Resources/Language/zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ buyItem_notInRoom=§c[警告] 你没有加入任何游戏!
buyItem_success=购买成功!
buyItem_ReturnToMainPage=返回到主界面
themeManager_loadTemplate=成功加载 %1% 个模板
supply_createDefaultSupplyError=默认商店配置创建失败!请尝试在插件配置文件手动解压!
supply_loadShopConfig=已成功加载 %1% 个商店配置
supply_loadItemsFailed="物品:%s% 加载失败,请检查配置文件!
supply_undefinedItemCost=物品:%1% 未设置成本!玩家可以免费获取!
Expand Down
Binary file added src/main/resources/Supply/DefaultSupply.data
Binary file not shown.
10 changes: 0 additions & 10 deletions src/main/resources/Supply/DefaultSupply/items/goldenApple.yml

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions src/main/resources/Supply/DefaultSupply/items/swordIron.yml

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/resources/Supply/DefaultSupply/items/swordStone.yml

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/resources/Supply/DefaultSupply/items/wool.yml

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/resources/Supply/DefaultSupply/pages/pageArmor.yml

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/resources/Supply/DefaultSupply/pages/pageBlock.yml

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/resources/Supply/DefaultSupply/pages/pageFood.yml

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/resources/Supply/DefaultSupply/pages/pageProp.yml

This file was deleted.

36 changes: 0 additions & 36 deletions src/main/resources/Supply/DefaultSupply/pages/pageQuickBuy.yml

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/resources/Supply/DefaultSupply/pages/pageTool.yml

This file was deleted.

37 changes: 0 additions & 37 deletions src/main/resources/Supply/DefaultSupply/pages/pageWeapon.yml

This file was deleted.

0 comments on commit 0ea41c7

Please sign in to comment.